Skip to content

Improve clarity for treating null for List values #213

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

Merged
merged 1 commit into from
Sep 19, 2016
Merged
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
17 changes: 11 additions & 6 deletions spec/Section 3 -- Type System.md
Original file line number Diff line number Diff line change
Expand Up @@ -814,11 +814,16 @@ implementation.
When expected as an input, list values are accepted only when each item in the
list can be accepted by the list's item type.

If the value passed as an input to a list type is *not* as list, it should be
coerced as though the input was a list of size one, where the value passed is
the only item in the list. This is to allow inputs that accept a "var args"
to declare their input type as a list; if only one argument is passed (a common
case), the client can just pass that value rather than constructing the list.
If the value passed as an input to a list type is *not* a list and not the
{null} value, it should be coerced as though the input was a list of size one,
where the value passed is the only item in the list. This is to allow inputs
that accept a "var args" to declare their input type as a list; if only one
argument is passed (a common case), the client can just pass that value rather
than constructing the list.

Note that when a {null} value is provided via a runtime variable value for a
list type that it is interpretted as no list being provided, and not a list of
size one with the value {null}.


### Non-Null
Expand Down Expand Up @@ -878,7 +883,7 @@ query withNullableVariable($var: String) {
}
```

#### Non-Null type validation
**Non-Null type validation**

1. A Non-Null type must not wrap another Non-Null type.

Expand Down