Skip to main content

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

At a glance​

Timeline​


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.