File tree Expand file tree Collapse file tree 1 file changed +23
-7
lines changed Expand file tree Collapse file tree 1 file changed +23
-7
lines changed Original file line number Diff line number Diff line change @@ -711,15 +711,31 @@ then an error should be raised.
711
711
712
712
** Input Coercion**
713
713
714
- When accepted as an input, each item in the list should be coerced as per
715
- the input coercion of the item type.
714
+ Note that ` null ` is not a valid keyword in GraphQL, so a query cannot look like:
716
715
717
- If the value passed as an input to a list type is * not* as list, it should be
718
- coerced as though the input was a list of size one, where the value passed is
719
- the only item in the list. This is to allow inputs that accept a "var args"
720
- to declare their input type as a list; if only one argument is passed (a common
721
- case), the client can just pass that value rather than constructing the list.
716
+ ``` !graphql
717
+ {
718
+ field(arg: null)
719
+ }
720
+ ```
721
+
722
+ to indicate that the argument is null. Instead, an argument would be null only
723
+ if it is passed a variable that is then not set:
724
+
725
+ ``` graphql
726
+ {
727
+ field (arg : $var )
728
+ }
729
+ ```
730
+
731
+ Hence, if the value for a non-null is hard-coded in the query, it is always
732
+ coerced using the input coercion for the wrapped type.
722
733
734
+ When a non-null input has its value set using a variable, the coerced value
735
+ should be ` null ` if the provided value is ` null ` -like in the provided
736
+ representation, or if the provided value is omitted. Otherwise, the coerced
737
+ value is the result of running the wrapped type's input coercion on the provided
738
+ value.
723
739
724
740
## Directives
725
741
You can’t perform that action at this time.
0 commit comments