Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cherry-pick v20.07: docs: Update list documentation (#6455) #6461

Merged
merged 1 commit into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion wiki/content/graphql/schema/types.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 @@ -449,6 +448,7 @@ score: [int] .
* Indexes can be applied on predicates which have a list type and you can use [Functions]({{<ref
"#functions">}}) 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