Repository navigation
Cancel defer/stream execution when path is nulled from error bubbling #45
Replies: 3 comments 14 replies
|
Interesting. In the current graphql-js implementation we will not initiate the deferred or streamed payloads if We discussed defer/stream acting as a "null-boundary" in #23, but we only discussed the scenario of the error inside of the defer/stream payload, not errors outside the payload. @benjie Do you have any suggestions on how to address this? |
|
Could we consider adding something to spec acknowledging this scenario is a possibility?
Effectively we are allowing defer/stream to act as a null boundary in both directions now (we discussed the other direction in #23). It seems like it's an edge case and I'm concerned working around it on the server would either be too burdensome or would drastically affect the performance of the server execution. |
|
I updated the title/description and will mark this as resolved now. This is now reflected in the spec edit PR and has been merged to graphql-js |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Context
Schema:
Query:
{ a { numbers @stream alwaysThrows } }alwaysThrowsalways throws, but we process selection sets top to bottom, so there will be asubsequentPayloadsentry added fora.numberand thenalwaysThrowswill throw, which will bubble to give the result:{ "a": null }followed by subsequent payloads referencing
["a", "numbers", N]. In the case thatalwaysThrowsthrows, there should be no subsequent payloads froma.numbersince there's nowhere for them to go (the parent was nulled-out).Decision
Discussed at the 2022-09-01 WG meeting. Decided that servers must filter and optionally cancel subsequent payloads whose path points to a location that has been nulled by error bubbling.
Status
All reactions