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 {
271
271
fieldResolver ?: Maybe < GraphQLFieldResolver < any , any > > ;
272
272
typeResolver ?: Maybe < GraphQLTypeResolver < any , any > > ;
273
273
subscribeFieldResolver ?: Maybe < GraphQLFieldResolver < any , any > > ;
274
- signal ?: IAbortSignal ;
274
+ signal ?: Maybe < IAbortSignal > ;
275
275
}
276
276
277
277
const UNEXPECTED_EXPERIMENTAL_DIRECTIVES =
Original file line number Diff line number Diff line change
1
+ import type { IAbortSignal } from './jsutils/AbortController' ;
1
2
import { isPromise } from './jsutils/isPromise.js' ;
2
3
import type { Maybe } from './jsutils/Maybe.js' ;
3
4
import type { PromiseOrValue } from './jsutils/PromiseOrValue.js' ;
@@ -57,6 +58,9 @@ import { execute } from './execution/execute.js';
57
58
* A type resolver function to use when none is provided by the schema.
58
59
* If not provided, the default type resolver is used (which looks for a
59
60
* `__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.
60
64
*/
61
65
export interface GraphQLArgs {
62
66
schema : GraphQLSchema ;
@@ -67,6 +71,7 @@ export interface GraphQLArgs {
67
71
operationName ?: Maybe < string > ;
68
72
fieldResolver ?: Maybe < GraphQLFieldResolver < any , any > > ;
69
73
typeResolver ?: Maybe < GraphQLTypeResolver < any , any > > ;
74
+ signal ?: IAbortSignal ;
70
75
}
71
76
72
77
export function graphql ( args : GraphQLArgs ) : Promise < ExecutionResult > {
@@ -101,6 +106,7 @@ function graphqlImpl(args: GraphQLArgs): PromiseOrValue<ExecutionResult> {
101
106
operationName,
102
107
fieldResolver,
103
108
typeResolver,
109
+ signal,
104
110
} = args ;
105
111
106
112
// Validate Schema
@@ -133,5 +139,6 @@ function graphqlImpl(args: GraphQLArgs): PromiseOrValue<ExecutionResult> {
133
139
operationName,
134
140
fieldResolver,
135
141
typeResolver,
142
+ signal,
136
143
} ) ;
137
144
}
You can’t perform that action at this time.
0 commit comments