@graphql-tools/executor
Advanced tools
Comparing version 1.2.2 to 1.2.3-alpha-20240321093254-2730b8e00f078a352f5a72248305f874dffd60dd
@@ -818,3 +818,4 @@ "use strict"; | ||
done = true; | ||
subsequentIterator.throw?.(signal?.reason); | ||
// we catch here to avoid unhandled promise rejection | ||
subsequentIterator.throw?.(signal?.reason).catch(() => undefined); | ||
}); | ||
@@ -1167,2 +1168,7 @@ return { | ||
let isDone = false; | ||
exeContext.signal?.addEventListener('abort', () => { | ||
for (const payload of exeContext.subsequentPayloads) { | ||
payload.cancel(exeContext.signal?.reason); | ||
} | ||
}); | ||
async function next() { | ||
@@ -1227,6 +1233,7 @@ if (isDone) { | ||
this.data = null; | ||
this.promise = new Promise(resolve => { | ||
this.promise = new Promise((resolve, reject) => { | ||
this._resolve = MaybePromise => { | ||
resolve(MaybePromise); | ||
}; | ||
this._reject = reject; | ||
}).then(data => { | ||
@@ -1245,2 +1252,5 @@ this.data = data; | ||
} | ||
cancel(reason) { | ||
this._reject?.(reason); | ||
} | ||
} | ||
@@ -1260,6 +1270,7 @@ class StreamRecord { | ||
this.items = null; | ||
this.promise = new Promise(resolve => { | ||
this.promise = new Promise((resolve, reject) => { | ||
this._resolve = MaybePromise => { | ||
resolve(MaybePromise); | ||
}; | ||
this._reject = reject; | ||
}).then(items => { | ||
@@ -1281,2 +1292,5 @@ this.items = items; | ||
} | ||
cancel(reason) { | ||
this._reject?.(reason); | ||
} | ||
} | ||
@@ -1283,0 +1297,0 @@ function isStreamPayload(asyncPayload) { |
@@ -807,3 +807,4 @@ import { assertValidSchema, getDirectiveValues, GraphQLError, isAbstractType, isLeafType, isListType, isNonNullType, isObjectType, Kind, locatedError, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, } from 'graphql'; | ||
done = true; | ||
subsequentIterator.throw?.(signal?.reason); | ||
// we catch here to avoid unhandled promise rejection | ||
subsequentIterator.throw?.(signal?.reason).catch(() => undefined); | ||
}); | ||
@@ -1155,2 +1156,7 @@ return { | ||
let isDone = false; | ||
exeContext.signal?.addEventListener('abort', () => { | ||
for (const payload of exeContext.subsequentPayloads) { | ||
payload.cancel(exeContext.signal?.reason); | ||
} | ||
}); | ||
async function next() { | ||
@@ -1215,6 +1221,7 @@ if (isDone) { | ||
this.data = null; | ||
this.promise = new Promise(resolve => { | ||
this.promise = new Promise((resolve, reject) => { | ||
this._resolve = MaybePromise => { | ||
resolve(MaybePromise); | ||
}; | ||
this._reject = reject; | ||
}).then(data => { | ||
@@ -1233,2 +1240,5 @@ this.data = data; | ||
} | ||
cancel(reason) { | ||
this._reject?.(reason); | ||
} | ||
} | ||
@@ -1248,6 +1258,7 @@ class StreamRecord { | ||
this.items = null; | ||
this.promise = new Promise(resolve => { | ||
this.promise = new Promise((resolve, reject) => { | ||
this._resolve = MaybePromise => { | ||
resolve(MaybePromise); | ||
}; | ||
this._reject = reject; | ||
}).then(items => { | ||
@@ -1269,2 +1280,5 @@ this.items = items; | ||
} | ||
cancel(reason) { | ||
this._reject?.(reason); | ||
} | ||
} | ||
@@ -1271,0 +1285,0 @@ function isStreamPayload(asyncPayload) { |
{ | ||
"name": "@graphql-tools/executor", | ||
"version": "1.2.2", | ||
"version": "1.2.3-alpha-20240321093254-2730b8e00f078a352f5a72248305f874dffd60dd", | ||
"sideEffects": false, | ||
@@ -5,0 +5,0 @@ "peerDependencies": { |
@@ -219,2 +219,3 @@ import { DocumentNode, FieldNode, FragmentDefinitionNode, GraphQLError, GraphQLField, GraphQLFieldResolver, GraphQLFormattedError, GraphQLObjectType, GraphQLResolveInfo, GraphQLSchema, GraphQLTypeResolver, OperationDefinitionNode } from 'graphql'; | ||
_resolve?: (arg: MaybePromise<Record<string, unknown> | null>) => void; | ||
_reject?: (reason: unknown) => void; | ||
constructor(opts: { | ||
@@ -227,2 +228,3 @@ label: string | undefined; | ||
addData(data: MaybePromise<Record<string, unknown> | null>): void; | ||
cancel(reason: unknown): void; | ||
} | ||
@@ -242,2 +244,3 @@ declare class StreamRecord { | ||
_resolve?: (arg: MaybePromise<Array<unknown> | null>) => void; | ||
_reject?: (reason: unknown) => void; | ||
constructor(opts: { | ||
@@ -252,2 +255,3 @@ label: string | undefined; | ||
setIsCompletedIterator(): void; | ||
cancel(reason: unknown): void; | ||
} | ||
@@ -254,0 +258,0 @@ type AsyncPayloadRecord = DeferredFragmentRecord | StreamRecord; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
165326
3400
2