GraphQL Subscriptions should handle errors in the source stream
At a glance​
- Identifier: #1126
- Stage: RFCX: Closed 2024-11-21T15:14:32Z
- Champion: @benjie
- PR: GraphQL Subscriptions should handle errors in the source stream
Timeline​
- Spec PR created on 2024-11-21 by benjie
- Commit pushed: Handle errors raised by sourceStream on 2024-11-21 by @benjie
Currently if
sourceStream
generates an error, thenresponseStream
repeats the error. This is the behavior implemented in graphql-js and is problematic.GraphQL captures execution errors and wraps them in an
{ errors: [...] }
payload for query and mutation operations; it should do the same for stream errors in a subscription operation.This PR makes this behavior explicit.