Skip to content

Commit ff4732e

Browse files
committed
lift up + other feedback
1 parent 05737c8 commit ff4732e

File tree

2 files changed

+49
-21
lines changed

2 files changed

+49
-21
lines changed

spec/Section 6 -- Execution.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,12 +376,12 @@ ExecuteSelectionSet(selectionSet, objectType, objectValue, variableValues):
376376
Note: {resultMap} is ordered by which fields appear first in the operation. This
377377
is explained in greater detail in the Field Collection section below.
378378

379+
**Errors and Non-Null Types**
380+
379381
<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" -->
381383
</a>
382384

383-
**Errors and Non-Null Types**
384-
385385
If during {ExecuteSelectionSet()} a _response position_ with a non-null type
386386
raises an _execution error_ then that error must propagate to the parent
387387
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.
626626
At each argument position in an operation may be a literal {Value}, or a
627627
{Variable} to be provided at runtime.
628628

629-
Any _request error_ raised during {CoerceArgumentValues()} should be treated
630-
instead as an _execution error_.
631-
632629
CoerceArgumentValues(objectType, field, variableValues):
633630

634631
- Let {coercedValues} be an empty unordered Map.
@@ -672,6 +669,9 @@ CoerceArgumentValues(objectType, field, variableValues):
672669
{coercedValue}.
673670
- Return {coercedValues}.
674671

672+
Any _request error_ raised as a result of input coercion during
673+
{CoerceArgumentValues()} should be treated instead as an _execution error_.
674+
675675
Note: Variable values are not coerced because they are expected to be coerced
676676
before executing the operation in {CoerceVariableValues()}, and valid operations
677677
must only allow usage of variables of appropriate types.

spec/Section 7 -- Response.md

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,36 @@ present in the response.
5757
If an error was raised during the execution that prevented a valid response, the
5858
`data` entry in the response should be `null`.
5959

60+
**Response Position**
61+
62+
:: A _response position_ is a uniquely identifiable position in the response
63+
data produced during execution. It is either a direct entry in the {resultMap}
64+
of a {ExecuteSelectionSet()}, or it is a position in a (potentially nested) List
65+
value.
66+
67+
The response data is the result of accumulating the result of all response
68+
positions during execution.
69+
70+
Each _response position_ is uniquely identifiable via a _path entry_.
71+
72+
A single field execution may result in multiple response positions. For example,
73+
74+
```graphql example
75+
{
76+
hero(episode: $episode) {
77+
name
78+
friends {
79+
name
80+
}
81+
}
82+
}
83+
```
84+
85+
The hero's name would be found in the _response position_ identified by
86+
`["hero", "name"]`. The List of the hero's friends would be found at
87+
`["hero", "friends"]`, the hero's first friend at `["hero", "friends", 0]` and
88+
that friend's name at `["hero", "friends", 0, "name"]`.
89+
6090
### Errors
6191

6292
The `errors` entry in the response is a non-empty list of errors raised during
@@ -88,33 +118,31 @@ If a request error is raised, the `data` entry in the response must not be
88118
present, the `errors` entry must include the error, and request execution should
89119
be halted.
90120

121+
**Execution Errors**
122+
91123
<a name="sec-Errors.Field-Errors">
92-
<!-- This link exists for legacy hyperlink support -->
124+
<!-- Legacy link, this section was previously titled "Field Errors" -->
93125
</a>
94126

95-
**Execution Errors**
96-
97127
:: An _execution error_ is an error raised during the execution of a particular
98128
field which results in partial response data. This may occur due to failure to
99129
coerce the arguments for the field, an internal error during value resolution,
100-
or failure to coerce the resulting value. An _execution error_ may occur in any
101-
_response position_.
130+
or failure to coerce the resulting value.
102131

103132
Note: In previous versions of this specification _execution error_ was called
104133
_field error_.
105134

106-
:: A _response position_ is an identifiable position in the response: either a
107-
_field_, or a (potentially nested) list position within a field if the field has
108-
a `List` type. An _execution error_ may only occur within a _response position_.
109-
The _response position_ is indicated in the _response_ via the error's _path
110-
entry_.
111-
112135
An execution error is typically the fault of a GraphQL service.
113136

114-
If an execution error is raised, execution attempts to continue and a partial
115-
result is produced (see
116-
[Handling Execution Errors](#sec-Handling-Execution-Errors)). The `data` entry
117-
in the response must be present. The `errors` entry must include this error.
137+
An _execution error_ must occur at a specific _response position_, and may occur
138+
in any response position. The response position of an execution error is
139+
indicated via the error's `path` _path entry_.
140+
141+
When an execution error is raised at a given _response position_, then that
142+
response position must not be present within the _response_ `data` entry (except
143+
Null), and the `errors` entry must include the error. Nested execution is halted
144+
and sibling execution attempts to continue, producing partial result (see
145+
[Handling Execution Errors](#sec-Handling-Execution-Errors)).
118146

119147
**Error Result Format**
120148

0 commit comments

Comments
 (0)