Skip to content

Commit deac90e

Browse files
authored
Edit: clarify errors occuring during selection set execution (#438)
Includes some prose about it being okay to cancel or not start sibling field execution in the case of error.
1 parent a9a6dab commit deac90e

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

spec/Section 6 -- Execution.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,22 @@ ExecuteSelectionSet(selectionSet, objectType, objectValue, variableValues):
337337
Note: {resultMap} is ordered by which fields appear first in the query. This
338338
is explained in greater detail in the Field Collection section below.
339339

340+
**Errors and Non-Null Fields**
341+
342+
If during {ExecuteSelectionSet()} a field with a non-null {fieldType} throws a
343+
field error then that error must propagate to this entire selection set, either
344+
resolving to {null} if allowed or further propagated to a parent field.
345+
346+
If this occurs, any sibling fields which have not yet executed or have not yet
347+
yielded a value may be cancelled to avoid unnecessary work.
348+
349+
See the [Errors and Non-Nullability](#sec-Errors-and-Non-Nullability) section
350+
of Field Execution for more about this behavior.
340351

341352
### Normal and Serial Execution
342353

343354
Normally the executor can execute the entries in a grouped field set in whatever
344-
order it chooses (often in parallel). Because the resolution of fields other
355+
order it chooses (normally in parallel). Because the resolution of fields other
345356
than top-level mutation fields must always be side effect-free and idempotent,
346357
the execution order must not affect the result, and hence the server has the
347358
freedom to execute the field entries in whatever order it deems optimal.
@@ -364,7 +375,7 @@ chose (however of course `birthday` must be resolved before `month`, and
364375
`address` before `street`).
365376

366377
When executing a mutation, the selections in the top most selection set will be
367-
executed in serial order.
378+
executed in serial order, starting with the first appearing field textually.
368379

369380
When executing a grouped field set serially, the executor must consider each entry
370381
from the grouped field set in the order provided in the grouped field set. It must

0 commit comments

Comments
 (0)