diff --git a/spec/Section 6 -- Execution.md b/spec/Section 6 -- Execution.md index 187c75a39..d32b7fe45 100644 --- a/spec/Section 6 -- Execution.md +++ b/spec/Section 6 -- Execution.md @@ -376,14 +376,16 @@ ExecuteSelectionSet(selectionSet, objectType, objectValue, variableValues): Note: {resultMap} is ordered by which fields appear first in the operation. This is explained in greater detail in the Field Collection section below. -**Errors and Non-Null Fields** +**Errors and Non-Null Types** -If during {ExecuteSelectionSet()} a field with a non-null {fieldType} raises a -_field error_ then that error must propagate to this entire selection set, -either resolving to {null} if allowed or further propagated to a parent field. +If during {ExecuteSelectionSet()} a _response position_ with a non-null type +raises a _field error_ then that error must propagate to the parent response +position (the entire selection set in the case of a field, or the entire list in +the case of a list position), either resolving to {null} if allowed or being +further propagated to a parent response position. -If this occurs, any sibling fields which have not yet executed or have not yet -yielded a value may be cancelled to avoid unnecessary work. +If this occurs, any sibling response positions which have not yet executed or +have not yet yielded a value may be cancelled to avoid unnecessary work. Note: See [Handling Field Errors](#sec-Handling-Field-Errors) for more about this behavior. @@ -811,26 +813,27 @@ If a field error is raised while resolving a field, it is handled as though the field returned {null}, and the error must be added to the {"errors"} list in the response. -If the result of resolving a field is {null} (either because the function to -resolve the field returned {null} or because a field error was raised), and that -field is of a `Non-Null` type, then a field error is raised. The error must be -added to the {"errors"} list in the response. +If the result of resolving a _response position_ is {null} (either due to the +result of {ResolveFieldValue()} or because a field error was raised), and that +position is of a `Non-Null` type, then a field error is raised at that position. +The error must be added to the {"errors"} list in the response. -If the field returns {null} because of a field error which has already been -added to the {"errors"} list in the response, the {"errors"} list must not be -further affected. That is, only one error should be added to the errors list per -field. +If a _response position_ returns {null} because of a field error which has +already been added to the {"errors"} list in the response, the {"errors"} list +must not be further affected. That is, only one error should be added to the +errors list per _response position_. -Since `Non-Null` type fields cannot be {null}, field errors are propagated to be -handled by the parent field. If the parent field may be {null} then it resolves -to {null}, otherwise if it is a `Non-Null` type, the field error is further -propagated to its parent field. +Since `Non-Null` response positions cannot be {null}, field errors are +propagated to be handled by the parent _response position_. If the parent +response position may be {null} then it resolves to {null}, otherwise if it is a +`Non-Null` type, the field error is further propagated to its parent _response +position_. If a `List` type wraps a `Non-Null` type, and one of the elements of that list resolves to {null}, then the entire list must resolve to {null}. If the `List` type is also wrapped in a `Non-Null`, the field error continues to propagate upwards. -If all fields from the root of the request to the source of the field error -return `Non-Null` types, then the {"data"} entry in the response should be -{null}. +If every _response position_ from the root of the request to the source of the +field error returns a `Non-Null` type, then the {"data"} entry in the response +should be {null}. diff --git a/spec/Section 7 -- Response.md b/spec/Section 7 -- Response.md index daca5bb1f..279d810d0 100644 --- a/spec/Section 7 -- Response.md +++ b/spec/Section 7 -- Response.md @@ -93,7 +93,9 @@ be halted. :: A _field error_ is an error raised during the execution of a particular field which results in partial response data. This may occur due to an internal error -during value resolution or failure to coerce the resulting value. +during value resolution or failure to coerce the resulting value. A _field +error_ may only occur within a _response position_. The _response position_ is +indicated in the _response_ via the error's _path entry_. A field error is typically the fault of a GraphQL service. @@ -250,8 +252,12 @@ discouraged. ### Path -:: A _path entry_ is an entry within an _error result_ that allows for -association with a particular field reached during GraphQL execution. +:: A _path entry_ is an entry within an _error result_ that indicates the +_response position_ at which the error occurred. + +:: A _response position_ is an identifiable position in the response: either a +_field_, or a (potentially nested) list position within a field if the field has +a `List` type. The value for a _path entry_ must be a list of path segments starting at the root of the response and ending with the field to be associated with. Path