Skip to content

Commit

Permalink
docs: Update list documentation (#6455)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhimanyusinghgaur committed Sep 16, 2020
1 parent 96f4d0f commit 07cff6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion wiki/content/graphql/schema/types.md
Expand Up @@ -11,7 +11,9 @@ This page describes how you use GraphQL types to set the Dgraph GraphQL schema.

Dgraph GraphQL comes with the standard GraphQL scalars: `Int`, `Float`, `String`, `Boolean` and `ID`. There's also a `DateTime` scalar - represented as a string in RFC3339 format.

Scalars `Int`, `Float`, `String` and `DateTime` can be used in lists. All scalars may be nullable or non-nullable.
Scalars `Int`, `Float`, `String` and `DateTime` can be used in lists. Note that lists behave like an unordered set in Dgraph. For example: `["e1", "e1", "e2"]` may get stored as `["e2", "e1"]`, i.e., duplicate values will not be stored and order may not be preserved.

All scalars may be nullable or non-nullable.

The `ID` type is special. IDs are auto-generated, immutable, and can be treated as strings. Fields of type `ID` can be listed as nullable in a schema, but Dgraph will never return null.

Expand Down
4 changes: 2 additions & 2 deletions wiki/content/query-language/schema.md
Expand Up @@ -435,8 +435,7 @@ For predicates with the `@count` Dgraph indexes the number of edges out of each
## List Type

Predicate with scalar types can also store a list of values if specified in the schema. The scalar
type needs to be enclosed within `[]` to indicate that its a list type. These lists are like an
unordered set.
type needs to be enclosed within `[]` to indicate that its a list type.

```
occupations: [string] .
Expand All @@ -448,6 +447,7 @@ score: [int] .
* Querying for these predicates would return the list in an array.
* Indexes can be applied on predicates which have a list type and you can use [Functions]({{<relref "query-language/functions.md">}}) on them.
* Sorting is not allowed using these predicates.
* These lists are like an unordered set. For example: `["e1", "e1", "e2"]` may get stored as `["e2", "e1"]`, i.e., duplicate values will not be stored and order may not be preserved.

## Filtering on list

Expand Down

0 comments on commit 07cff6f

Please sign in to comment.