File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -271,7 +271,7 @@ export interface ExecutionArgs {
271271 fieldResolver ?: Maybe < GraphQLFieldResolver < any , any > > ;
272272 typeResolver ?: Maybe < GraphQLTypeResolver < any , any > > ;
273273 subscribeFieldResolver ?: Maybe < GraphQLFieldResolver < any , any > > ;
274- signal ?: IAbortSignal ;
274+ signal ?: Maybe < IAbortSignal > ;
275275}
276276
277277const UNEXPECTED_MULTIPLE_PAYLOADS =
Original file line number Diff line number Diff line change 1+ import type { IAbortSignal } from './jsutils/AbortController' ;
12import { isPromise } from './jsutils/isPromise.js' ;
23import type { Maybe } from './jsutils/Maybe.js' ;
34import type { PromiseOrValue } from './jsutils/PromiseOrValue.js' ;
@@ -57,6 +58,9 @@ import { execute } from './execution/execute.js';
5758 * A type resolver function to use when none is provided by the schema.
5859 * If not provided, the default type resolver is used (which looks for a
5960 * `__typename` field or alternatively calls the `isTypeOf` method).
61+ * signal:
62+ * An AbortSignal that can be used to abort the execution of the query.
63+ * If the signal is aborted, the execution will stop and an abort error will be thrown.
6064 */
6165export interface GraphQLArgs {
6266 schema : GraphQLSchema ;
@@ -67,6 +71,7 @@ export interface GraphQLArgs {
6771 operationName ?: Maybe < string > ;
6872 fieldResolver ?: Maybe < GraphQLFieldResolver < any , any > > ;
6973 typeResolver ?: Maybe < GraphQLTypeResolver < any , any > > ;
74+ signal ?: IAbortSignal ;
7075}
7176
7277export function graphql ( args : GraphQLArgs ) : Promise < ExecutionResult > {
@@ -101,6 +106,7 @@ function graphqlImpl(args: GraphQLArgs): PromiseOrValue<ExecutionResult> {
101106 operationName,
102107 fieldResolver,
103108 typeResolver,
109+ signal,
104110 } = args ;
105111
106112 // Validate Schema
@@ -133,5 +139,6 @@ function graphqlImpl(args: GraphQLArgs): PromiseOrValue<ExecutionResult> {
133139 operationName,
134140 fieldResolver,
135141 typeResolver,
142+ signal,
136143 } ) ;
137144}
You can’t perform that action at this time.
0 commit comments