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