Skip to content

Commit a20faeb

Browse files
committed
Clarify non-null example
Fixes #52
1 parent 44f3e9d commit a20faeb

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

Section 3 -- Type System.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ then an error should be raised.
706706

707707
**Input Coercion**
708708

709-
Note that `null` is not a valid keyword in GraphQL, so a query cannot look like:
709+
Note that `null` is not a value in GraphQL, so a query cannot look like:
710710

711711
```!graphql
712712
{
@@ -715,22 +715,31 @@ Note that `null` is not a valid keyword in GraphQL, so a query cannot look like:
715715
```
716716

717717
to indicate that the argument is null. Instead, an argument would be null only
718-
if it is passed a variable that is then not set:
718+
if it is omitted:
719719

720720
```graphql
721721
{
722+
field
723+
}
724+
```
725+
726+
Or if passed a variable of a nullable type that at runtime was not provided
727+
a value:
728+
729+
```graphql
730+
query withNullableVariable($var: String) {
722731
field(arg: $var)
723732
}
724733
```
725734

726-
Hence, if the value for a non-null is hard-coded in the query, it is always
735+
Hence, if the value for a Non Null type is hard-coded in the query, it is always
727736
coerced using the input coercion for the wrapped type.
728737

729-
When a non-null input has its value set using a variable, the coerced value
738+
When a Non Null input has its value set using a variable, the coerced value
730739
should be `null` if the provided value is `null`-like in the provided
731740
representation, or if the provided value is omitted. Otherwise, the coerced
732-
value is the result of running the wrapped type's input coercion on the provided
733-
value.
741+
value is the result of running the wrapped type's input coercion on the
742+
provided value.
734743

735744
## Directives
736745

0 commit comments

Comments
 (0)