@@ -456,8 +456,11 @@ If during {ExecuteSelectionSet()} a field with a non-null {fieldType} raises a
456
456
_ field error_ then that error must propagate to this entire selection set,
457
457
either resolving to {null} if allowed or further propagated to a parent field.
458
458
459
- If this occurs, any sibling fields which have not yet executed or have not yet
460
- yielded a value may be cancelled to avoid unnecessary work.
459
+ If this occurs, any defer or stream executions with a path that starts with the
460
+ same path as the resolved {null} must not return their results to the client.
461
+ These defer or stream executions or any sibling fields which have not yet
462
+ executed or have not yet yielded a value may be cancelled to avoid unnecessary
463
+ work.
461
464
462
465
Note: See [ Handling Field Errors] ( #sec-Handling-Field-Errors ) for more about
463
466
this behavior.
@@ -748,7 +751,11 @@ variableValues, parentRecord, subsequentPayloads):
748
751
- Wait for the result of {dataExecution} on {parentRecord}.
749
752
- If {errors} is not empty:
750
753
- Add an entry to {payload} named ` errors ` with the value {errors}.
751
- - Add an entry to {payload} named ` data ` with the value {resultMap}.
754
+ - If a field error was raised, causing a {null} to be propagated to
755
+ {responseValue}, and {objectType} is a Non-Nullable type:
756
+ - Add an entry to {payload} named ` data ` with the value {null}.
757
+ - Otherwise:
758
+ - Add an entry to {payload} named ` data ` with the value {resultMap}.
752
759
- Add an entry to {payload} named ` label ` with the value {label}.
753
760
- Add an entry to {payload} named ` path ` with the value {path}.
754
761
- Return {payload}.
@@ -923,8 +930,12 @@ variableValues, subsequentPayloads):
923
930
- Wait for the result of {dataExecution} on {parentRecord}.
924
931
- If {errors} is not empty:
925
932
- Add an entry to {payload} named ` errors ` with the value {errors}.
926
- - Add an entry to {payload} named ` items ` with a list containing the value
927
- {data}.
933
+ - If a field error was raised, causing a {null} to be propagated to {data},
934
+ and {innerType} is a Non-Nullable type:
935
+ - Add an entry to {payload} named ` items ` with the value {null}.
936
+ - Otherwise:
937
+ - Add an entry to {payload} named ` items ` with a list containing the value
938
+ {data}.
928
939
- Add an entry to {payload} named ` label ` with the value {label}.
929
940
- Add an entry to {payload} named ` path ` with the value {itemPath}.
930
941
- Return {payload}.
@@ -1100,6 +1111,21 @@ resolves to {null}, then the entire list must resolve to {null}. If the `List`
1100
1111
type is also wrapped in a ` Non-Null ` , the field error continues to propagate
1101
1112
upwards.
1102
1113
1114
+ When a field error is raised inside ` ExecuteDeferredFragment ` or
1115
+ ` ExecuteStreamField ` , the defer and stream payloads act as error boundaries.
1116
+ That is, the null resulting from a ` Non-Null ` type cannot propagate outside of
1117
+ the boundary of the defer or stream payload.
1118
+
1119
+ If a fragment with the ` defer ` directive is spread on a Non-Nullable object
1120
+ type, and a field error has caused a {null} to propagate to the associated
1121
+ object, the {null} should not propagate any further, and the associated Defer
1122
+ Payload's ` data ` field must be set to {null}.
1123
+
1124
+ If the ` stream ` directive is present on a list field with a Non-Nullable inner
1125
+ type, and a field error has caused a {null} to propagate to the list item, the
1126
+ {null} should not propagate any further, and the associated Stream Payload's
1127
+ ` item ` field must be set to {null}.
1128
+
1103
1129
If all fields from the root of the request to the source of the field error
1104
1130
return ` Non-Null ` types, then the {"data"} entry in the response should be
1105
1131
{null}.
0 commit comments