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? |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
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:
alwaysThrows
always throws, but we process selection sets top to bottom, so there will be asubsequentPayloads
entry added fora.number
and thenalwaysThrows
will throw, which will bubble to give the result:followed by subsequent payloads referencing
["a", "numbers", N]
. In the case thatalwaysThrows
throws, there should be no subsequent payloads froma.number
since 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
Beta Was this translation helpful? Give feedback.
All reactions