Skip to content

Commit 2e0ce19

Browse files
committed
change fn name to be more generic
1 parent c17544e commit 2e0ce19

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/execution/__tests__/abort-signal-test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ describe('Execute: Cancellation', () => {
110110
});
111111

112112
it('should provide access to the abort signal within resolvers', async () => {
113-
const throwIfAborted = async (abortSignal: AbortSignal) => {
114-
await resolveOnNextTick();
115-
abortSignal.throwIfAborted();
116-
};
117-
118113
const abortController = new AbortController();
119114
const document = parse(`
120115
query {
@@ -124,14 +119,19 @@ describe('Execute: Cancellation', () => {
124119
}
125120
`);
126121

122+
const cancellableAsyncFn = async (abortSignal: AbortSignal) => {
123+
await resolveOnNextTick();
124+
abortSignal.throwIfAborted();
125+
};
126+
127127
const resultPromise = execute({
128128
document,
129129
schema,
130130
abortSignal: abortController.signal,
131131
rootValue: {
132132
todo: {
133133
id: (_args: any, _context: any, _info: any, signal: AbortSignal) =>
134-
throwIfAborted(signal),
134+
cancellableAsyncFn(signal),
135135
},
136136
},
137137
});

0 commit comments

Comments
 (0)