RFC 1 / Proposal

When `sourceStream` errors, yield a `{ errors: [...] }` response

Opened on
Updated on

At a glance

Project
GraphQL Spec
Identifier
#1127
Stage
RFC 1 / Proposal
Champion
@benjie
Updated
2025-01-14
Latest activity
Advanced to RFC 1 on
Source

Pull request description

See https://github.com/graphql/graphql-spec/pull/1099/files#r1799509253

Currently if sourceStream generates an error, then responseStream 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.

Timeline