Skip to content

Commit 9103fdb

Browse files
committed
clarify null behavior of if
1 parent 4b6554e commit 9103fdb

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

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

21962196
- `if: Boolean! = true` - When `true`, field _should_ be streamed. When `false`,
21972197
the field will not be streamed and all list items will be included in the
2198-
initial response. If omitted, defaults to `true`.
2198+
initial response. Defaults to `true` when omitted or null.
21992199
- `label: String` - May be used by GraphQL clients to identify the data from
22002200
responses and associate it with the corresponding stream directive. If
22012201
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)