-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Allow execution to be cancelled #3764
Comments
This was referenced Oct 20, 2022
JoviDeCroock
added a commit
that referenced
this issue
Oct 23, 2024
This adds support for aborting execution from the outside or resolvers, this adds a few tests and tries to make the support as easy as possible. Do we want to support having abort support on subscriptions, I guess it makes sense for server-sent events. I've chosen 2 places to place these interrupts - `executeFieldsSerially` - every time we start a new mutation we check whether the runtime has interrupted - `executeFields` - every time we start executing a new field we check whether the runtime has interrupted - inside of the catch block as well so we return a singular error, all though this doesn't really matter as the consumer would not receive anything - this here should also take care of deferred fields When comparing this to `graphql-tools/execute` I am not sure whether we want to match this behavior, this throws a DomException which would be a whole new exception that gets thrown while normally during execution we wrap everything with GraphQLErrors. Supersedes #3791 Resolves #3764 Co-authored-by: yaacovCR <yaacovCR@gmail.com>
Implemented in #4250 and slated for v17 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Once execution begins, there's no way to stop it from running until completion.
However, servers may want to be able to stop execution. For example:
It would be helpful if
execute
(andexperimentalExecuteIncrementally
, etc) had a mechanism for cancelling execution. This could be based on web-style AbortSignal/AbortController or a different API style.The text was updated successfully, but these errors were encountered: