Skip to content

Commit b21bb99

Browse files
committed
Add note about nullable variables with default values
1 parent df1acea commit b21bb99

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

spec/Section 6 -- Execution.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,13 @@ Note: Variable values are not coerced because they are expected to be coerced
645645
before executing the operation in {CoerceVariableValues()}, and valid operations
646646
must only allow usage of variables of appropriate types.
647647

648+
Note: When a default value exists for a variable definition, the type of the
649+
variable is allowed to be nullable even if it is used in a non-nullable
650+
position, see
651+
[Allowing Optional Variables When Default Values Exist](#sec-All-Variable-Usages-Are-Allowed.Allowing-Optional-Variables-When-Default-Values-Exist)
652+
in Validation. If the value for a variable is explicitly {null} and is used in a
653+
non-nullable position, a _field error_ will be raised.
654+
648655
### Value Resolution
649656

650657
While nearly all of GraphQL execution can be described generically, ultimately

0 commit comments

Comments
 (0)