@graphql-tools/executor
Advanced tools
Comparing version 2.0.0-alpha-20240620175016-1a4246713c9c2dcf5e3debfccfa47e0efd992528 to 2.0.0-alpha-20240702150434-510cb232d9e9dd0212d17ed8efc3e54d83ea25f4
@@ -17,3 +17,3 @@ "use strict"; | ||
*/ | ||
function collectFields(schema, fragments, variableValues, runtimeType, operation) { | ||
function collectFields(schema, fragments, variableValues, runtimeType, selectionSet, errorWithIncrementalSubscription) { | ||
const groupedFieldSet = new AccumulatorMap_js_1.AccumulatorMap(); | ||
@@ -26,6 +26,6 @@ const newDeferUsages = []; | ||
runtimeType, | ||
operation, | ||
errorWithIncrementalSubscription, | ||
visitedFragmentNames: new Set(), | ||
}; | ||
collectFieldsImpl(context, operation.selectionSet, groupedFieldSet, newDeferUsages); | ||
collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsages); | ||
return { groupedFieldSet, newDeferUsages }; | ||
@@ -44,3 +44,3 @@ } | ||
*/ | ||
function collectSubfields(schema, fragments, variableValues, operation, returnType, fieldGroup) { | ||
function collectSubfields(schema, fragments, variableValues, errorWithIncrementalSubscription, returnType, fieldGroup) { | ||
const context = { | ||
@@ -51,3 +51,3 @@ schema, | ||
runtimeType: returnType, | ||
operation, | ||
errorWithIncrementalSubscription, | ||
visitedFragmentNames: new Set(), | ||
@@ -70,3 +70,3 @@ }; | ||
function collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsages, deferUsage) { | ||
const { schema, fragments, variableValues, runtimeType, operation, visitedFragmentNames } = context; | ||
const { schema, fragments, variableValues, runtimeType, errorWithIncrementalSubscription, visitedFragmentNames, } = context; | ||
for (const selection of selectionSet.selections) { | ||
@@ -89,3 +89,3 @@ switch (selection.kind) { | ||
} | ||
const newDeferUsage = getDeferUsage(operation, variableValues, selection, deferUsage); | ||
const newDeferUsage = getDeferUsage(errorWithIncrementalSubscription, variableValues, selection, deferUsage); | ||
if (!newDeferUsage) { | ||
@@ -102,3 +102,3 @@ collectFieldsImpl(context, selection.selectionSet, groupedFieldSet, newDeferUsages, deferUsage); | ||
const fragName = selection.name.value; | ||
const newDeferUsage = getDeferUsage(operation, variableValues, selection, deferUsage); | ||
const newDeferUsage = getDeferUsage(errorWithIncrementalSubscription, variableValues, selection, deferUsage); | ||
if (!newDeferUsage && | ||
@@ -130,3 +130,3 @@ (visitedFragmentNames.has(fragName) || !shouldIncludeNode(variableValues, selection))) { | ||
*/ | ||
function getDeferUsage(operation, variableValues, node, parentDeferUsage) { | ||
function getDeferUsage(errorWithIncrementalSubscription, variableValues, node, parentDeferUsage) { | ||
const defer = (0, graphql_1.getDirectiveValues)(utils_1.GraphQLDeferDirective, node, variableValues); | ||
@@ -139,3 +139,3 @@ if (!defer) { | ||
} | ||
(0, invariant_js_1.invariant)(operation.operation !== 'subscription', '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.'); | ||
(0, invariant_js_1.invariant)(!errorWithIncrementalSubscription, '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.'); | ||
return { | ||
@@ -142,0 +142,0 @@ label: typeof defer['label'] === 'string' ? defer['label'] : undefined, |
@@ -10,2 +10,3 @@ "use strict"; | ||
const collectFields_js_1 = require("./collectFields.js"); | ||
const flattenAsyncIterable_js_1 = require("./flattenAsyncIterable.js"); | ||
const IncrementalPublisher_js_1 = require("./IncrementalPublisher.js"); | ||
@@ -21,3 +22,3 @@ const invariant_js_1 = require("./invariant.js"); | ||
*/ | ||
const collectSubfields = (0, utils_1.memoize3)((exeContext, returnType, fieldGroup) => (0, collectFields_js_1.collectSubfields)(exeContext.schema, exeContext.fragments, exeContext.variableValues, exeContext.operation, returnType, fieldGroup)); | ||
const collectSubfields = (0, utils_1.memoize3)((exeContext, returnType, fieldGroup) => (0, collectFields_js_1.collectSubfields)(exeContext.schema, exeContext.fragments, exeContext.variableValues, exeContext.errorWithIncrementalSubscription, returnType, fieldGroup)); | ||
/** | ||
@@ -154,3 +155,3 @@ * Implements the "Executing requests" section of the GraphQL specification, | ||
function buildExecutionContext(args) { | ||
const { schema, document, rootValue, contextValue, variableValues: rawVariableValues, operationName, fieldResolver, typeResolver, subscribeFieldResolver, enableEarlyExecution, signal, } = args; | ||
const { schema, document, rootValue, contextValue, variableValues: rawVariableValues, operationName, fieldResolver, typeResolver, subscribeFieldResolver, enableEarlyExecution, errorWithIncrementalSubscription, signal, } = args; | ||
// If the schema used for execution is invalid, throw an error. | ||
@@ -205,2 +206,3 @@ (0, graphql_1.assertValidSchema)(schema); | ||
enableEarlyExecution: enableEarlyExecution !== false, | ||
errorWithIncrementalSubscription: operation.operation === 'subscription' && errorWithIncrementalSubscription !== false, | ||
signal, | ||
@@ -228,3 +230,3 @@ errors: undefined, | ||
try { | ||
const { operation, schema, fragments, variableValues, rootValue } = exeContext; | ||
const { operation, schema, fragments, variableValues, rootValue, errorWithIncrementalSubscription, } = exeContext; | ||
const rootType = (0, utils_1.getDefinedRootType)(schema, operation.operation, [operation]); | ||
@@ -236,3 +238,3 @@ if (rootType == null) { | ||
} | ||
const collectedFields = (0, collectFields_js_1.collectFields)(schema, fragments, variableValues, rootType, operation); | ||
const collectedFields = (0, collectFields_js_1.collectFields)(schema, fragments, variableValues, rootType, operation.selectionSet, errorWithIncrementalSubscription); | ||
let groupedFieldSet = collectedFields.groupedFieldSet; | ||
@@ -546,3 +548,3 @@ const newDeferUsages = collectedFields.newDeferUsages; | ||
(0, invariant_js_1.invariant)(stream['initialCount'] >= 0, 'initialCount must be a positive integer'); | ||
(0, invariant_js_1.invariant)(exeContext.operation.operation !== 'subscription', '`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.'); | ||
(0, invariant_js_1.invariant)(!exeContext.errorWithIncrementalSubscription, '`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.'); | ||
const streamedFieldGroup = fieldGroup.map(fieldDetails => ({ | ||
@@ -918,35 +920,2 @@ node: fieldDetails.node, | ||
exports.defaultFieldResolver = defaultFieldResolver; | ||
/** | ||
* Implements the "Subscribe" algorithm described in the GraphQL specification, | ||
* including `@defer` and `@stream` as proposed in | ||
* https://github.com/graphql/graphql-spec/pull/742 | ||
* | ||
* Returns a Promise which resolves to either an AsyncIterator (if successful) | ||
* or an ExecutionResult (error). The promise will be rejected if the schema or | ||
* other arguments to this function are invalid, or if the resolved event stream | ||
* is not an async iterable. | ||
* | ||
* If the client-provided arguments to this function do not result in a | ||
* compliant subscription, a GraphQL Response (ExecutionResult) with descriptive | ||
* errors and no data will be returned. | ||
* | ||
* If the source stream could not be created due to faulty subscription resolver | ||
* logic or underlying systems, the promise will resolve to a single | ||
* ExecutionResult containing `errors` and no `data`. | ||
* | ||
* If the operation succeeded, the promise resolves to an AsyncIterator, which | ||
* yields a stream of result representing the response stream. | ||
* | ||
* Each result may be an ExecutionResult with no `hasNext` (if executing the | ||
* event did not use `@defer` or `@stream`), or an | ||
* `InitialIncrementalExecutionResult` or `SubsequentIncrementalExecutionResult` | ||
* (if executing the event used `@defer` or `@stream`). In the case of | ||
* incremental execution results, each event produces a single | ||
* `InitialIncrementalExecutionResult` followed by one or more | ||
* `SubsequentIncrementalExecutionResult`s; all but the last have `hasNext: true`, | ||
* and the last has `hasNext: false`. There is no interleaving between results | ||
* generated from the same original event. | ||
* | ||
* Accepts an object with named arguments. | ||
*/ | ||
function subscribe(args) { | ||
@@ -1015,2 +984,10 @@ // If a valid execution context cannot be created due to incorrect arguments, | ||
exports.flattenIncrementalResults = flattenIncrementalResults; | ||
async function* ensureAsyncIterable(someExecutionResult) { | ||
if ('initialResult' in someExecutionResult) { | ||
yield* flattenIncrementalResults(someExecutionResult); | ||
} | ||
else { | ||
yield someExecutionResult; | ||
} | ||
} | ||
function mapSourceToResponse(exeContext, resultOrStream) { | ||
@@ -1026,3 +1003,3 @@ if (!(0, utils_1.isAsyncIterable)(resultOrStream)) { | ||
// "ExecuteQuery" algorithm, for which `execute` is also used. | ||
return (0, utils_1.mapAsyncIterator)(resultOrStream[Symbol.asyncIterator](), (payload) => executeOperation(buildPerEventExecutionContext(exeContext, payload)), (error) => { | ||
return (0, flattenAsyncIterable_js_1.flattenAsyncIterable)((0, utils_1.mapAsyncIterator)(resultOrStream[Symbol.asyncIterator](), async (payload) => ensureAsyncIterable(await executeOperation(buildPerEventExecutionContext(exeContext, payload))), (error) => { | ||
const wrappedError = (0, utils_1.createGraphQLError)(error.message, { | ||
@@ -1033,3 +1010,3 @@ originalError: error, | ||
throw wrappedError; | ||
}); | ||
})); | ||
} | ||
@@ -1049,3 +1026,3 @@ function createSourceEventStreamImpl(exeContext) { | ||
function executeSubscription(exeContext) { | ||
const { schema, fragments, operation, variableValues, rootValue } = exeContext; | ||
const { schema, fragments, operation, variableValues, rootValue, errorWithIncrementalSubscription, } = exeContext; | ||
const rootType = schema.getSubscriptionType(); | ||
@@ -1057,3 +1034,3 @@ if (rootType == null) { | ||
} | ||
const { groupedFieldSet } = (0, collectFields_js_1.collectFields)(schema, fragments, variableValues, rootType, operation); | ||
const { groupedFieldSet } = (0, collectFields_js_1.collectFields)(schema, fragments, variableValues, rootType, operation.selectionSet, errorWithIncrementalSubscription); | ||
const firstRootField = [...groupedFieldSet.entries()][0]; | ||
@@ -1060,0 +1037,0 @@ const [responseName, fieldGroup] = firstRootField; |
@@ -14,3 +14,3 @@ import { getDirectiveValues, GraphQLIncludeDirective, GraphQLSkipDirective, isAbstractType, Kind, typeFromAST, } from 'graphql'; | ||
*/ | ||
export function collectFields(schema, fragments, variableValues, runtimeType, operation) { | ||
export function collectFields(schema, fragments, variableValues, runtimeType, selectionSet, errorWithIncrementalSubscription) { | ||
const groupedFieldSet = new AccumulatorMap(); | ||
@@ -23,6 +23,6 @@ const newDeferUsages = []; | ||
runtimeType, | ||
operation, | ||
errorWithIncrementalSubscription, | ||
visitedFragmentNames: new Set(), | ||
}; | ||
collectFieldsImpl(context, operation.selectionSet, groupedFieldSet, newDeferUsages); | ||
collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsages); | ||
return { groupedFieldSet, newDeferUsages }; | ||
@@ -40,3 +40,3 @@ } | ||
*/ | ||
export function collectSubfields(schema, fragments, variableValues, operation, returnType, fieldGroup) { | ||
export function collectSubfields(schema, fragments, variableValues, errorWithIncrementalSubscription, returnType, fieldGroup) { | ||
const context = { | ||
@@ -47,3 +47,3 @@ schema, | ||
runtimeType: returnType, | ||
operation, | ||
errorWithIncrementalSubscription, | ||
visitedFragmentNames: new Set(), | ||
@@ -65,3 +65,3 @@ }; | ||
function collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsages, deferUsage) { | ||
const { schema, fragments, variableValues, runtimeType, operation, visitedFragmentNames } = context; | ||
const { schema, fragments, variableValues, runtimeType, errorWithIncrementalSubscription, visitedFragmentNames, } = context; | ||
for (const selection of selectionSet.selections) { | ||
@@ -84,3 +84,3 @@ switch (selection.kind) { | ||
} | ||
const newDeferUsage = getDeferUsage(operation, variableValues, selection, deferUsage); | ||
const newDeferUsage = getDeferUsage(errorWithIncrementalSubscription, variableValues, selection, deferUsage); | ||
if (!newDeferUsage) { | ||
@@ -97,3 +97,3 @@ collectFieldsImpl(context, selection.selectionSet, groupedFieldSet, newDeferUsages, deferUsage); | ||
const fragName = selection.name.value; | ||
const newDeferUsage = getDeferUsage(operation, variableValues, selection, deferUsage); | ||
const newDeferUsage = getDeferUsage(errorWithIncrementalSubscription, variableValues, selection, deferUsage); | ||
if (!newDeferUsage && | ||
@@ -125,3 +125,3 @@ (visitedFragmentNames.has(fragName) || !shouldIncludeNode(variableValues, selection))) { | ||
*/ | ||
function getDeferUsage(operation, variableValues, node, parentDeferUsage) { | ||
function getDeferUsage(errorWithIncrementalSubscription, variableValues, node, parentDeferUsage) { | ||
const defer = getDirectiveValues(GraphQLDeferDirective, node, variableValues); | ||
@@ -134,3 +134,3 @@ if (!defer) { | ||
} | ||
invariant(operation.operation !== 'subscription', '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.'); | ||
invariant(!errorWithIncrementalSubscription, '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.'); | ||
return { | ||
@@ -137,0 +137,0 @@ label: typeof defer['label'] === 'string' ? defer['label'] : undefined, |
@@ -7,2 +7,3 @@ import { assertValidSchema, getDirectiveValues, GraphQLError, isAbstractType, isLeafType, isListType, isNonNullType, isObjectType, Kind, locatedError, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, } from 'graphql'; | ||
import { collectSubfields as _collectSubfields, collectFields, } from './collectFields.js'; | ||
import { flattenAsyncIterable } from './flattenAsyncIterable.js'; | ||
import { buildIncrementalResponse } from './IncrementalPublisher.js'; | ||
@@ -18,3 +19,3 @@ import { invariant } from './invariant.js'; | ||
*/ | ||
const collectSubfields = memoize3((exeContext, returnType, fieldGroup) => _collectSubfields(exeContext.schema, exeContext.fragments, exeContext.variableValues, exeContext.operation, returnType, fieldGroup)); | ||
const collectSubfields = memoize3((exeContext, returnType, fieldGroup) => _collectSubfields(exeContext.schema, exeContext.fragments, exeContext.variableValues, exeContext.errorWithIncrementalSubscription, returnType, fieldGroup)); | ||
/** | ||
@@ -148,3 +149,3 @@ * Implements the "Executing requests" section of the GraphQL specification, | ||
export function buildExecutionContext(args) { | ||
const { schema, document, rootValue, contextValue, variableValues: rawVariableValues, operationName, fieldResolver, typeResolver, subscribeFieldResolver, enableEarlyExecution, signal, } = args; | ||
const { schema, document, rootValue, contextValue, variableValues: rawVariableValues, operationName, fieldResolver, typeResolver, subscribeFieldResolver, enableEarlyExecution, errorWithIncrementalSubscription, signal, } = args; | ||
// If the schema used for execution is invalid, throw an error. | ||
@@ -199,2 +200,3 @@ assertValidSchema(schema); | ||
enableEarlyExecution: enableEarlyExecution !== false, | ||
errorWithIncrementalSubscription: operation.operation === 'subscription' && errorWithIncrementalSubscription !== false, | ||
signal, | ||
@@ -221,3 +223,3 @@ errors: undefined, | ||
try { | ||
const { operation, schema, fragments, variableValues, rootValue } = exeContext; | ||
const { operation, schema, fragments, variableValues, rootValue, errorWithIncrementalSubscription, } = exeContext; | ||
const rootType = getDefinedRootType(schema, operation.operation, [operation]); | ||
@@ -229,3 +231,3 @@ if (rootType == null) { | ||
} | ||
const collectedFields = collectFields(schema, fragments, variableValues, rootType, operation); | ||
const collectedFields = collectFields(schema, fragments, variableValues, rootType, operation.selectionSet, errorWithIncrementalSubscription); | ||
let groupedFieldSet = collectedFields.groupedFieldSet; | ||
@@ -538,3 +540,3 @@ const newDeferUsages = collectedFields.newDeferUsages; | ||
invariant(stream['initialCount'] >= 0, 'initialCount must be a positive integer'); | ||
invariant(exeContext.operation.operation !== 'subscription', '`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.'); | ||
invariant(!exeContext.errorWithIncrementalSubscription, '`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.'); | ||
const streamedFieldGroup = fieldGroup.map(fieldDetails => ({ | ||
@@ -908,35 +910,2 @@ node: fieldDetails.node, | ||
}; | ||
/** | ||
* Implements the "Subscribe" algorithm described in the GraphQL specification, | ||
* including `@defer` and `@stream` as proposed in | ||
* https://github.com/graphql/graphql-spec/pull/742 | ||
* | ||
* Returns a Promise which resolves to either an AsyncIterator (if successful) | ||
* or an ExecutionResult (error). The promise will be rejected if the schema or | ||
* other arguments to this function are invalid, or if the resolved event stream | ||
* is not an async iterable. | ||
* | ||
* If the client-provided arguments to this function do not result in a | ||
* compliant subscription, a GraphQL Response (ExecutionResult) with descriptive | ||
* errors and no data will be returned. | ||
* | ||
* If the source stream could not be created due to faulty subscription resolver | ||
* logic or underlying systems, the promise will resolve to a single | ||
* ExecutionResult containing `errors` and no `data`. | ||
* | ||
* If the operation succeeded, the promise resolves to an AsyncIterator, which | ||
* yields a stream of result representing the response stream. | ||
* | ||
* Each result may be an ExecutionResult with no `hasNext` (if executing the | ||
* event did not use `@defer` or `@stream`), or an | ||
* `InitialIncrementalExecutionResult` or `SubsequentIncrementalExecutionResult` | ||
* (if executing the event used `@defer` or `@stream`). In the case of | ||
* incremental execution results, each event produces a single | ||
* `InitialIncrementalExecutionResult` followed by one or more | ||
* `SubsequentIncrementalExecutionResult`s; all but the last have `hasNext: true`, | ||
* and the last has `hasNext: false`. There is no interleaving between results | ||
* generated from the same original event. | ||
* | ||
* Accepts an object with named arguments. | ||
*/ | ||
export function subscribe(args) { | ||
@@ -1003,2 +972,10 @@ // If a valid execution context cannot be created due to incorrect arguments, | ||
} | ||
async function* ensureAsyncIterable(someExecutionResult) { | ||
if ('initialResult' in someExecutionResult) { | ||
yield* flattenIncrementalResults(someExecutionResult); | ||
} | ||
else { | ||
yield someExecutionResult; | ||
} | ||
} | ||
function mapSourceToResponse(exeContext, resultOrStream) { | ||
@@ -1014,3 +991,3 @@ if (!isAsyncIterable(resultOrStream)) { | ||
// "ExecuteQuery" algorithm, for which `execute` is also used. | ||
return mapAsyncIterator(resultOrStream[Symbol.asyncIterator](), (payload) => executeOperation(buildPerEventExecutionContext(exeContext, payload)), (error) => { | ||
return flattenAsyncIterable(mapAsyncIterator(resultOrStream[Symbol.asyncIterator](), async (payload) => ensureAsyncIterable(await executeOperation(buildPerEventExecutionContext(exeContext, payload))), (error) => { | ||
const wrappedError = createGraphQLError(error.message, { | ||
@@ -1021,3 +998,3 @@ originalError: error, | ||
throw wrappedError; | ||
}); | ||
})); | ||
} | ||
@@ -1037,3 +1014,3 @@ function createSourceEventStreamImpl(exeContext) { | ||
function executeSubscription(exeContext) { | ||
const { schema, fragments, operation, variableValues, rootValue } = exeContext; | ||
const { schema, fragments, operation, variableValues, rootValue, errorWithIncrementalSubscription, } = exeContext; | ||
const rootType = schema.getSubscriptionType(); | ||
@@ -1045,3 +1022,3 @@ if (rootType == null) { | ||
} | ||
const { groupedFieldSet } = collectFields(schema, fragments, variableValues, rootType, operation); | ||
const { groupedFieldSet } = collectFields(schema, fragments, variableValues, rootType, operation.selectionSet, errorWithIncrementalSubscription); | ||
const firstRootField = [...groupedFieldSet.entries()][0]; | ||
@@ -1048,0 +1025,0 @@ const [responseName, fieldGroup] = firstRootField; |
{ | ||
"name": "@graphql-tools/executor", | ||
"version": "2.0.0-alpha-20240620175016-1a4246713c9c2dcf5e3debfccfa47e0efd992528", | ||
"version": "2.0.0-alpha-20240702150434-510cb232d9e9dd0212d17ed8efc3e54d83ea25f4", | ||
"sideEffects": false, | ||
@@ -9,3 +9,3 @@ "peerDependencies": { | ||
"dependencies": { | ||
"@graphql-tools/utils": "10.3.0-alpha-20240620175016-1a4246713c9c2dcf5e3debfccfa47e0efd992528", | ||
"@graphql-tools/utils": "10.3.0-alpha-20240702150434-510cb232d9e9dd0212d17ed8efc3e54d83ea25f4", | ||
"@graphql-typed-document-node/core": "3.2.0", | ||
@@ -12,0 +12,0 @@ "@repeaterjs/repeater": "^3.0.4", |
@@ -1,2 +0,2 @@ | ||
import type { FieldNode, FragmentDefinitionNode, GraphQLObjectType, GraphQLSchema, OperationDefinitionNode } from 'graphql'; | ||
import type { FieldNode, FragmentDefinitionNode, GraphQLObjectType, GraphQLSchema, SelectionSetNode } from 'graphql'; | ||
export interface DeferUsage { | ||
@@ -21,3 +21,3 @@ label: string | undefined; | ||
*/ | ||
export declare function collectFields<TVariables = any>(schema: GraphQLSchema, fragments: Record<string, FragmentDefinitionNode>, variableValues: TVariables, runtimeType: GraphQLObjectType, operation: OperationDefinitionNode): { | ||
export declare function collectFields<TVariables = any>(schema: GraphQLSchema, fragments: Record<string, FragmentDefinitionNode>, variableValues: TVariables, runtimeType: GraphQLObjectType, selectionSet: SelectionSetNode, errorWithIncrementalSubscription: boolean): { | ||
groupedFieldSet: GroupedFieldSet; | ||
@@ -38,5 +38,5 @@ newDeferUsages: ReadonlyArray<DeferUsage>; | ||
[variable: string]: unknown; | ||
}, operation: OperationDefinitionNode, returnType: GraphQLObjectType, fieldGroup: FieldGroup): { | ||
}, errorWithIncrementalSubscription: boolean, returnType: GraphQLObjectType, fieldGroup: FieldGroup): { | ||
groupedFieldSet: GroupedFieldSet; | ||
newDeferUsages: ReadonlyArray<DeferUsage>; | ||
}; |
@@ -41,2 +41,3 @@ import { DocumentNode, FieldNode, FragmentDefinitionNode, GraphQLError, GraphQLField, GraphQLFieldResolver, GraphQLObjectType, GraphQLResolveInfo, GraphQLSchema, GraphQLTypeResolver, OperationDefinitionNode } from 'graphql'; | ||
enableEarlyExecution: boolean; | ||
errorWithIncrementalSubscription: boolean; | ||
signal: AbortSignal | undefined; | ||
@@ -58,2 +59,3 @@ errors: Map<Path | undefined, GraphQLError> | undefined; | ||
enableEarlyExecution?: Maybe<boolean>; | ||
errorWithIncrementalSubscription?: Maybe<boolean>; | ||
signal?: AbortSignal; | ||
@@ -154,2 +156,5 @@ } | ||
*/ | ||
export declare function subscribe<TData = any, TVariables = any, TContext = any>(args: ExecutionArgs<TData, TVariables, TContext> & { | ||
errorWithIncrementalSubscription: true | undefined | null; | ||
}): MaybePromise<AsyncGenerator<SingularExecutionResult<TData>, void, void> | SingularExecutionResult<TData>>; | ||
export declare function subscribe<TData = any, TVariables = any, TContext = any>(args: ExecutionArgs<TData, TVariables, TContext>): MaybePromise<AsyncGenerator<SingularExecutionResult<TData> | InitialIncrementalExecutionResult<TData> | SubsequentIncrementalExecutionResult<TData>, void, void> | SingularExecutionResult<TData>>; | ||
@@ -156,0 +161,0 @@ export declare function flattenIncrementalResults<TData>(incrementalResults: IncrementalExecutionResults<TData>): AsyncGenerator<SubsequentIncrementalExecutionResult<TData, Record<string, unknown>>, void, void>; |
Sorry, the diff of this file is not supported yet
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
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
264064
79
5393
+ Added@graphql-tools/utils@10.3.0-alpha-20240702150434-510cb232d9e9dd0212d17ed8efc3e54d83ea25f4(transitive)
- Removed@graphql-tools/utils@10.3.0-alpha-20240620175016-1a4246713c9c2dcf5e3debfccfa47e0efd992528(transitive)
Updated@graphql-tools/utils@10.3.0-alpha-20240702150434-510cb232d9e9dd0212d17ed8efc3e54d83ea25f4