Skip to content

Commit 13c7e50

Browse files
robrichardyaacovCR
authored andcommitted
clarify null behavior of if
1 parent 52c4a67 commit 13c7e50

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
@@ -2205,7 +2205,7 @@ fragment someFragment on User {
22052205

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

22422242
- `if: Boolean! = true` - When `true`, field _should_ be streamed. When `false`,
22432243
the field will not be streamed and all list items will be included in the
2244-
initial response. If omitted, defaults to `true`.
2244+
initial response. Defaults to `true` when omitted or null.
22452245
- `label: String` - May be used by GraphQL clients to identify the data from
22462246
responses and associate it with the corresponding stream directive. If
22472247
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
@@ -626,8 +626,8 @@ asyncRecord, visitedFragments, deferredGroupedFieldsList):
626626
- If {selection} is a {FragmentSpread}:
627627
- Let {fragmentSpreadName} be the name of {selection}.
628628
- If {fragmentSpreadName} provides the directive `@defer` and its {if}
629-
argument is {true} or is a variable in {variableValues} with the value
630-
{true}:
629+
argument is not {false} and is not a variable in {variableValues} with the
630+
value {false}:
631631
- Let {deferDirective} be that directive.
632632
- If {deferDirective} is not defined:
633633
- If {fragmentSpreadName} is in {visitedFragments}, continue with the next
@@ -667,19 +667,20 @@ asyncRecord, visitedFragments, deferredGroupedFieldsList):
667667
fragmentType)} is false, continue with the next {selection} in
668668
{selectionSet}.
669669
- Let {fragmentSelectionSet} be the top-level selection set of {selection}.
670-
- If {InlineFragment} provides the directive `@defer`, let {deferDirective}
671-
be that directive.
672-
- If {deferDirective}'s {if} argument is {true} or is a variable in
673-
{variableValues} with the value {true}:
674-
- Let {label} be the value or the variable to {deferDirective}'s {label}
675-
argument.
676-
- Let {deferredGroupedFields} be the result of calling
677-
{CollectFields(objectType, objectValue, fragmentSelectionSet,
678-
variableValues, path, asyncRecord, visitedFragments,
679-
deferredGroupedFieldsList)}.
680-
- Append a record containing {label} and {deferredGroupedFields} to
681-
{deferredGroupedFieldsList}.
682-
- Continue with the next {selection} in {selectionSet}.
670+
- If {InlineFragment} provides the directive `@defer` and its {if} argument
671+
is not {false} and is not a variable in {variableValues} with the value
672+
{false}:
673+
- Let {deferDirective} be that directive.
674+
- If {deferDirective} is defined:
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}.
683684
- Let {fragmentGroupedFieldSet} be the result of calling
684685
{CollectFields(objectType, objectValue, fragmentSelectionSet,
685686
variableValues, path, asyncRecord, visitedFragments,
@@ -944,9 +945,9 @@ subsequentPayloads, asyncRecord):
944945
- If {result} is an iterator:
945946
- Let {field} be the first entry in {fields}.
946947
- Let {innerType} be the inner type of {fieldType}.
947-
- If {field} provides the directive `@stream` and its {if} argument is
948-
{true} or is a variable in {variableValues} with the value {true} and
949-
{innerType} is the outermost return type of the list type defined for
948+
- If {field} provides the directive `@stream` and its {if} argument is not
949+
{false} and is not a variable in {variableValues} with the value {false}
950+
and {innerType} is the outermost return type of the list type defined for
950951
{field}:
951952
- Let {streamDirective} be that directive.
952953
- Let {initialCount} be the value or variable provided to

0 commit comments

Comments
 (0)