-
Notifications
You must be signed in to change notification settings - Fork 575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: onSubscribeError should be invoked #3196
Conversation
🦋 Changeset detectedLatest commit: b16074b The changes in this PR will be included in the next version bump. This PR includes changesets to release 24 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Apollo Federation Subgraph Compatibility Results
Learn more: |
💻 Website PreviewThe latest changes are available as preview in: https://f7386c56.graphql-yoga.pages.dev |
✅ Benchmark Results
|
🚀 Snapshot Release (
|
Package | Version | Info |
---|---|---|
graphql-yoga-cloud-run-guide |
3.2.0-alpha-20240312090652-b16074bb |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/apollo-link |
3.2.0-alpha-20240312090652-b16074bb |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/urql-exchange |
3.2.0-alpha-20240312090652-b16074bb |
npm ↗︎ unpkg ↗︎ |
graphql-yoga |
5.2.0-alpha-20240312090652-b16074bb |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/nestjs |
3.2.0-alpha-20240312090652-b16074bb |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/nestjs-federation |
3.2.0-alpha-20240312090652-b16074bb |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-apollo-inline-trace |
3.2.0-alpha-20240312090652-b16074bb |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-apq |
3.2.0-alpha-20240312090652-b16074bb |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-csrf-prevention |
3.2.0-alpha-20240312090652-b16074bb |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-defer-stream |
3.2.0-alpha-20240312090652-b16074bb |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-disable-introspection |
2.2.0-alpha-20240312090652-b16074bb |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-graphql-sse |
3.2.0-alpha-20240312090652-b16074bb |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-jwt |
2.2.0-alpha-20240312090652-b16074bb |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-persisted-operations |
3.2.0-alpha-20240312090652-b16074bb |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-prometheus |
4.1.0-alpha-20240312090652-b16074bb |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-response-cache |
3.4.0-alpha-20240312090652-b16074bb |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-sofa |
3.2.0-alpha-20240312090652-b16074bb |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/render-graphiql |
5.2.0-alpha-20240312090652-b16074bb |
npm ↗︎ unpkg ↗︎ |
packages/graphql-yoga/src/server.ts
Outdated
@@ -475,6 +476,32 @@ export class YogaServer< | |||
this.logger.debug(`Processing GraphQL Parameters done.`); | |||
} | |||
|
|||
/** Ensure that error thrown from subscribe is sent to client */ | |||
if (result && Symbol.asyncIterator in result) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't use isAsyncResult
util we have ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The typing of this function is incorrect result can never be async iterable, if we want to do this change we need to refactor and fix the typings (which I will do ofc).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we want to send internal event source errors to the client ? Shouldn't we just abort the connection at this point ? Is there and RFC for this ? |
You could do an auth/access check that should be sent to the client for example. There is unfortunately no RFC or clarity... |
I noticed that the
onSubscribeError
error hook is not invoked due to howgraphql-tools/executor
does execution.See ardatan/graphql-tools#5965, for the prerequisite changes with in tools/executor