@@ -376,12 +376,12 @@ ExecuteSelectionSet(selectionSet, objectType, objectValue, variableValues):
376
376
Note: {resultMap} is ordered by which fields appear first in the operation. This
377
377
is explained in greater detail in the Field Collection section below.
378
378
379
+ ** Errors and Non-Null Types**
380
+
379
381
<a name =" sec-Executing-Selection-Sets.Errors-and-Non-Null-Fields " >
380
- <!-- This link exists for legacy hyperlink support -->
382
+ <!-- Legacy link, this section was previously titled "Errors and Non-Null Fields" -->
381
383
</a >
382
384
383
- ** Errors and Non-Null Types**
384
-
385
385
If during {ExecuteSelectionSet()} a _ response position_ with a non-null type
386
386
raises an _ execution error_ then that error must propagate to the parent
387
387
response position (the entire selection set in the case of a field, or the
@@ -626,9 +626,6 @@ the type system to have a specific input type.
626
626
At each argument position in an operation may be a literal {Value}, or a
627
627
{Variable} to be provided at runtime.
628
628
629
- Any _ request error_ raised during {CoerceArgumentValues()} should be treated
630
- instead as an _ execution error_ .
631
-
632
629
CoerceArgumentValues(objectType, field, variableValues):
633
630
634
631
- Let {coercedValues} be an empty unordered Map.
@@ -672,6 +669,9 @@ CoerceArgumentValues(objectType, field, variableValues):
672
669
{coercedValue}.
673
670
- Return {coercedValues}.
674
671
672
+ Any _ request error_ raised as a result of input coercion during
673
+ {CoerceArgumentValues()} should be treated instead as an _ execution error_ .
674
+
675
675
Note: Variable values are not coerced because they are expected to be coerced
676
676
before executing the operation in {CoerceVariableValues()}, and valid operations
677
677
must only allow usage of variables of appropriate types.
@@ -807,45 +807,45 @@ MergeSelectionSets(fields):
807
807
- Append all selections in {fieldSelectionSet} to {selectionSet}.
808
808
- Return {selectionSet}.
809
809
810
+ ### Handling Execution Errors
811
+
810
812
<a name =" sec-Handling-Field-Errors " >
811
- <!-- This link exists for legacy hyperlink support -->
813
+ <!-- Legacy link, this section was previously titled "Handling Execution Errors" -->
812
814
</a >
813
815
814
- ### Handling Execution Errors
815
-
816
- An _ execution error_ is an error raised from a particular field during value
817
- resolution or coercion. While these errors should be reported in the response,
818
- they are "handled" by producing a partial response.
816
+ An _ execution error_ is an error raised during field execution, value resolution
817
+ or coercion, at a specific _ response position_ . While these errors should be
818
+ reported in the response, they are "handled" by producing a partial response.
819
819
820
820
Note: This is distinct from a _ request error_ which results in a response with
821
821
no data.
822
822
823
823
If an execution error is raised while resolving a field (either directly or
824
- nested inside any lists), it is handled as though the position at which the
825
- error occurred resulted in {null}, and the error must be added to the {"errors"}
826
- list in the response.
824
+ nested inside any lists), it is handled as though the _ response position _ at
825
+ which the error occurred resolved to {null}, and the error must be added to the
826
+ {"errors"} list in the response.
827
827
828
828
If the result of resolving a _ response position_ is {null} (either due to the
829
829
result of {ResolveFieldValue()} or because an execution error was raised), and
830
830
that position is of a ` Non-Null ` type, then an execution error is raised at that
831
831
position. The error must be added to the {"errors"} list in the response.
832
832
833
- If a _ response position_ returns {null} because of an execution error which has
834
- already been added to the {"errors"} list in the response, the {"errors"} list
835
- must not be further affected. That is, only one error should be added to the
836
- errors list per _ response position_ .
833
+ If a _ response position_ resolves to {null} because of an execution error which
834
+ has already been added to the {"errors"} list in the response, the {"errors"}
835
+ list must not be further affected. That is, only one error should be added to
836
+ the errors list per _ response position_ .
837
837
838
838
Since ` Non-Null ` response positions cannot be {null}, execution errors are
839
839
propagated to be handled by the parent _ response position_ . If the parent
840
840
response position may be {null} then it resolves to {null}, otherwise if it is a
841
841
` Non-Null ` type, the execution error is further propagated to its parent
842
842
_ response position_ .
843
843
844
- If a ` List ` type wraps a ` Non-Null ` type, and one of the elements of that list
845
- resolves to {null}, then the entire list must resolve to {null}. If the ` List `
846
- type is also wrapped in a ` Non-Null ` , the execution error continues to propagate
847
- upwards.
844
+ If a ` List ` type wraps a ` Non-Null ` type, and one of the _ response position _
845
+ elements of that list resolves to {null}, then the entire list _ response
846
+ position _ must resolve to {null}. If the ` List ` type is also wrapped in a
847
+ ` Non-Null ` , the execution error continues to propagate upwards.
848
848
849
849
If every _ response position_ from the root of the request to the source of the
850
- execution error returns a ` Non-Null ` type, then the {"data"} entry in the
851
- response should be {null}.
850
+ execution error has a ` Non-Null ` type, then the {"data"} entry in the response
851
+ should be {null}.
0 commit comments