Skip to content

Commit 14e200c

Browse files
robrichardyaacovCR
authored andcommitted
clarify null behavior of if
1 parent 0ba2fba commit 14e200c

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

spec/Section 3 -- Type System.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,7 +2204,7 @@ fragment someFragment on User {
22042204

22052205
- `if: Boolean! = true` - When `true`, fragment _should_ be deferred. When
22062206
`false`, fragment will not be deferred and data will be included in the
2207-
initial response. If omitted, defaults to `true`.
2207+
initial response. Defaults to `true` when omitted or null.
22082208
- `label: String` - May be used by GraphQL clients to identify the data from
22092209
responses and associate it with the corresponding defer directive. If
22102210
provided, the GraphQL Server must add it to the corresponding payload. `label`
@@ -2240,7 +2240,7 @@ query myQuery($shouldStream: Boolean) {
22402240

22412241
- `if: Boolean! = true` - When `true`, field _should_ be streamed. When `false`,
22422242
the field will not be streamed and all list items will be included in the
2243-
initial response. If omitted, defaults to `true`.
2243+
initial response. Defaults to `true` when omitted or null.
22442244
- `label: String` - May be used by GraphQL clients to identify the data from
22452245
responses and associate it with the corresponding stream directive. If
22462246
provided, the GraphQL Server must add it to the corresponding payload. `label`

spec/Section 6 -- Execution.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -627,8 +627,8 @@ asyncRecord, visitedFragments, deferredGroupedFieldsList):
627627
- If {selection} is a {FragmentSpread}:
628628
- Let {fragmentSpreadName} be the name of {selection}.
629629
- If {fragmentSpreadName} provides the directive `@defer` and its {if}
630-
argument is {true} or is a variable in {variableValues} with the value
631-
{true}:
630+
argument is not {false} and is not a variable in {variableValues} with the
631+
value {false}:
632632
- Let {deferDirective} be that directive.
633633
- If {deferDirective} is not defined:
634634
- If {fragmentSpreadName} is in {visitedFragments}, continue with the next
@@ -668,19 +668,20 @@ asyncRecord, visitedFragments, deferredGroupedFieldsList):
668668
fragmentType)} is false, continue with the next {selection} in
669669
{selectionSet}.
670670
- Let {fragmentSelectionSet} be the top-level selection set of {selection}.
671-
- If {InlineFragment} provides the directive `@defer`, let {deferDirective}
672-
be that directive.
673-
- If {deferDirective}'s {if} argument is {true} or is a variable in
674-
{variableValues} with the value {true}:
675-
- Let {label} be the value or the variable to {deferDirective}'s {label}
676-
argument.
677-
- Let {deferredGroupedFields} be the result of calling
678-
{CollectFields(objectType, objectValue, fragmentSelectionSet,
679-
variableValues, path, asyncRecord, visitedFragments,
680-
deferredGroupedFieldsList)}.
681-
- Append a record containing {label} and {deferredGroupedFields} to
682-
{deferredGroupedFieldsList}.
683-
- Continue with the next {selection} in {selectionSet}.
671+
- If {InlineFragment} provides the directive `@defer` and its {if} argument
672+
is not {false} and is not a variable in {variableValues} with the value
673+
{false}:
674+
- Let {deferDirective} be that directive.
675+
- If {deferDirective} is defined:
676+
- Let {label} be the value or the variable to {deferDirective}'s {label}
677+
argument.
678+
- Let {deferredGroupedFields} be the result of calling
679+
{CollectFields(objectType, objectValue, fragmentSelectionSet,
680+
variableValues, path, asyncRecord, visitedFragments,
681+
deferredGroupedFieldsList)}.
682+
- Append a record containing {label} and {deferredGroupedFields} to
683+
{deferredGroupedFieldsList}.
684+
- Continue with the next {selection} in {selectionSet}.
684685
- Let {fragmentGroupedFieldSet} be the result of calling
685686
{CollectFields(objectType, objectValue, fragmentSelectionSet,
686687
variableValues, path, asyncRecord, visitedFragments,
@@ -945,9 +946,9 @@ subsequentPayloads, asyncRecord):
945946
- If {result} is an iterator:
946947
- Let {field} be the first entry in {fields}.
947948
- Let {innerType} be the inner type of {fieldType}.
948-
- If {field} provides the directive `@stream` and its {if} argument is
949-
{true} or is a variable in {variableValues} with the value {true} and
950-
{innerType} is the outermost return type of the list type defined for
949+
- If {field} provides the directive `@stream` and its {if} argument is not
950+
{false} and is not a variable in {variableValues} with the value {false}
951+
and {innerType} is the outermost return type of the list type defined for
951952
{field}:
952953
- Let {streamDirective} be that directive.
953954
- Let {initialCount} be the value or variable provided to

0 commit comments

Comments
 (0)