@graphql-tools/executor
Advanced tools
Comparing version 2.0.0-alpha-20240702193839-5ddff7cfe353771d7175304a6feefa2c8b073e6c to 2.0.0-alpha-20240708182941-ed27153e85ecdb79083b1d124d470573a65893fd
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.buildFieldPlan = void 0; | ||
exports.buildBranchingFieldPlan = exports.buildFieldPlan = void 0; | ||
const AccumulatorMap_js_1 = require("./AccumulatorMap.js"); | ||
const getBySet_js_1 = require("./getBySet.js"); | ||
@@ -63,1 +64,27 @@ const isSameSet_js_1 = require("./isSameSet.js"); | ||
} | ||
function buildBranchingFieldPlan(originalGroupedFieldSet, parentDeferUsages = new Set()) { | ||
const groupedFieldSet = new AccumulatorMap_js_1.AccumulatorMap(); | ||
const newGroupedFieldSets = new Map(); | ||
for (const [responseKey, fieldGroup] of originalGroupedFieldSet) { | ||
for (const fieldDetails of fieldGroup) { | ||
const deferUsage = fieldDetails.deferUsage; | ||
const deferUsageSet = deferUsage === undefined ? new Set() : new Set([deferUsage]); | ||
if ((0, isSameSet_js_1.isSameSet)(parentDeferUsages, deferUsageSet)) { | ||
groupedFieldSet.add(responseKey, fieldDetails); | ||
} | ||
else { | ||
let newGroupedFieldSet = (0, getBySet_js_1.getBySet)(newGroupedFieldSets, deferUsageSet); | ||
if (newGroupedFieldSet === undefined) { | ||
newGroupedFieldSet = new AccumulatorMap_js_1.AccumulatorMap(); | ||
newGroupedFieldSets.set(deferUsageSet, newGroupedFieldSet); | ||
} | ||
newGroupedFieldSet.add(responseKey, fieldDetails); | ||
} | ||
} | ||
} | ||
return { | ||
groupedFieldSet, | ||
newGroupedFieldSets, | ||
}; | ||
} | ||
exports.buildBranchingFieldPlan = buildBranchingFieldPlan; |
@@ -153,3 +153,3 @@ "use strict"; | ||
function buildExecutionContext(args) { | ||
const { schema, document, rootValue, contextValue, variableValues: rawVariableValues, operationName, fieldResolver, typeResolver, subscribeFieldResolver, enableEarlyExecution, errorWithIncrementalSubscription, signal, } = args; | ||
const { schema, document, rootValue, contextValue, variableValues: rawVariableValues, operationName, fieldResolver, typeResolver, subscribeFieldResolver, enableEarlyExecution, deduplicateDefers, sendIncrementalErrorsAsNull, sendPathAndLabelOnIncremental, errorWithIncrementalSubscription, signal, } = args; | ||
// If the schema used for execution is invalid, throw an error. | ||
@@ -204,2 +204,5 @@ (0, graphql_1.assertValidSchema)(schema); | ||
enableEarlyExecution: enableEarlyExecution !== false, | ||
deduplicateDefers: deduplicateDefers !== false, | ||
sendIncrementalErrorsAsNull: sendIncrementalErrorsAsNull === true, | ||
sendPathAndLabelOnIncremental: sendPathAndLabelOnIncremental === true, | ||
errorWithIncrementalSubscription: operation.operation === 'subscription' && errorWithIncrementalSubscription !== false, | ||
@@ -228,3 +231,3 @@ signal, | ||
try { | ||
const { operation, schema, fragments, variableValues, rootValue, errorWithIncrementalSubscription, } = exeContext; | ||
const { operation, schema, fragments, variableValues, rootValue, deduplicateDefers, errorWithIncrementalSubscription, } = exeContext; | ||
const rootType = (0, utils_1.getDefinedRootType)(schema, operation.operation, [operation]); | ||
@@ -244,3 +247,5 @@ if (rootType == null) { | ||
else { | ||
const fieldPLan = (0, buildFieldPlan_js_1.buildFieldPlan)(groupedFieldSet); | ||
const fieldPLan = deduplicateDefers | ||
? (0, buildFieldPlan_js_1.buildFieldPlan)(groupedFieldSet) | ||
: (0, buildFieldPlan_js_1.buildBranchingFieldPlan)(groupedFieldSet); | ||
groupedFieldSet = fieldPLan.groupedFieldSet; | ||
@@ -580,2 +585,3 @@ const newGroupedFieldSets = fieldPLan.newGroupedFieldSets; | ||
path, | ||
index, | ||
streamItemQueue, | ||
@@ -588,2 +594,3 @@ }; | ||
path, | ||
index, | ||
streamItemQueue, | ||
@@ -666,2 +673,3 @@ earlyReturn: returnFn.bind(asyncIterator), | ||
path, | ||
index, | ||
streamItemQueue: buildSyncStreamItemQueue(item, index, path, iterator, exeContext, streamUsage.fieldGroup, info, itemType), | ||
@@ -844,3 +852,3 @@ }; | ||
} | ||
const subFieldPlan = buildSubFieldPlan(groupedFieldSet, incrementalContext?.deferUsageSet); | ||
const subFieldPlan = buildSubFieldPlan(groupedFieldSet, incrementalContext?.deferUsageSet, exeContext.deduplicateDefers); | ||
groupedFieldSet = subFieldPlan.groupedFieldSet; | ||
@@ -857,3 +865,3 @@ const newGroupedFieldSets = subFieldPlan.newGroupedFieldSets; | ||
} | ||
function buildSubFieldPlan(originalGroupedFieldSet, deferUsageSet) { | ||
function buildSubFieldPlan(originalGroupedFieldSet, deferUsageSet, deduplicateDefers) { | ||
let fieldPlan = originalGroupedFieldSet._fieldPlan; | ||
@@ -863,3 +871,5 @@ if (fieldPlan !== undefined) { | ||
} | ||
fieldPlan = (0, buildFieldPlan_js_1.buildFieldPlan)(originalGroupedFieldSet, deferUsageSet); | ||
fieldPlan = deduplicateDefers | ||
? (0, buildFieldPlan_js_1.buildFieldPlan)(originalGroupedFieldSet, deferUsageSet) | ||
: (0, buildFieldPlan_js_1.buildBranchingFieldPlan)(originalGroupedFieldSet, deferUsageSet); | ||
originalGroupedFieldSet._fieldPlan = fieldPlan; | ||
@@ -866,0 +876,0 @@ return fieldPlan; |
@@ -36,2 +36,16 @@ "use strict"; | ||
} | ||
currentCompletedIncrementalData() { | ||
return { | ||
[Symbol.iterator]() { | ||
return this; | ||
}, | ||
next: () => { | ||
const value = this._completedQueue.shift(); | ||
if (value !== undefined) { | ||
return { value, done: false }; | ||
} | ||
return { value: undefined, done: true }; | ||
}, | ||
}; | ||
} | ||
completedIncrementalData() { | ||
@@ -38,0 +52,0 @@ return { |
@@ -73,9 +73,7 @@ "use strict"; | ||
}; | ||
let currentCompletedIncrementalData = this._incrementalGraph.currentCompletedIncrementalData(); | ||
const completedIncrementalData = this._incrementalGraph.completedIncrementalData(); | ||
// use the raw iterator rather than 'for await ... of' so as not to trigger the | ||
// '.return()' method on the iterator when exiting the loop with the next value | ||
const asyncIterator = completedIncrementalData[Symbol.asyncIterator](); | ||
let iteration = await asyncIterator.next(); | ||
while (!iteration.done) { | ||
for (const completedResult of iteration.value) { | ||
do { | ||
for (const completedResult of currentCompletedIncrementalData) { | ||
this._handleCompletedIncrementalData(completedResult, context); | ||
@@ -104,4 +102,5 @@ } | ||
} | ||
iteration = await asyncIterator.next(); | ||
} | ||
const iteration = await asyncIterator.next(); | ||
currentCompletedIncrementalData = iteration.value; | ||
} while (currentCompletedIncrementalData !== undefined); | ||
if (this._context.signal?.aborted) { | ||
@@ -150,6 +149,24 @@ throw this._context.signal.reason; | ||
(0, invariant_js_1.invariant)(id !== undefined); | ||
context.completed.push({ | ||
id, | ||
errors: deferredGroupedFieldSetResult.errors, | ||
}); | ||
if (this._context.sendIncrementalErrorsAsNull) { | ||
const incrementalEntry = { | ||
id, | ||
data: null, | ||
errors: deferredGroupedFieldSetResult.errors, | ||
}; | ||
if (this._context.sendPathAndLabelOnIncremental) { | ||
const { path, label } = deferredFragmentRecord; | ||
incrementalEntry.path = (0, utils_1.pathToArray)(path); | ||
if (label !== undefined) { | ||
incrementalEntry.label = label; | ||
} | ||
} | ||
context.incremental.push(incrementalEntry); | ||
context.completed.push({ id }); | ||
} | ||
else { | ||
context.completed.push({ | ||
id, | ||
errors: deferredGroupedFieldSetResult.errors, | ||
}); | ||
} | ||
} | ||
@@ -176,2 +193,9 @@ return; | ||
}; | ||
if (this._context.sendPathAndLabelOnIncremental) { | ||
const { path, label } = deferredFragmentRecord; | ||
incrementalEntry.path = (0, utils_1.pathToArray)(path); | ||
if (label !== undefined) { | ||
incrementalEntry.label = label; | ||
} | ||
} | ||
if (subPath !== undefined) { | ||
@@ -190,6 +214,24 @@ incrementalEntry.subPath = subPath; | ||
if (streamItemsResult.errors !== undefined) { | ||
context.completed.push({ | ||
id, | ||
errors: streamItemsResult.errors, | ||
}); | ||
if (this._context.sendIncrementalErrorsAsNull) { | ||
const incrementalEntry = { | ||
items: null, | ||
id, | ||
errors: streamItemsResult.errors, | ||
}; | ||
if (this._context.sendPathAndLabelOnIncremental) { | ||
const { path, label, index } = streamRecord; | ||
incrementalEntry.path = (0, utils_1.pathToArray)((0, utils_1.addPath)(path, index, undefined)); | ||
if (label !== undefined) { | ||
incrementalEntry.label = label; | ||
} | ||
} | ||
context.incremental.push(incrementalEntry); | ||
context.completed.push({ id }); | ||
} | ||
else { | ||
context.completed.push({ | ||
id, | ||
errors: streamItemsResult.errors, | ||
}); | ||
} | ||
this._incrementalGraph.removeStream(streamRecord); | ||
@@ -214,6 +256,15 @@ if ((0, types_js_1.isCancellableStreamRecord)(streamRecord)) { | ||
else { | ||
const bareResult = streamItemsResult.result; | ||
const incrementalEntry = { | ||
id, | ||
...streamItemsResult.result, | ||
...bareResult, | ||
}; | ||
if (this._context.sendPathAndLabelOnIncremental) { | ||
const { path, label, index } = streamRecord; | ||
incrementalEntry.path = (0, utils_1.pathToArray)((0, utils_1.addPath)(path, index, undefined)); | ||
streamRecord.index += bareResult.items.length; | ||
if (label !== undefined) { | ||
incrementalEntry.label = label; | ||
} | ||
} | ||
context.incremental.push(incrementalEntry); | ||
@@ -220,0 +271,0 @@ const incrementalDataRecords = streamItemsResult.incrementalDataRecords; |
@@ -0,1 +1,2 @@ | ||
import { AccumulatorMap } from './AccumulatorMap.js'; | ||
import { getBySet } from './getBySet.js'; | ||
@@ -59,1 +60,26 @@ import { isSameSet } from './isSameSet.js'; | ||
} | ||
export function buildBranchingFieldPlan(originalGroupedFieldSet, parentDeferUsages = new Set()) { | ||
const groupedFieldSet = new AccumulatorMap(); | ||
const newGroupedFieldSets = new Map(); | ||
for (const [responseKey, fieldGroup] of originalGroupedFieldSet) { | ||
for (const fieldDetails of fieldGroup) { | ||
const deferUsage = fieldDetails.deferUsage; | ||
const deferUsageSet = deferUsage === undefined ? new Set() : new Set([deferUsage]); | ||
if (isSameSet(parentDeferUsages, deferUsageSet)) { | ||
groupedFieldSet.add(responseKey, fieldDetails); | ||
} | ||
else { | ||
let newGroupedFieldSet = getBySet(newGroupedFieldSets, deferUsageSet); | ||
if (newGroupedFieldSet === undefined) { | ||
newGroupedFieldSet = new AccumulatorMap(); | ||
newGroupedFieldSets.set(deferUsageSet, newGroupedFieldSet); | ||
} | ||
newGroupedFieldSet.add(responseKey, fieldDetails); | ||
} | ||
} | ||
} | ||
return { | ||
groupedFieldSet, | ||
newGroupedFieldSets, | ||
}; | ||
} |
import { assertValidSchema, getDirectiveValues, GraphQLError, isAbstractType, isLeafType, isListType, isNonNullType, isObjectType, Kind, locatedError, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, versionInfo, } from 'graphql'; | ||
import { addPath, createGraphQLError, getArgumentValues, getDefinedRootType, GraphQLStreamDirective, inspect, isAsyncIterable, isIterableObject, isObjectLike, isPromise, mapAsyncIterator, memoize1, memoize3, pathToArray, promiseReduce, } from '@graphql-tools/utils'; | ||
import { BoxedPromiseOrValue } from './BoxedPromiseOrValue.js'; | ||
import { buildFieldPlan } from './buildFieldPlan.js'; | ||
import { buildBranchingFieldPlan, buildFieldPlan, } from './buildFieldPlan.js'; | ||
import { coerceError } from './coerceError.js'; | ||
@@ -147,3 +147,3 @@ import { collectSubfields as _collectSubfields, collectFields, } from './collectFields.js'; | ||
export function buildExecutionContext(args) { | ||
const { schema, document, rootValue, contextValue, variableValues: rawVariableValues, operationName, fieldResolver, typeResolver, subscribeFieldResolver, enableEarlyExecution, errorWithIncrementalSubscription, signal, } = args; | ||
const { schema, document, rootValue, contextValue, variableValues: rawVariableValues, operationName, fieldResolver, typeResolver, subscribeFieldResolver, enableEarlyExecution, deduplicateDefers, sendIncrementalErrorsAsNull, sendPathAndLabelOnIncremental, errorWithIncrementalSubscription, signal, } = args; | ||
// If the schema used for execution is invalid, throw an error. | ||
@@ -198,2 +198,5 @@ assertValidSchema(schema); | ||
enableEarlyExecution: enableEarlyExecution !== false, | ||
deduplicateDefers: deduplicateDefers !== false, | ||
sendIncrementalErrorsAsNull: sendIncrementalErrorsAsNull === true, | ||
sendPathAndLabelOnIncremental: sendPathAndLabelOnIncremental === true, | ||
errorWithIncrementalSubscription: operation.operation === 'subscription' && errorWithIncrementalSubscription !== false, | ||
@@ -221,3 +224,3 @@ signal, | ||
try { | ||
const { operation, schema, fragments, variableValues, rootValue, errorWithIncrementalSubscription, } = exeContext; | ||
const { operation, schema, fragments, variableValues, rootValue, deduplicateDefers, errorWithIncrementalSubscription, } = exeContext; | ||
const rootType = getDefinedRootType(schema, operation.operation, [operation]); | ||
@@ -237,3 +240,5 @@ if (rootType == null) { | ||
else { | ||
const fieldPLan = buildFieldPlan(groupedFieldSet); | ||
const fieldPLan = deduplicateDefers | ||
? buildFieldPlan(groupedFieldSet) | ||
: buildBranchingFieldPlan(groupedFieldSet); | ||
groupedFieldSet = fieldPLan.groupedFieldSet; | ||
@@ -572,2 +577,3 @@ const newGroupedFieldSets = fieldPLan.newGroupedFieldSets; | ||
path, | ||
index, | ||
streamItemQueue, | ||
@@ -580,2 +586,3 @@ }; | ||
path, | ||
index, | ||
streamItemQueue, | ||
@@ -658,2 +665,3 @@ earlyReturn: returnFn.bind(asyncIterator), | ||
path, | ||
index, | ||
streamItemQueue: buildSyncStreamItemQueue(item, index, path, iterator, exeContext, streamUsage.fieldGroup, info, itemType), | ||
@@ -836,3 +844,3 @@ }; | ||
} | ||
const subFieldPlan = buildSubFieldPlan(groupedFieldSet, incrementalContext?.deferUsageSet); | ||
const subFieldPlan = buildSubFieldPlan(groupedFieldSet, incrementalContext?.deferUsageSet, exeContext.deduplicateDefers); | ||
groupedFieldSet = subFieldPlan.groupedFieldSet; | ||
@@ -849,3 +857,3 @@ const newGroupedFieldSets = subFieldPlan.newGroupedFieldSets; | ||
} | ||
function buildSubFieldPlan(originalGroupedFieldSet, deferUsageSet) { | ||
function buildSubFieldPlan(originalGroupedFieldSet, deferUsageSet, deduplicateDefers) { | ||
let fieldPlan = originalGroupedFieldSet._fieldPlan; | ||
@@ -855,3 +863,5 @@ if (fieldPlan !== undefined) { | ||
} | ||
fieldPlan = buildFieldPlan(originalGroupedFieldSet, deferUsageSet); | ||
fieldPlan = deduplicateDefers | ||
? buildFieldPlan(originalGroupedFieldSet, deferUsageSet) | ||
: buildBranchingFieldPlan(originalGroupedFieldSet, deferUsageSet); | ||
originalGroupedFieldSet._fieldPlan = fieldPlan; | ||
@@ -858,0 +868,0 @@ return fieldPlan; |
@@ -33,2 +33,16 @@ import { createDeferred, isPromise } from '@graphql-tools/utils'; | ||
} | ||
currentCompletedIncrementalData() { | ||
return { | ||
[Symbol.iterator]() { | ||
return this; | ||
}, | ||
next: () => { | ||
const value = this._completedQueue.shift(); | ||
if (value !== undefined) { | ||
return { value, done: false }; | ||
} | ||
return { value: undefined, done: true }; | ||
}, | ||
}; | ||
} | ||
completedIncrementalData() { | ||
@@ -35,0 +49,0 @@ return { |
@@ -1,2 +0,2 @@ | ||
import { pathToArray } from '@graphql-tools/utils'; | ||
import { addPath, pathToArray } from '@graphql-tools/utils'; | ||
import { IncrementalGraph } from './IncrementalGraph.js'; | ||
@@ -69,9 +69,7 @@ import { invariant } from './invariant.js'; | ||
}; | ||
let currentCompletedIncrementalData = this._incrementalGraph.currentCompletedIncrementalData(); | ||
const completedIncrementalData = this._incrementalGraph.completedIncrementalData(); | ||
// use the raw iterator rather than 'for await ... of' so as not to trigger the | ||
// '.return()' method on the iterator when exiting the loop with the next value | ||
const asyncIterator = completedIncrementalData[Symbol.asyncIterator](); | ||
let iteration = await asyncIterator.next(); | ||
while (!iteration.done) { | ||
for (const completedResult of iteration.value) { | ||
do { | ||
for (const completedResult of currentCompletedIncrementalData) { | ||
this._handleCompletedIncrementalData(completedResult, context); | ||
@@ -100,4 +98,5 @@ } | ||
} | ||
iteration = await asyncIterator.next(); | ||
} | ||
const iteration = await asyncIterator.next(); | ||
currentCompletedIncrementalData = iteration.value; | ||
} while (currentCompletedIncrementalData !== undefined); | ||
if (this._context.signal?.aborted) { | ||
@@ -146,6 +145,24 @@ throw this._context.signal.reason; | ||
invariant(id !== undefined); | ||
context.completed.push({ | ||
id, | ||
errors: deferredGroupedFieldSetResult.errors, | ||
}); | ||
if (this._context.sendIncrementalErrorsAsNull) { | ||
const incrementalEntry = { | ||
id, | ||
data: null, | ||
errors: deferredGroupedFieldSetResult.errors, | ||
}; | ||
if (this._context.sendPathAndLabelOnIncremental) { | ||
const { path, label } = deferredFragmentRecord; | ||
incrementalEntry.path = pathToArray(path); | ||
if (label !== undefined) { | ||
incrementalEntry.label = label; | ||
} | ||
} | ||
context.incremental.push(incrementalEntry); | ||
context.completed.push({ id }); | ||
} | ||
else { | ||
context.completed.push({ | ||
id, | ||
errors: deferredGroupedFieldSetResult.errors, | ||
}); | ||
} | ||
} | ||
@@ -172,2 +189,9 @@ return; | ||
}; | ||
if (this._context.sendPathAndLabelOnIncremental) { | ||
const { path, label } = deferredFragmentRecord; | ||
incrementalEntry.path = pathToArray(path); | ||
if (label !== undefined) { | ||
incrementalEntry.label = label; | ||
} | ||
} | ||
if (subPath !== undefined) { | ||
@@ -186,6 +210,24 @@ incrementalEntry.subPath = subPath; | ||
if (streamItemsResult.errors !== undefined) { | ||
context.completed.push({ | ||
id, | ||
errors: streamItemsResult.errors, | ||
}); | ||
if (this._context.sendIncrementalErrorsAsNull) { | ||
const incrementalEntry = { | ||
items: null, | ||
id, | ||
errors: streamItemsResult.errors, | ||
}; | ||
if (this._context.sendPathAndLabelOnIncremental) { | ||
const { path, label, index } = streamRecord; | ||
incrementalEntry.path = pathToArray(addPath(path, index, undefined)); | ||
if (label !== undefined) { | ||
incrementalEntry.label = label; | ||
} | ||
} | ||
context.incremental.push(incrementalEntry); | ||
context.completed.push({ id }); | ||
} | ||
else { | ||
context.completed.push({ | ||
id, | ||
errors: streamItemsResult.errors, | ||
}); | ||
} | ||
this._incrementalGraph.removeStream(streamRecord); | ||
@@ -210,6 +252,15 @@ if (isCancellableStreamRecord(streamRecord)) { | ||
else { | ||
const bareResult = streamItemsResult.result; | ||
const incrementalEntry = { | ||
id, | ||
...streamItemsResult.result, | ||
...bareResult, | ||
}; | ||
if (this._context.sendPathAndLabelOnIncremental) { | ||
const { path, label, index } = streamRecord; | ||
incrementalEntry.path = pathToArray(addPath(path, index, undefined)); | ||
streamRecord.index += bareResult.items.length; | ||
if (label !== undefined) { | ||
incrementalEntry.label = label; | ||
} | ||
} | ||
context.incremental.push(incrementalEntry); | ||
@@ -216,0 +267,0 @@ const incrementalDataRecords = streamItemsResult.incrementalDataRecords; |
{ | ||
"name": "@graphql-tools/executor", | ||
"version": "2.0.0-alpha-20240702193839-5ddff7cfe353771d7175304a6feefa2c8b073e6c", | ||
"version": "2.0.0-alpha-20240708182941-ed27153e85ecdb79083b1d124d470573a65893fd", | ||
"sideEffects": false, | ||
@@ -9,3 +9,3 @@ "peerDependencies": { | ||
"dependencies": { | ||
"@graphql-tools/utils": "10.3.0-alpha-20240702193839-5ddff7cfe353771d7175304a6feefa2c8b073e6c", | ||
"@graphql-tools/utils": "10.3.0-alpha-20240708182941-ed27153e85ecdb79083b1d124d470573a65893fd", | ||
"@graphql-typed-document-node/core": "3.2.0", | ||
@@ -12,0 +12,0 @@ "@repeaterjs/repeater": "^3.0.4", |
@@ -8,1 +8,2 @@ import type { DeferUsage, GroupedFieldSet } from './collectFields.js'; | ||
export declare function buildFieldPlan(originalGroupedFieldSet: GroupedFieldSet, parentDeferUsages?: DeferUsageSet): FieldPlan; | ||
export declare function buildBranchingFieldPlan(originalGroupedFieldSet: GroupedFieldSet, parentDeferUsages?: DeferUsageSet): FieldPlan; |
@@ -41,2 +41,5 @@ import { DocumentNode, FieldNode, FragmentDefinitionNode, GraphQLError, GraphQLField, GraphQLFieldResolver, GraphQLObjectType, GraphQLResolveInfo, GraphQLSchema, GraphQLTypeResolver, OperationDefinitionNode } from 'graphql'; | ||
enableEarlyExecution: boolean; | ||
deduplicateDefers: boolean; | ||
sendIncrementalErrorsAsNull: boolean; | ||
sendPathAndLabelOnIncremental: boolean; | ||
errorWithIncrementalSubscription: boolean; | ||
@@ -59,2 +62,5 @@ signal: AbortSignal | undefined; | ||
enableEarlyExecution?: Maybe<boolean>; | ||
deduplicateDefers?: Maybe<boolean>; | ||
sendIncrementalErrorsAsNull?: Maybe<boolean>; | ||
sendPathAndLabelOnIncremental?: Maybe<boolean>; | ||
errorWithIncrementalSubscription?: Maybe<boolean>; | ||
@@ -61,0 +67,0 @@ signal?: AbortSignal; |
@@ -12,2 +12,6 @@ import type { DeferredFragmentRecord, IncrementalDataRecord, IncrementalDataRecordResult, ReconcilableDeferredGroupedFieldSetResult, StreamRecord, SubsequentResultRecord } from './types.js'; | ||
addCompletedReconcilableDeferredGroupedFieldSet(reconcilableResult: ReconcilableDeferredGroupedFieldSetResult): void; | ||
currentCompletedIncrementalData(): { | ||
[Symbol.iterator](): any; | ||
next: () => IteratorResult<IncrementalDataRecordResult>; | ||
}; | ||
completedIncrementalData(): { | ||
@@ -14,0 +18,0 @@ [Symbol.asyncIterator](): any; |
@@ -5,2 +5,4 @@ import type { GraphQLError } from 'graphql'; | ||
interface IncrementalPublisherContext { | ||
sendIncrementalErrorsAsNull: boolean; | ||
sendPathAndLabelOnIncremental: boolean; | ||
signal: AbortSignal | undefined; | ||
@@ -7,0 +9,0 @@ cancellableStreams: Set<CancellableStreamRecord> | undefined; |
@@ -57,4 +57,8 @@ import type { GraphQLError, GraphQLFormattedError } from 'graphql'; | ||
} | ||
export interface IncrementalDeferResult<TData = Record<string, unknown>, TExtensions = Record<string, unknown>> extends BareDeferredGroupedFieldSetResult<TData> { | ||
export interface IncrementalDeferResult<TData = Record<string, unknown>, TExtensions = Record<string, unknown>> { | ||
errors?: ReadonlyArray<GraphQLError>; | ||
data: TData | null; | ||
id: string; | ||
path?: ReadonlyArray<string | number>; | ||
label?: string; | ||
subPath?: ReadonlyArray<string | number>; | ||
@@ -65,4 +69,6 @@ extensions?: TExtensions; | ||
errors?: ReadonlyArray<GraphQLFormattedError>; | ||
data: TData; | ||
data: TData | null; | ||
id: string; | ||
path?: ReadonlyArray<string | number>; | ||
label?: string; | ||
subPath?: ReadonlyArray<string | number>; | ||
@@ -75,5 +81,8 @@ extensions?: TExtensions; | ||
} | ||
export interface IncrementalStreamResult<TData = ReadonlyArray<unknown>, TExtensions = Record<string, unknown>> extends BareStreamItemsResult<TData> { | ||
export interface IncrementalStreamResult<TData = ReadonlyArray<unknown>, TExtensions = Record<string, unknown>> { | ||
errors?: ReadonlyArray<GraphQLError>; | ||
items: TData | null; | ||
id: string; | ||
subPath?: ReadonlyArray<string | number>; | ||
path?: ReadonlyArray<string | number>; | ||
label?: string; | ||
extensions?: TExtensions; | ||
@@ -83,5 +92,6 @@ } | ||
errors?: ReadonlyArray<GraphQLFormattedError>; | ||
items: TData; | ||
items: TData | null; | ||
id: string; | ||
subPath?: ReadonlyArray<string | number>; | ||
path?: ReadonlyArray<string | number>; | ||
label?: string; | ||
extensions?: TExtensions; | ||
@@ -154,2 +164,3 @@ } | ||
label: string | undefined; | ||
index: number; | ||
id?: string | undefined; | ||
@@ -156,0 +167,0 @@ streamItemQueue: Array<StreamItemRecord>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
273723
5584
+ Added@graphql-tools/utils@10.3.0-alpha-20240708182941-ed27153e85ecdb79083b1d124d470573a65893fd(transitive)
- Removed@graphql-tools/utils@10.3.0-alpha-20240702193839-5ddff7cfe353771d7175304a6feefa2c8b073e6c(transitive)
Updated@graphql-tools/utils@10.3.0-alpha-20240708182941-ed27153e85ecdb79083b1d124d470573a65893fd