Commit 84b122c
AbortController support (#4250)
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 <[email protected]>1 parent f531737 commit 84b122c
File tree
6 files changed
+398
-7
lines changed- integrationTests/ts
- src
- execution
- __tests__
6 files changed
+398
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
5 | 11 | | |
6 | 12 | | |
7 | 13 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
0 commit comments