Skip to content

Errors in Subscription operations aren't propagated by the graphql-ws client as expected #561

Answered by enisdenjo
shtaif asked this question in Q&A
Discussion options

You must be logged in to vote

On the other hand, calling a query whose backend resolver errors out ends up in [...]

That is because the resolvers in graphql-js schema catch errors and return them in the execution result. While, on the other hand, throwing from subscribe in a GraphQL schema will not catch and will bubble the error instead.

If an error is thrown from anywhere on a graphql-ws powered backend - it results in the server closing the connection. It does not matter if the client is subscribing or querying.

See this discussion and how to remidy the subscribe function.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@shtaif
Comment options

Answer selected by shtaif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #560 on June 03, 2024 08:44.