Comparing version 17.0.0-alpha.2.canary.pr.3911.a281faf70fee4ba1522af45cf15f41a899c723c4 to 17.0.0-alpha.2.canary.pr.3937.8e773a04d8041ffc00a1550e8c6688e01ba11832
import type { ObjMap } from '../jsutils/ObjMap.js'; | ||
import type { | ||
FieldNode, | ||
FragmentDefinitionNode, | ||
OperationDefinitionNode, | ||
} from '../language/ast.js'; | ||
import type { | ||
DeferUsage, | ||
FieldDetails, | ||
GraphQLObjectType, | ||
Target, | ||
} from '../type/definition.js'; | ||
import type { GraphQLObjectType } from '../type/definition.js'; | ||
import type { GraphQLSchema } from '../type/schema.js'; | ||
export interface DeferUsage { | ||
label: string | undefined; | ||
ancestors: ReadonlyArray<Target>; | ||
} | ||
export declare const NON_DEFERRED_TARGET_SET: TargetSet; | ||
export type Target = DeferUsage | undefined; | ||
export type TargetSet = ReadonlySet<Target>; | ||
export type DeferUsageSet = ReadonlySet<DeferUsage>; | ||
export interface FieldDetails { | ||
node: FieldNode; | ||
target: Target; | ||
} | ||
export interface FieldGroup { | ||
@@ -17,0 +22,0 @@ fields: ReadonlyArray<FieldDetails>; |
@@ -143,15 +143,8 @@ 'use strict'; | ||
target = newTarget; | ||
} else if (parentTarget === undefined) { | ||
target = { | ||
...defer, | ||
ancestors: [parentTarget], | ||
deferPriority: 1, | ||
}; | ||
newDeferUsages.push(target); | ||
} else { | ||
target = { | ||
...defer, | ||
ancestors: [parentTarget, ...parentTarget.ancestors], | ||
deferPriority: parentTarget.deferPriority + 1, | ||
}; | ||
const ancestors = | ||
parentTarget === undefined | ||
? [parentTarget] | ||
: [parentTarget, ...parentTarget.ancestors]; | ||
target = { ...defer, ancestors }; | ||
newDeferUsages.push(target); | ||
@@ -187,15 +180,8 @@ } | ||
target = newTarget; | ||
} else if (parentTarget === undefined) { | ||
target = { | ||
...defer, | ||
ancestors: [parentTarget], | ||
deferPriority: 1, | ||
}; | ||
newDeferUsages.push(target); | ||
} else { | ||
target = { | ||
...defer, | ||
ancestors: [parentTarget, ...parentTarget.ancestors], | ||
deferPriority: parentTarget.deferPriority + 1, | ||
}; | ||
const ancestors = | ||
parentTarget === undefined | ||
? [parentTarget] | ||
: [parentTarget, ...parentTarget.ancestors]; | ||
target = { ...defer, ancestors }; | ||
newDeferUsages.push(target); | ||
@@ -202,0 +188,0 @@ } |
@@ -23,3 +23,2 @@ import type { Maybe } from '../jsutils/Maybe.js'; | ||
ExperimentalIncrementalExecutionResults, | ||
IncrementalDataRecord, | ||
} from './IncrementalPublisher.js'; | ||
@@ -146,3 +145,2 @@ import { IncrementalPublisher } from './IncrementalPublisher.js'; | ||
path: Path, | ||
incrementalDataRecord?: IncrementalDataRecord | undefined, | ||
): GraphQLResolveInfo; | ||
@@ -149,0 +147,0 @@ /** |
@@ -290,3 +290,2 @@ 'use strict'; | ||
newGroupedFieldSetDetails, | ||
initialResultRecord, | ||
newDeferMap, | ||
@@ -476,3 +475,2 @@ path, | ||
path, | ||
incrementalDataRecord, | ||
); | ||
@@ -550,32 +548,8 @@ // Get the resolve function, regardless of if its result is normal or abrupt (error). | ||
*/ | ||
function buildResolveInfo( | ||
exeContext, | ||
fieldDef, | ||
fieldGroup, | ||
parentType, | ||
path, | ||
incrementalDataRecord, | ||
) { | ||
function buildResolveInfo(exeContext, fieldDef, fieldGroup, parentType, path) { | ||
// The resolve function's optional fourth argument is a collection of | ||
// information about the current execution state. | ||
if (incrementalDataRecord === undefined) { | ||
return { | ||
fieldName: fieldDef.name, | ||
fieldDetails: fieldGroup.fields, | ||
returnType: fieldDef.type, | ||
parentType, | ||
path, | ||
schema: exeContext.schema, | ||
fragments: exeContext.fragments, | ||
rootValue: exeContext.rootValue, | ||
operation: exeContext.operation, | ||
variableValues: exeContext.variableValues, | ||
priority: 0, | ||
deferPriority: 0, | ||
published: true, | ||
}; | ||
} | ||
return { | ||
fieldName: fieldDef.name, | ||
fieldDetails: fieldGroup.fields, | ||
fieldNodes: toNodes(fieldGroup), | ||
returnType: fieldDef.type, | ||
@@ -589,8 +563,2 @@ parentType, | ||
variableValues: exeContext.variableValues, | ||
priority: incrementalDataRecord.priority, | ||
deferPriority: incrementalDataRecord.deferPriority, | ||
published: | ||
incrementalDataRecord.published === true | ||
? true | ||
: incrementalDataRecord.published, | ||
}; | ||
@@ -1289,3 +1257,2 @@ } | ||
newGroupedFieldSetDetails, | ||
incrementalDataRecord, | ||
deferMap, | ||
@@ -1303,19 +1270,9 @@ path, | ||
); | ||
const deferredGroupedFieldSetRecord = shouldInitiateDefer | ||
? new IncrementalPublisher_js_1.DeferredGroupedFieldSetRecord({ | ||
path, | ||
priority: incrementalDataRecord.priority + 1, | ||
deferPriority: incrementalDataRecord.deferPriority + 1, | ||
deferredFragmentRecords, | ||
groupedFieldSet, | ||
shouldInitiateDefer: true, | ||
}) | ||
: new IncrementalPublisher_js_1.DeferredGroupedFieldSetRecord({ | ||
path, | ||
priority: incrementalDataRecord.priority, | ||
deferPriority: incrementalDataRecord.deferPriority, | ||
deferredFragmentRecords, | ||
groupedFieldSet, | ||
shouldInitiateDefer: false, | ||
}); | ||
const deferredGroupedFieldSetRecord = | ||
new IncrementalPublisher_js_1.DeferredGroupedFieldSetRecord({ | ||
path, | ||
deferredFragmentRecords, | ||
groupedFieldSet, | ||
shouldInitiateDefer, | ||
}); | ||
incrementalPublisher.reportNewDeferredGroupedFieldSetRecord( | ||
@@ -1356,3 +1313,2 @@ deferredGroupedFieldSetRecord, | ||
newGroupedFieldSetDetails, | ||
incrementalDataRecord, | ||
newDeferMap, | ||
@@ -1728,3 +1684,2 @@ path, | ||
path: itemPath, | ||
priority: incrementalDataRecord.priority + 1, | ||
}); | ||
@@ -1913,3 +1868,2 @@ incrementalPublisher.reportNewStreamItemsRecord( | ||
path: itemPath, | ||
priority: incrementalDataRecord.priority + 1, | ||
}); | ||
@@ -1916,0 +1870,0 @@ incrementalPublisher.reportNewStreamItemsRecord( |
@@ -242,5 +242,2 @@ import type { ObjMap } from '../jsutils/ObjMap.js'; | ||
children: Set<SubsequentResultRecord>; | ||
priority: number; | ||
deferPriority: number; | ||
published: true; | ||
constructor(); | ||
@@ -251,4 +248,2 @@ } | ||
path: ReadonlyArray<string | number>; | ||
priority: number; | ||
deferPriority: number; | ||
deferredFragmentRecords: ReadonlyArray<DeferredFragmentRecord>; | ||
@@ -259,9 +254,5 @@ groupedFieldSet: GroupedFieldSet; | ||
data: ObjMap<unknown> | undefined; | ||
published: true | Promise<void>; | ||
publish: () => void; | ||
sent: boolean; | ||
constructor(opts: { | ||
path: Path | undefined; | ||
priority: number; | ||
deferPriority: number; | ||
deferredFragmentRecords: ReadonlyArray<DeferredFragmentRecord>; | ||
@@ -304,4 +295,2 @@ groupedFieldSet: GroupedFieldSet; | ||
path: ReadonlyArray<string | number>; | ||
priority: number; | ||
deferPriority: number; | ||
items: Array<unknown> | undefined; | ||
@@ -313,10 +302,3 @@ children: Set<SubsequentResultRecord>; | ||
filtered: boolean; | ||
published: true | Promise<void>; | ||
publish: () => void; | ||
sent: boolean; | ||
constructor(opts: { | ||
streamRecord: StreamRecord; | ||
path: Path | undefined; | ||
priority: number; | ||
}); | ||
constructor(opts: { streamRecord: StreamRecord; path: Path | undefined }); | ||
} | ||
@@ -323,0 +305,0 @@ export type IncrementalDataRecord = |
@@ -398,3 +398,2 @@ 'use strict'; | ||
this._introduce(subsequentResultRecord); | ||
subsequentResultRecord.publish(); | ||
return; | ||
@@ -405,5 +404,2 @@ } | ||
} else { | ||
for (const deferredGroupedFieldSetRecord of subsequentResultRecord.deferredGroupedFieldSetRecords) { | ||
deferredGroupedFieldSetRecord.publish(); | ||
} | ||
this._introduce(subsequentResultRecord); | ||
@@ -467,5 +463,2 @@ } | ||
this.children = new Set(); | ||
this.priority = 0; | ||
this.deferPriority = 0; | ||
this.published = true; | ||
} | ||
@@ -478,4 +471,2 @@ } | ||
this.path = (0, Path_js_1.pathToArray)(opts.path); | ||
this.priority = opts.priority; | ||
this.deferPriority = opts.deferPriority; | ||
this.deferredFragmentRecords = opts.deferredFragmentRecords; | ||
@@ -485,12 +476,2 @@ this.groupedFieldSet = opts.groupedFieldSet; | ||
this.errors = []; | ||
// promiseWithResolvers uses void only as a generic type parameter | ||
// see: https://typescript-eslint.io/rules/no-invalid-void-type/ | ||
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type | ||
const { promise: published, resolve } = (0, | ||
promiseWithResolvers_js_1.promiseWithResolvers)(); | ||
this.published = published; | ||
this.publish = () => { | ||
resolve(); | ||
this.published = true; | ||
}; | ||
this.sent = false; | ||
@@ -528,4 +509,2 @@ } | ||
this.path = (0, Path_js_1.pathToArray)(opts.path); | ||
this.priority = opts.priority; | ||
this.deferPriority = 0; | ||
this.children = new Set(); | ||
@@ -535,15 +514,4 @@ this.errors = []; | ||
this.filtered = false; | ||
// promiseWithResolvers uses void only as a generic type parameter | ||
// see: https://typescript-eslint.io/rules/no-invalid-void-type/ | ||
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type | ||
const { promise: published, resolve } = (0, | ||
promiseWithResolvers_js_1.promiseWithResolvers)(); | ||
this.published = published; | ||
this.publish = () => { | ||
resolve(); | ||
this.published = true; | ||
}; | ||
this.sent = false; | ||
} | ||
} | ||
exports.StreamItemsRecord = StreamItemsRecord; |
{ | ||
"name": "graphql", | ||
"version": "17.0.0-alpha.2.canary.pr.3911.a281faf70fee4ba1522af45cf15f41a899c723c4", | ||
"version": "17.0.0-alpha.2.canary.pr.3937.8e773a04d8041ffc00a1550e8c6688e01ba11832", | ||
"description": "A Query Language and Runtime which can target any service.", | ||
@@ -35,7 +35,7 @@ "license": "MIT", | ||
"publishConfig": { | ||
"tag": "canary-pr-3911" | ||
"tag": "canary-pr-3937" | ||
}, | ||
"main": "index", | ||
"module": "index.mjs", | ||
"deprecated": "You are using canary version build from https://github.com/graphql/graphql-js/pull/3911, no gurantees provided so please use your own discretion." | ||
"deprecated": "You are using canary version build from https://github.com/graphql/graphql-js/pull/3937, no gurantees provided so please use your own discretion." | ||
} |
@@ -457,15 +457,5 @@ import type { Maybe } from '../jsutils/Maybe.js'; | ||
) => TResult; | ||
export interface DeferUsage { | ||
label: string | undefined; | ||
ancestors: ReadonlyArray<Target>; | ||
deferPriority: number; | ||
} | ||
export type Target = DeferUsage | undefined; | ||
export interface FieldDetails { | ||
node: FieldNode; | ||
target: Target; | ||
} | ||
export interface GraphQLResolveInfo { | ||
readonly fieldName: string; | ||
readonly fieldDetails: ReadonlyArray<FieldDetails>; | ||
readonly fieldNodes: ReadonlyArray<FieldNode>; | ||
readonly returnType: GraphQLOutputType; | ||
@@ -481,5 +471,2 @@ readonly parentType: GraphQLObjectType; | ||
}; | ||
readonly priority: number; | ||
readonly deferPriority: number; | ||
readonly published: true | Promise<void>; | ||
} | ||
@@ -486,0 +473,0 @@ /** |
@@ -88,3 +88,3 @@ import type { Maybe } from '../jsutils/Maybe.js'; | ||
/** | ||
* Used to declare an Input Object as a OneOf Input Objects. | ||
* Used to indicate an Input Object is a OneOf Input Object. | ||
*/ | ||
@@ -91,0 +91,0 @@ export declare const GraphQLOneOfDirective: GraphQLDirective; |
@@ -205,7 +205,8 @@ 'use strict'; | ||
/** | ||
* Used to declare an Input Object as a OneOf Input Objects. | ||
* Used to indicate an Input Object is a OneOf Input Object. | ||
*/ | ||
exports.GraphQLOneOfDirective = new GraphQLDirective({ | ||
name: 'oneOf', | ||
description: 'Indicates an Input Object is a OneOf Input Object.', | ||
description: | ||
'Indicates exactly one field must be supplied and this field must not be `null`.', | ||
locations: [directiveLocation_js_1.DirectiveLocation.INPUT_OBJECT], | ||
@@ -212,0 +213,0 @@ args: {}, |
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
1429997
44176