Fix "response position" definition; clarify sibling errors on propagation #1183
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The intention of response position is that it includes things that were elided by error propagation; e.g. if you query
{ a { b } }
andb
is non-null and throws, the result will be{a: null}
but the error will have path["a", "b"]
indicating thea.b
response position even though that position does not actually exist in the response.(Also:
ExecuteSelectionSet()
doesn't exist any more.)Commit 1: clarify definition of response position to include these omitted values.
But the response position mentioned at the beginning of this paragraph is different to the response position from which the error originated; therefore "only one error should be added to the errors list per response position" is kind of moot. Actually what we mean here is that the response path of the error (i.e. the "path" entry in the error object) should be unique.
Commit 2: clarify it's the "path" of the error that matters, not the position that re-raised it
The use of the term "response position" is confusing, because that position might not actually exist in the response if it was omitted due to error propagation.
Commit 3: rename
response position
toexecution position
throughout.All of this together clarifies what happens when an error occurs to a nullable sibling of a non-nullable field that triggers error propagation.