Closed gitrojones closed 5 months ago
Reproduced with
makeExtendSchemaPlugin({
typeDefs: gql`
extend type Subscription {
error: Int
}
`,
plans: {
Subscription: {
error: {
subscribePlan() {
return lambda(constant(3), () => {
throw new Error("Testing error");
});
},
},
},
},
}),
Closing in favour of https://github.com/graphile/crystal/issues/2080
Hello,
Here's a fork with reproduction of the subscription issue I was running into involving error handling.
Setup:
DATABASE_URL
with your ownyarn serve
(Assumes Node20)Steps:
Expectations: The error that is thrown in the subscribePlan should be routed to the maskError where the error can be handled/sanitized like in queries and mutations.
Reality: The error is mishandled and throws an internal error instead. The handler is assuming
originalError
exists ingrafast/prepare.js > output
.Why is this a bug? An internal error is unhandled leading to the socket error.
Thanks!