graphql-js
fba352d4 - feat: pass abortSignal to resolvers via GraphQLResolveInfo (#4425)

Commit
102 days ago
feat: pass abortSignal to resolvers via GraphQLResolveInfo (#4425) In https://github.com/graphql/graphql-js/pull/4261 (not yet released in v17) we made abortSignal available to resolvers via a fifth argument to the field resolver. Among other things, this means that any code that processes schemas to wrap resolvers in other functions would have to be aware of this one new feature and specially thread through the new behavior. It also changed the TypeScript signature of GraphQLFieldResolver to *require* passing the fifth argument (even if undefined). But the field resolver interface already has a place for GraphQL-JS to put a grab-bag of helpful named objects for use by resolvers: `GraphQLResolveInfo`. This PR (which is not backwards compatible with v17.0.0-alpha.8, but is backwards-compatible with v16) moves the abortSignal into `GraphQLResolveInfo`. It also improves the test of this feature to actually make use of the AbortSignal API (the previous test actually passes when this change is made, without changing the test to find the AbortSignal in the new location).
Author
Parents
Loading