When `sourceStream` errors, yield a `{ errors: [...] }` response
At a glance​
- Identifier: #1127
- Stage: RFC0: Strawman
- Champion: @benjie
- PR: When `sourceStream` errors, yield a `{ errors: [...] }` response
Timeline​
- Added to 2025-01-09 WG agenda
- Commit pushed: Merge branch 'main' into streams-editorial-suggestions on 2024-12-05 by @benjie
- Added to 2024-12-05 WG agenda
- Mentioned in 2024-12 WG notes
- Spec PR created on 2024-11-21 by benjie
- 3 commits pushed on 2024-11-21:
- Commit pushed: feedback and use definition syntax on 2024-06-11 by @leebyron
- Commit pushed: Editorial changes for Event Streams on 2024-06-06 by @leebyron
See https://github.com/graphql/graphql-spec/pull/1099/files#r1799509253
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 change. It is technically a breaking change, I think, so will require​ careful thought.