graphql 17.0.0-alpha.8 → 17.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -10
- package/__dev__/devMode.d.mts +1 -0
- package/__dev__/devMode.d.ts +1 -0
- package/__dev__/devMode.js +3 -0
- package/__dev__/devMode.mjs +3 -0
- package/__dev__/error/GraphQLError.d.mts +1 -0
- package/__dev__/error/GraphQLError.d.ts +1 -0
- package/__dev__/error/GraphQLError.js +3 -0
- package/__dev__/error/GraphQLError.mjs +3 -0
- package/__dev__/error/ensureGraphQLError.d.mts +1 -0
- package/__dev__/error/ensureGraphQLError.d.ts +1 -0
- package/__dev__/error/ensureGraphQLError.js +3 -0
- package/__dev__/error/ensureGraphQLError.mjs +3 -0
- package/__dev__/error/index.d.mts +1 -0
- package/__dev__/error/index.d.ts +1 -0
- package/__dev__/error/index.js +3 -0
- package/__dev__/error/index.mjs +3 -0
- package/__dev__/error/locatedError.d.mts +1 -0
- package/__dev__/error/locatedError.d.ts +1 -0
- package/__dev__/error/locatedError.js +3 -0
- package/__dev__/error/locatedError.mjs +3 -0
- package/__dev__/error/syntaxError.d.mts +1 -0
- package/__dev__/error/syntaxError.d.ts +1 -0
- package/__dev__/error/syntaxError.js +3 -0
- package/__dev__/error/syntaxError.mjs +3 -0
- package/__dev__/execution/AbortedGraphQLExecutionError.d.mts +1 -0
- package/__dev__/execution/AbortedGraphQLExecutionError.d.ts +1 -0
- package/__dev__/execution/AbortedGraphQLExecutionError.js +3 -0
- package/__dev__/execution/AbortedGraphQLExecutionError.mjs +3 -0
- package/__dev__/execution/AsyncWorkTracker.d.mts +1 -0
- package/__dev__/execution/AsyncWorkTracker.d.ts +1 -0
- package/__dev__/execution/AsyncWorkTracker.js +3 -0
- package/__dev__/execution/AsyncWorkTracker.mjs +3 -0
- package/__dev__/execution/Executor.d.mts +1 -0
- package/__dev__/execution/Executor.d.ts +1 -0
- package/__dev__/execution/Executor.js +3 -0
- package/__dev__/execution/Executor.mjs +3 -0
- package/__dev__/execution/ExecutorThrowingOnIncremental.d.mts +1 -0
- package/__dev__/execution/ExecutorThrowingOnIncremental.d.ts +1 -0
- package/__dev__/execution/ExecutorThrowingOnIncremental.js +3 -0
- package/__dev__/execution/ExecutorThrowingOnIncremental.mjs +3 -0
- package/__dev__/execution/cancellablePromise.d.mts +1 -0
- package/__dev__/execution/cancellablePromise.d.ts +1 -0
- package/__dev__/execution/cancellablePromise.js +3 -0
- package/__dev__/execution/cancellablePromise.mjs +3 -0
- package/__dev__/execution/collectFields.d.mts +1 -0
- package/__dev__/execution/collectFields.d.ts +1 -0
- package/__dev__/execution/collectFields.js +3 -0
- package/__dev__/execution/collectFields.mjs +3 -0
- package/__dev__/execution/collectIteratorPromises.d.mts +1 -0
- package/__dev__/execution/collectIteratorPromises.d.ts +1 -0
- package/__dev__/execution/collectIteratorPromises.js +3 -0
- package/__dev__/execution/collectIteratorPromises.mjs +3 -0
- package/__dev__/execution/createSharedExecutionContext.d.mts +1 -0
- package/__dev__/execution/createSharedExecutionContext.d.ts +1 -0
- package/__dev__/execution/createSharedExecutionContext.js +3 -0
- package/__dev__/execution/createSharedExecutionContext.mjs +3 -0
- package/__dev__/execution/execute.d.mts +1 -0
- package/__dev__/execution/execute.d.ts +1 -0
- package/__dev__/execution/execute.js +3 -0
- package/__dev__/execution/execute.mjs +3 -0
- package/__dev__/execution/getStreamUsage.d.mts +1 -0
- package/__dev__/execution/getStreamUsage.d.ts +1 -0
- package/__dev__/execution/getStreamUsage.js +3 -0
- package/__dev__/execution/getStreamUsage.mjs +3 -0
- package/__dev__/execution/getVariableSignature.d.mts +1 -0
- package/__dev__/execution/getVariableSignature.d.ts +1 -0
- package/__dev__/execution/getVariableSignature.js +3 -0
- package/__dev__/execution/getVariableSignature.mjs +3 -0
- package/__dev__/execution/hooks.d.mts +1 -0
- package/__dev__/execution/hooks.d.ts +1 -0
- package/__dev__/execution/hooks.js +3 -0
- package/__dev__/execution/hooks.mjs +3 -0
- package/__dev__/execution/incremental/Computation.d.mts +1 -0
- package/__dev__/execution/incremental/Computation.d.ts +1 -0
- package/__dev__/execution/incremental/Computation.js +3 -0
- package/__dev__/execution/incremental/Computation.mjs +3 -0
- package/__dev__/execution/incremental/IncrementalExecutor.d.mts +1 -0
- package/__dev__/execution/incremental/IncrementalExecutor.d.ts +1 -0
- package/__dev__/execution/incremental/IncrementalExecutor.js +3 -0
- package/__dev__/execution/incremental/IncrementalExecutor.mjs +3 -0
- package/__dev__/execution/incremental/IncrementalPublisher.d.mts +1 -0
- package/__dev__/execution/incremental/IncrementalPublisher.d.ts +1 -0
- package/__dev__/execution/incremental/IncrementalPublisher.js +3 -0
- package/__dev__/execution/incremental/IncrementalPublisher.mjs +3 -0
- package/__dev__/execution/incremental/Queue.d.mts +1 -0
- package/__dev__/execution/incremental/Queue.d.ts +1 -0
- package/__dev__/execution/incremental/Queue.js +3 -0
- package/__dev__/execution/incremental/Queue.mjs +3 -0
- package/__dev__/execution/incremental/WorkQueue.d.mts +1 -0
- package/__dev__/execution/incremental/WorkQueue.d.ts +1 -0
- package/__dev__/execution/incremental/WorkQueue.js +3 -0
- package/__dev__/execution/incremental/WorkQueue.mjs +3 -0
- package/__dev__/execution/incremental/buildExecutionPlan.d.mts +1 -0
- package/__dev__/execution/incremental/buildExecutionPlan.d.ts +1 -0
- package/__dev__/execution/incremental/buildExecutionPlan.js +3 -0
- package/__dev__/execution/incremental/buildExecutionPlan.mjs +3 -0
- package/__dev__/execution/index.d.mts +1 -0
- package/__dev__/execution/index.d.ts +1 -0
- package/__dev__/execution/index.js +3 -0
- package/__dev__/execution/index.mjs +3 -0
- package/__dev__/execution/mapAsyncIterable.d.mts +1 -0
- package/__dev__/execution/mapAsyncIterable.d.ts +1 -0
- package/__dev__/execution/mapAsyncIterable.js +3 -0
- package/__dev__/execution/mapAsyncIterable.mjs +3 -0
- package/__dev__/execution/returnIteratorCatchingErrors.d.mts +1 -0
- package/__dev__/execution/returnIteratorCatchingErrors.d.ts +1 -0
- package/__dev__/execution/returnIteratorCatchingErrors.js +3 -0
- package/__dev__/execution/returnIteratorCatchingErrors.mjs +3 -0
- package/__dev__/execution/values.d.mts +1 -0
- package/__dev__/execution/values.d.ts +1 -0
- package/__dev__/execution/values.js +3 -0
- package/__dev__/execution/values.mjs +3 -0
- package/__dev__/execution/withConcurrentAbruptClose.d.mts +1 -0
- package/__dev__/execution/withConcurrentAbruptClose.d.ts +1 -0
- package/__dev__/execution/withConcurrentAbruptClose.js +3 -0
- package/__dev__/execution/withConcurrentAbruptClose.mjs +3 -0
- package/__dev__/graphql.d.mts +1 -0
- package/__dev__/graphql.d.ts +1 -0
- package/__dev__/graphql.js +3 -0
- package/__dev__/graphql.mjs +3 -0
- package/__dev__/harness.d.mts +1 -0
- package/__dev__/harness.d.ts +1 -0
- package/__dev__/harness.js +3 -0
- package/__dev__/harness.mjs +3 -0
- package/__dev__/index.d.mts +1 -0
- package/__dev__/index.d.ts +1 -0
- package/__dev__/index.js +3 -0
- package/__dev__/index.mjs +3 -0
- package/__dev__/jsutils/AccumulatorMap.d.mts +1 -0
- package/__dev__/jsutils/AccumulatorMap.d.ts +1 -0
- package/__dev__/jsutils/AccumulatorMap.js +3 -0
- package/__dev__/jsutils/AccumulatorMap.mjs +3 -0
- package/__dev__/jsutils/Maybe.d.mts +1 -0
- package/__dev__/jsutils/Maybe.d.ts +1 -0
- package/__dev__/jsutils/Maybe.js +3 -0
- package/__dev__/jsutils/Maybe.mjs +3 -0
- package/__dev__/jsutils/ObjMap.d.mts +1 -0
- package/__dev__/jsutils/ObjMap.d.ts +1 -0
- package/__dev__/jsutils/ObjMap.js +3 -0
- package/__dev__/jsutils/ObjMap.mjs +3 -0
- package/__dev__/jsutils/Path.d.mts +1 -0
- package/__dev__/jsutils/Path.d.ts +1 -0
- package/__dev__/jsutils/Path.js +3 -0
- package/__dev__/jsutils/Path.mjs +3 -0
- package/__dev__/jsutils/PromiseOrValue.d.mts +1 -0
- package/__dev__/jsutils/PromiseOrValue.d.ts +1 -0
- package/__dev__/jsutils/PromiseOrValue.js +3 -0
- package/__dev__/jsutils/PromiseOrValue.mjs +3 -0
- package/__dev__/jsutils/capitalize.d.mts +1 -0
- package/__dev__/jsutils/capitalize.d.ts +1 -0
- package/__dev__/jsutils/capitalize.js +3 -0
- package/__dev__/jsutils/capitalize.mjs +3 -0
- package/__dev__/jsutils/devAssert.d.mts +1 -0
- package/__dev__/jsutils/devAssert.d.ts +1 -0
- package/__dev__/jsutils/devAssert.js +3 -0
- package/__dev__/jsutils/devAssert.mjs +3 -0
- package/__dev__/jsutils/didYouMean.d.mts +1 -0
- package/__dev__/jsutils/didYouMean.d.ts +1 -0
- package/__dev__/jsutils/didYouMean.js +3 -0
- package/__dev__/jsutils/didYouMean.mjs +3 -0
- package/__dev__/jsutils/formatList.d.mts +1 -0
- package/__dev__/jsutils/formatList.d.ts +1 -0
- package/__dev__/jsutils/formatList.js +3 -0
- package/__dev__/jsutils/formatList.mjs +3 -0
- package/__dev__/jsutils/getBySet.d.mts +1 -0
- package/__dev__/jsutils/getBySet.d.ts +1 -0
- package/__dev__/jsutils/getBySet.js +3 -0
- package/__dev__/jsutils/getBySet.mjs +3 -0
- package/__dev__/jsutils/groupBy.d.mts +1 -0
- package/__dev__/jsutils/groupBy.d.ts +1 -0
- package/__dev__/jsutils/groupBy.js +3 -0
- package/__dev__/jsutils/groupBy.mjs +3 -0
- package/__dev__/jsutils/identityFunc.d.mts +1 -0
- package/__dev__/jsutils/identityFunc.d.ts +1 -0
- package/__dev__/jsutils/identityFunc.js +3 -0
- package/__dev__/jsutils/identityFunc.mjs +3 -0
- package/__dev__/jsutils/inspect.d.mts +1 -0
- package/__dev__/jsutils/inspect.d.ts +1 -0
- package/__dev__/jsutils/inspect.js +3 -0
- package/__dev__/jsutils/inspect.mjs +3 -0
- package/__dev__/jsutils/instanceOf.d.mts +1 -0
- package/__dev__/jsutils/instanceOf.d.ts +1 -0
- package/__dev__/jsutils/instanceOf.js +3 -0
- package/__dev__/jsutils/instanceOf.mjs +3 -0
- package/__dev__/jsutils/invariant.d.mts +1 -0
- package/__dev__/jsutils/invariant.d.ts +1 -0
- package/__dev__/jsutils/invariant.js +3 -0
- package/__dev__/jsutils/invariant.mjs +3 -0
- package/__dev__/jsutils/isAsyncIterable.d.mts +1 -0
- package/__dev__/jsutils/isAsyncIterable.d.ts +1 -0
- package/__dev__/jsutils/isAsyncIterable.js +3 -0
- package/__dev__/jsutils/isAsyncIterable.mjs +3 -0
- package/__dev__/jsutils/isIterableObject.d.mts +1 -0
- package/__dev__/jsutils/isIterableObject.d.ts +1 -0
- package/__dev__/jsutils/isIterableObject.js +3 -0
- package/__dev__/jsutils/isIterableObject.mjs +3 -0
- package/__dev__/jsutils/isObjectLike.d.mts +1 -0
- package/__dev__/jsutils/isObjectLike.d.ts +1 -0
- package/__dev__/jsutils/isObjectLike.js +3 -0
- package/__dev__/jsutils/isObjectLike.mjs +3 -0
- package/__dev__/jsutils/isPromise.d.mts +1 -0
- package/__dev__/jsutils/isPromise.d.ts +1 -0
- package/__dev__/jsutils/isPromise.js +3 -0
- package/__dev__/jsutils/isPromise.mjs +3 -0
- package/__dev__/jsutils/isSameSet.d.mts +1 -0
- package/__dev__/jsutils/isSameSet.d.ts +1 -0
- package/__dev__/jsutils/isSameSet.js +3 -0
- package/__dev__/jsutils/isSameSet.mjs +3 -0
- package/__dev__/jsutils/keyMap.d.mts +1 -0
- package/__dev__/jsutils/keyMap.d.ts +1 -0
- package/__dev__/jsutils/keyMap.js +3 -0
- package/__dev__/jsutils/keyMap.mjs +3 -0
- package/__dev__/jsutils/keyValMap.d.mts +1 -0
- package/__dev__/jsutils/keyValMap.d.ts +1 -0
- package/__dev__/jsutils/keyValMap.js +3 -0
- package/__dev__/jsutils/keyValMap.mjs +3 -0
- package/__dev__/jsutils/mapValue.d.mts +1 -0
- package/__dev__/jsutils/mapValue.d.ts +1 -0
- package/__dev__/jsutils/mapValue.js +3 -0
- package/__dev__/jsutils/mapValue.mjs +3 -0
- package/__dev__/jsutils/memoize1.d.mts +1 -0
- package/__dev__/jsutils/memoize1.d.ts +1 -0
- package/__dev__/jsutils/memoize1.js +3 -0
- package/__dev__/jsutils/memoize1.mjs +3 -0
- package/__dev__/jsutils/memoize2.d.mts +1 -0
- package/__dev__/jsutils/memoize2.d.ts +1 -0
- package/__dev__/jsutils/memoize2.js +3 -0
- package/__dev__/jsutils/memoize2.mjs +3 -0
- package/__dev__/jsutils/memoize3.d.mts +1 -0
- package/__dev__/jsutils/memoize3.d.ts +1 -0
- package/__dev__/jsutils/memoize3.js +3 -0
- package/__dev__/jsutils/memoize3.mjs +3 -0
- package/__dev__/jsutils/naturalCompare.d.mts +1 -0
- package/__dev__/jsutils/naturalCompare.d.ts +1 -0
- package/__dev__/jsutils/naturalCompare.js +3 -0
- package/__dev__/jsutils/naturalCompare.mjs +3 -0
- package/__dev__/jsutils/printPathArray.d.mts +1 -0
- package/__dev__/jsutils/printPathArray.d.ts +1 -0
- package/__dev__/jsutils/printPathArray.js +3 -0
- package/__dev__/jsutils/printPathArray.mjs +3 -0
- package/__dev__/jsutils/promiseForObject.d.mts +1 -0
- package/__dev__/jsutils/promiseForObject.d.ts +1 -0
- package/__dev__/jsutils/promiseForObject.js +3 -0
- package/__dev__/jsutils/promiseForObject.mjs +3 -0
- package/__dev__/jsutils/promiseReduce.d.mts +1 -0
- package/__dev__/jsutils/promiseReduce.d.ts +1 -0
- package/__dev__/jsutils/promiseReduce.js +3 -0
- package/__dev__/jsutils/promiseReduce.mjs +3 -0
- package/__dev__/jsutils/promiseWithResolvers.d.mts +1 -0
- package/__dev__/jsutils/promiseWithResolvers.d.ts +1 -0
- package/__dev__/jsutils/promiseWithResolvers.js +3 -0
- package/__dev__/jsutils/promiseWithResolvers.mjs +3 -0
- package/__dev__/jsutils/suggestionList.d.mts +1 -0
- package/__dev__/jsutils/suggestionList.d.ts +1 -0
- package/__dev__/jsutils/suggestionList.js +3 -0
- package/__dev__/jsutils/suggestionList.mjs +3 -0
- package/__dev__/jsutils/toError.d.mts +1 -0
- package/__dev__/jsutils/toError.d.ts +1 -0
- package/__dev__/jsutils/toError.js +3 -0
- package/__dev__/jsutils/toError.mjs +3 -0
- package/__dev__/jsutils/toObjMap.d.mts +1 -0
- package/__dev__/jsutils/toObjMap.d.ts +1 -0
- package/__dev__/jsutils/toObjMap.js +3 -0
- package/__dev__/jsutils/toObjMap.mjs +3 -0
- package/__dev__/language/KindTypeMap.d.mts +1 -0
- package/__dev__/language/KindTypeMap.d.ts +1 -0
- package/__dev__/language/KindTypeMap.js +3 -0
- package/__dev__/language/KindTypeMap.mjs +3 -0
- package/__dev__/language/ast.d.mts +1 -0
- package/__dev__/language/ast.d.ts +1 -0
- package/__dev__/language/ast.js +3 -0
- package/__dev__/language/ast.mjs +3 -0
- package/__dev__/language/blockString.d.mts +1 -0
- package/__dev__/language/blockString.d.ts +1 -0
- package/__dev__/language/blockString.js +3 -0
- package/__dev__/language/blockString.mjs +3 -0
- package/__dev__/language/characterClasses.d.mts +1 -0
- package/__dev__/language/characterClasses.d.ts +1 -0
- package/__dev__/language/characterClasses.js +3 -0
- package/__dev__/language/characterClasses.mjs +3 -0
- package/__dev__/language/directiveLocation.d.mts +1 -0
- package/__dev__/language/directiveLocation.d.ts +1 -0
- package/__dev__/language/directiveLocation.js +3 -0
- package/__dev__/language/directiveLocation.mjs +3 -0
- package/__dev__/language/index.d.mts +1 -0
- package/__dev__/language/index.d.ts +1 -0
- package/__dev__/language/index.js +3 -0
- package/__dev__/language/index.mjs +3 -0
- package/__dev__/language/kinds.d.mts +1 -0
- package/__dev__/language/kinds.d.ts +1 -0
- package/__dev__/language/kinds.js +3 -0
- package/__dev__/language/kinds.mjs +3 -0
- package/__dev__/language/kinds_.d.mts +1 -0
- package/__dev__/language/kinds_.d.ts +1 -0
- package/__dev__/language/kinds_.js +3 -0
- package/__dev__/language/kinds_.mjs +3 -0
- package/__dev__/language/lexer.d.mts +1 -0
- package/__dev__/language/lexer.d.ts +1 -0
- package/__dev__/language/lexer.js +3 -0
- package/__dev__/language/lexer.mjs +3 -0
- package/__dev__/language/location.d.mts +1 -0
- package/__dev__/language/location.d.ts +1 -0
- package/__dev__/language/location.js +3 -0
- package/__dev__/language/location.mjs +3 -0
- package/__dev__/language/parser.d.mts +1 -0
- package/__dev__/language/parser.d.ts +1 -0
- package/__dev__/language/parser.js +3 -0
- package/__dev__/language/parser.mjs +3 -0
- package/__dev__/language/predicates.d.mts +1 -0
- package/__dev__/language/predicates.d.ts +1 -0
- package/__dev__/language/predicates.js +3 -0
- package/__dev__/language/predicates.mjs +3 -0
- package/__dev__/language/printLocation.d.mts +1 -0
- package/__dev__/language/printLocation.d.ts +1 -0
- package/__dev__/language/printLocation.js +3 -0
- package/__dev__/language/printLocation.mjs +3 -0
- package/__dev__/language/printString.d.mts +1 -0
- package/__dev__/language/printString.d.ts +1 -0
- package/__dev__/language/printString.js +3 -0
- package/__dev__/language/printString.mjs +3 -0
- package/__dev__/language/printer.d.mts +1 -0
- package/__dev__/language/printer.d.ts +1 -0
- package/__dev__/language/printer.js +3 -0
- package/__dev__/language/printer.mjs +3 -0
- package/__dev__/language/schemaCoordinateLexer.d.mts +1 -0
- package/__dev__/language/schemaCoordinateLexer.d.ts +1 -0
- package/__dev__/language/schemaCoordinateLexer.js +3 -0
- package/__dev__/language/schemaCoordinateLexer.mjs +3 -0
- package/__dev__/language/source.d.mts +1 -0
- package/__dev__/language/source.d.ts +1 -0
- package/__dev__/language/source.js +3 -0
- package/__dev__/language/source.mjs +3 -0
- package/__dev__/language/tokenKind.d.mts +1 -0
- package/__dev__/language/tokenKind.d.ts +1 -0
- package/__dev__/language/tokenKind.js +3 -0
- package/__dev__/language/tokenKind.mjs +3 -0
- package/__dev__/language/visitor.d.mts +1 -0
- package/__dev__/language/visitor.d.ts +1 -0
- package/__dev__/language/visitor.js +3 -0
- package/__dev__/language/visitor.mjs +3 -0
- package/__dev__/type/assertName.d.mts +1 -0
- package/__dev__/type/assertName.d.ts +1 -0
- package/__dev__/type/assertName.js +3 -0
- package/__dev__/type/assertName.mjs +3 -0
- package/__dev__/type/definition.d.mts +1 -0
- package/__dev__/type/definition.d.ts +1 -0
- package/__dev__/type/definition.js +3 -0
- package/__dev__/type/definition.mjs +3 -0
- package/__dev__/type/directives.d.mts +1 -0
- package/__dev__/type/directives.d.ts +1 -0
- package/__dev__/type/directives.js +3 -0
- package/__dev__/type/directives.mjs +3 -0
- package/__dev__/type/index.d.mts +1 -0
- package/__dev__/type/index.d.ts +1 -0
- package/__dev__/type/index.js +3 -0
- package/__dev__/type/index.mjs +3 -0
- package/__dev__/type/introspection.d.mts +1 -0
- package/__dev__/type/introspection.d.ts +1 -0
- package/__dev__/type/introspection.js +3 -0
- package/__dev__/type/introspection.mjs +3 -0
- package/__dev__/type/scalars.d.mts +1 -0
- package/__dev__/type/scalars.d.ts +1 -0
- package/__dev__/type/scalars.js +3 -0
- package/__dev__/type/scalars.mjs +3 -0
- package/__dev__/type/schema.d.mts +1 -0
- package/__dev__/type/schema.d.ts +1 -0
- package/__dev__/type/schema.js +3 -0
- package/__dev__/type/schema.mjs +3 -0
- package/__dev__/type/validate.d.mts +1 -0
- package/__dev__/type/validate.d.ts +1 -0
- package/__dev__/type/validate.js +3 -0
- package/__dev__/type/validate.mjs +3 -0
- package/__dev__/utilities/TypeInfo.d.mts +1 -0
- package/__dev__/utilities/TypeInfo.d.ts +1 -0
- package/__dev__/utilities/TypeInfo.js +3 -0
- package/__dev__/utilities/TypeInfo.mjs +3 -0
- package/__dev__/utilities/astFromValue.d.mts +1 -0
- package/__dev__/utilities/astFromValue.d.ts +1 -0
- package/__dev__/utilities/astFromValue.js +3 -0
- package/__dev__/utilities/astFromValue.mjs +3 -0
- package/__dev__/utilities/buildASTSchema.d.mts +1 -0
- package/__dev__/utilities/buildASTSchema.d.ts +1 -0
- package/__dev__/utilities/buildASTSchema.js +3 -0
- package/__dev__/utilities/buildASTSchema.mjs +3 -0
- package/__dev__/utilities/buildClientSchema.d.mts +1 -0
- package/__dev__/utilities/buildClientSchema.d.ts +1 -0
- package/__dev__/utilities/buildClientSchema.js +3 -0
- package/__dev__/utilities/buildClientSchema.mjs +3 -0
- package/__dev__/utilities/coerceInputValue.d.mts +1 -0
- package/__dev__/utilities/coerceInputValue.d.ts +1 -0
- package/__dev__/utilities/coerceInputValue.js +3 -0
- package/__dev__/utilities/coerceInputValue.mjs +3 -0
- package/__dev__/utilities/concatAST.d.mts +1 -0
- package/__dev__/utilities/concatAST.d.ts +1 -0
- package/__dev__/utilities/concatAST.js +3 -0
- package/__dev__/utilities/concatAST.mjs +3 -0
- package/__dev__/utilities/extendSchema.d.mts +1 -0
- package/__dev__/utilities/extendSchema.d.ts +1 -0
- package/__dev__/utilities/extendSchema.js +3 -0
- package/__dev__/utilities/extendSchema.mjs +3 -0
- package/__dev__/utilities/findSchemaChanges.d.mts +1 -0
- package/__dev__/utilities/findSchemaChanges.d.ts +1 -0
- package/__dev__/utilities/findSchemaChanges.js +3 -0
- package/__dev__/utilities/findSchemaChanges.mjs +3 -0
- package/__dev__/utilities/getDefaultValueAST.d.mts +1 -0
- package/__dev__/utilities/getDefaultValueAST.d.ts +1 -0
- package/__dev__/utilities/getDefaultValueAST.js +3 -0
- package/__dev__/utilities/getDefaultValueAST.mjs +3 -0
- package/__dev__/utilities/getIntrospectionQuery.d.mts +1 -0
- package/__dev__/utilities/getIntrospectionQuery.d.ts +1 -0
- package/__dev__/utilities/getIntrospectionQuery.js +3 -0
- package/__dev__/utilities/getIntrospectionQuery.mjs +3 -0
- package/__dev__/utilities/getOperationAST.d.mts +1 -0
- package/__dev__/utilities/getOperationAST.d.ts +1 -0
- package/__dev__/utilities/getOperationAST.js +3 -0
- package/__dev__/utilities/getOperationAST.mjs +3 -0
- package/__dev__/utilities/index.d.mts +1 -0
- package/__dev__/utilities/index.d.ts +1 -0
- package/__dev__/utilities/index.js +3 -0
- package/__dev__/utilities/index.mjs +3 -0
- package/__dev__/utilities/introspectionFromSchema.d.mts +1 -0
- package/__dev__/utilities/introspectionFromSchema.d.ts +1 -0
- package/__dev__/utilities/introspectionFromSchema.js +3 -0
- package/__dev__/utilities/introspectionFromSchema.mjs +3 -0
- package/__dev__/utilities/lexicographicSortSchema.d.mts +1 -0
- package/__dev__/utilities/lexicographicSortSchema.d.ts +1 -0
- package/__dev__/utilities/lexicographicSortSchema.js +3 -0
- package/__dev__/utilities/lexicographicSortSchema.mjs +3 -0
- package/__dev__/utilities/mapSchemaConfig.d.mts +1 -0
- package/__dev__/utilities/mapSchemaConfig.d.ts +1 -0
- package/__dev__/utilities/mapSchemaConfig.js +3 -0
- package/__dev__/utilities/mapSchemaConfig.mjs +3 -0
- package/__dev__/utilities/printSchema.d.mts +1 -0
- package/__dev__/utilities/printSchema.d.ts +1 -0
- package/__dev__/utilities/printSchema.js +3 -0
- package/__dev__/utilities/printSchema.mjs +3 -0
- package/__dev__/utilities/replaceVariables.d.mts +1 -0
- package/__dev__/utilities/replaceVariables.d.ts +1 -0
- package/__dev__/utilities/replaceVariables.js +3 -0
- package/__dev__/utilities/replaceVariables.mjs +3 -0
- package/__dev__/utilities/resolveSchemaCoordinate.d.mts +1 -0
- package/__dev__/utilities/resolveSchemaCoordinate.d.ts +1 -0
- package/__dev__/utilities/resolveSchemaCoordinate.js +3 -0
- package/__dev__/utilities/resolveSchemaCoordinate.mjs +3 -0
- package/__dev__/utilities/separateOperations.d.mts +1 -0
- package/__dev__/utilities/separateOperations.d.ts +1 -0
- package/__dev__/utilities/separateOperations.js +3 -0
- package/__dev__/utilities/separateOperations.mjs +3 -0
- package/__dev__/utilities/sortValueNode.d.mts +1 -0
- package/__dev__/utilities/sortValueNode.d.ts +1 -0
- package/__dev__/utilities/sortValueNode.js +3 -0
- package/__dev__/utilities/sortValueNode.mjs +3 -0
- package/__dev__/utilities/stripIgnoredCharacters.d.mts +1 -0
- package/__dev__/utilities/stripIgnoredCharacters.d.ts +1 -0
- package/__dev__/utilities/stripIgnoredCharacters.js +3 -0
- package/__dev__/utilities/stripIgnoredCharacters.mjs +3 -0
- package/__dev__/utilities/typeComparators.d.mts +1 -0
- package/__dev__/utilities/typeComparators.d.ts +1 -0
- package/__dev__/utilities/typeComparators.js +3 -0
- package/__dev__/utilities/typeComparators.mjs +3 -0
- package/__dev__/utilities/typeFromAST.d.mts +1 -0
- package/__dev__/utilities/typeFromAST.d.ts +1 -0
- package/__dev__/utilities/typeFromAST.js +3 -0
- package/__dev__/utilities/typeFromAST.mjs +3 -0
- package/__dev__/utilities/typedQueryDocumentNode.d.mts +1 -0
- package/__dev__/utilities/typedQueryDocumentNode.d.ts +1 -0
- package/__dev__/utilities/typedQueryDocumentNode.js +3 -0
- package/__dev__/utilities/typedQueryDocumentNode.mjs +3 -0
- package/__dev__/utilities/validateInputValue.d.mts +1 -0
- package/__dev__/utilities/validateInputValue.d.ts +1 -0
- package/__dev__/utilities/validateInputValue.js +3 -0
- package/__dev__/utilities/validateInputValue.mjs +3 -0
- package/__dev__/utilities/valueFromAST.d.mts +1 -0
- package/__dev__/utilities/valueFromAST.d.ts +1 -0
- package/__dev__/utilities/valueFromAST.js +3 -0
- package/__dev__/utilities/valueFromAST.mjs +3 -0
- package/__dev__/utilities/valueFromASTUntyped.d.mts +1 -0
- package/__dev__/utilities/valueFromASTUntyped.d.ts +1 -0
- package/__dev__/utilities/valueFromASTUntyped.js +3 -0
- package/__dev__/utilities/valueFromASTUntyped.mjs +3 -0
- package/__dev__/utilities/valueToLiteral.d.mts +1 -0
- package/__dev__/utilities/valueToLiteral.d.ts +1 -0
- package/__dev__/utilities/valueToLiteral.js +3 -0
- package/__dev__/utilities/valueToLiteral.mjs +3 -0
- package/__dev__/validation/ValidationContext.d.mts +1 -0
- package/__dev__/validation/ValidationContext.d.ts +1 -0
- package/__dev__/validation/ValidationContext.js +3 -0
- package/__dev__/validation/ValidationContext.mjs +3 -0
- package/__dev__/validation/index.d.mts +1 -0
- package/__dev__/validation/index.d.ts +1 -0
- package/__dev__/validation/index.js +3 -0
- package/__dev__/validation/index.mjs +3 -0
- package/__dev__/validation/rules/DeferStreamDirectiveLabelRule.d.mts +1 -0
- package/__dev__/validation/rules/DeferStreamDirectiveLabelRule.d.ts +1 -0
- package/__dev__/validation/rules/DeferStreamDirectiveLabelRule.js +3 -0
- package/__dev__/validation/rules/DeferStreamDirectiveLabelRule.mjs +3 -0
- package/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.mts +1 -0
- package/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.ts +1 -0
- package/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.js +3 -0
- package/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs +3 -0
- package/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.mts +1 -0
- package/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.ts +1 -0
- package/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.js +3 -0
- package/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs +3 -0
- package/__dev__/validation/rules/ExecutableDefinitionsRule.d.mts +1 -0
- package/__dev__/validation/rules/ExecutableDefinitionsRule.d.ts +1 -0
- package/__dev__/validation/rules/ExecutableDefinitionsRule.js +3 -0
- package/__dev__/validation/rules/ExecutableDefinitionsRule.mjs +3 -0
- package/__dev__/validation/rules/FieldsOnCorrectTypeRule.d.mts +1 -0
- package/__dev__/validation/rules/FieldsOnCorrectTypeRule.d.ts +1 -0
- package/__dev__/validation/rules/FieldsOnCorrectTypeRule.js +3 -0
- package/__dev__/validation/rules/FieldsOnCorrectTypeRule.mjs +3 -0
- package/__dev__/validation/rules/FragmentsOnCompositeTypesRule.d.mts +1 -0
- package/__dev__/validation/rules/FragmentsOnCompositeTypesRule.d.ts +1 -0
- package/__dev__/validation/rules/FragmentsOnCompositeTypesRule.js +3 -0
- package/__dev__/validation/rules/FragmentsOnCompositeTypesRule.mjs +3 -0
- package/__dev__/validation/rules/KnownArgumentNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/KnownArgumentNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/KnownArgumentNamesRule.js +3 -0
- package/__dev__/validation/rules/KnownArgumentNamesRule.mjs +3 -0
- package/__dev__/validation/rules/KnownDirectivesRule.d.mts +1 -0
- package/__dev__/validation/rules/KnownDirectivesRule.d.ts +1 -0
- package/__dev__/validation/rules/KnownDirectivesRule.js +3 -0
- package/__dev__/validation/rules/KnownDirectivesRule.mjs +3 -0
- package/__dev__/validation/rules/KnownFragmentNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/KnownFragmentNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/KnownFragmentNamesRule.js +3 -0
- package/__dev__/validation/rules/KnownFragmentNamesRule.mjs +3 -0
- package/__dev__/validation/rules/KnownOperationTypesRule.d.mts +1 -0
- package/__dev__/validation/rules/KnownOperationTypesRule.d.ts +1 -0
- package/__dev__/validation/rules/KnownOperationTypesRule.js +3 -0
- package/__dev__/validation/rules/KnownOperationTypesRule.mjs +3 -0
- package/__dev__/validation/rules/KnownTypeNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/KnownTypeNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/KnownTypeNamesRule.js +3 -0
- package/__dev__/validation/rules/KnownTypeNamesRule.mjs +3 -0
- package/__dev__/validation/rules/LoneAnonymousOperationRule.d.mts +1 -0
- package/__dev__/validation/rules/LoneAnonymousOperationRule.d.ts +1 -0
- package/__dev__/validation/rules/LoneAnonymousOperationRule.js +3 -0
- package/__dev__/validation/rules/LoneAnonymousOperationRule.mjs +3 -0
- package/__dev__/validation/rules/LoneSchemaDefinitionRule.d.mts +1 -0
- package/__dev__/validation/rules/LoneSchemaDefinitionRule.d.ts +1 -0
- package/__dev__/validation/rules/LoneSchemaDefinitionRule.js +3 -0
- package/__dev__/validation/rules/LoneSchemaDefinitionRule.mjs +3 -0
- package/__dev__/validation/rules/MaxIntrospectionDepthRule.d.mts +1 -0
- package/__dev__/validation/rules/MaxIntrospectionDepthRule.d.ts +1 -0
- package/__dev__/validation/rules/MaxIntrospectionDepthRule.js +3 -0
- package/__dev__/validation/rules/MaxIntrospectionDepthRule.mjs +3 -0
- package/__dev__/validation/rules/NoFragmentCyclesRule.d.mts +1 -0
- package/__dev__/validation/rules/NoFragmentCyclesRule.d.ts +1 -0
- package/__dev__/validation/rules/NoFragmentCyclesRule.js +3 -0
- package/__dev__/validation/rules/NoFragmentCyclesRule.mjs +3 -0
- package/__dev__/validation/rules/NoUndefinedVariablesRule.d.mts +1 -0
- package/__dev__/validation/rules/NoUndefinedVariablesRule.d.ts +1 -0
- package/__dev__/validation/rules/NoUndefinedVariablesRule.js +3 -0
- package/__dev__/validation/rules/NoUndefinedVariablesRule.mjs +3 -0
- package/__dev__/validation/rules/NoUnusedFragmentsRule.d.mts +1 -0
- package/__dev__/validation/rules/NoUnusedFragmentsRule.d.ts +1 -0
- package/__dev__/validation/rules/NoUnusedFragmentsRule.js +3 -0
- package/__dev__/validation/rules/NoUnusedFragmentsRule.mjs +3 -0
- package/__dev__/validation/rules/NoUnusedVariablesRule.d.mts +1 -0
- package/__dev__/validation/rules/NoUnusedVariablesRule.d.ts +1 -0
- package/__dev__/validation/rules/NoUnusedVariablesRule.js +3 -0
- package/__dev__/validation/rules/NoUnusedVariablesRule.mjs +3 -0
- package/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.d.mts +1 -0
- package/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts +1 -0
- package/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.js +3 -0
- package/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +3 -0
- package/__dev__/validation/rules/PossibleFragmentSpreadsRule.d.mts +1 -0
- package/__dev__/validation/rules/PossibleFragmentSpreadsRule.d.ts +1 -0
- package/__dev__/validation/rules/PossibleFragmentSpreadsRule.js +3 -0
- package/__dev__/validation/rules/PossibleFragmentSpreadsRule.mjs +3 -0
- package/__dev__/validation/rules/PossibleTypeExtensionsRule.d.mts +1 -0
- package/__dev__/validation/rules/PossibleTypeExtensionsRule.d.ts +1 -0
- package/__dev__/validation/rules/PossibleTypeExtensionsRule.js +3 -0
- package/__dev__/validation/rules/PossibleTypeExtensionsRule.mjs +3 -0
- package/__dev__/validation/rules/ProvidedRequiredArgumentsRule.d.mts +1 -0
- package/__dev__/validation/rules/ProvidedRequiredArgumentsRule.d.ts +1 -0
- package/__dev__/validation/rules/ProvidedRequiredArgumentsRule.js +3 -0
- package/__dev__/validation/rules/ProvidedRequiredArgumentsRule.mjs +3 -0
- package/__dev__/validation/rules/ScalarLeafsRule.d.mts +1 -0
- package/__dev__/validation/rules/ScalarLeafsRule.d.ts +1 -0
- package/__dev__/validation/rules/ScalarLeafsRule.js +3 -0
- package/__dev__/validation/rules/ScalarLeafsRule.mjs +3 -0
- package/__dev__/validation/rules/SingleFieldSubscriptionsRule.d.mts +1 -0
- package/__dev__/validation/rules/SingleFieldSubscriptionsRule.d.ts +1 -0
- package/__dev__/validation/rules/SingleFieldSubscriptionsRule.js +3 -0
- package/__dev__/validation/rules/SingleFieldSubscriptionsRule.mjs +3 -0
- package/__dev__/validation/rules/StreamDirectiveOnListFieldRule.d.mts +1 -0
- package/__dev__/validation/rules/StreamDirectiveOnListFieldRule.d.ts +1 -0
- package/__dev__/validation/rules/StreamDirectiveOnListFieldRule.js +3 -0
- package/__dev__/validation/rules/StreamDirectiveOnListFieldRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueArgumentNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueArgumentNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueArgumentNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueArgumentNamesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueDirectiveNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueDirectiveNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueDirectiveNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueDirectiveNamesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueDirectivesPerLocationRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueDirectivesPerLocationRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueDirectivesPerLocationRule.js +3 -0
- package/__dev__/validation/rules/UniqueDirectivesPerLocationRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueEnumValueNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueEnumValueNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueEnumValueNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueEnumValueNamesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueFragmentNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueFragmentNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueFragmentNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueFragmentNamesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueInputFieldNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueInputFieldNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueInputFieldNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueInputFieldNamesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueOperationNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueOperationNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueOperationNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueOperationNamesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueOperationTypesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueOperationTypesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueOperationTypesRule.js +3 -0
- package/__dev__/validation/rules/UniqueOperationTypesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueTypeNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueTypeNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueTypeNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueTypeNamesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueVariableNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueVariableNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueVariableNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueVariableNamesRule.mjs +3 -0
- package/__dev__/validation/rules/ValuesOfCorrectTypeRule.d.mts +1 -0
- package/__dev__/validation/rules/ValuesOfCorrectTypeRule.d.ts +1 -0
- package/__dev__/validation/rules/ValuesOfCorrectTypeRule.js +3 -0
- package/__dev__/validation/rules/ValuesOfCorrectTypeRule.mjs +3 -0
- package/__dev__/validation/rules/VariablesAreInputTypesRule.d.mts +1 -0
- package/__dev__/validation/rules/VariablesAreInputTypesRule.d.ts +1 -0
- package/__dev__/validation/rules/VariablesAreInputTypesRule.js +3 -0
- package/__dev__/validation/rules/VariablesAreInputTypesRule.mjs +3 -0
- package/__dev__/validation/rules/VariablesInAllowedPositionRule.d.mts +1 -0
- package/__dev__/validation/rules/VariablesInAllowedPositionRule.d.ts +1 -0
- package/__dev__/validation/rules/VariablesInAllowedPositionRule.js +3 -0
- package/__dev__/validation/rules/VariablesInAllowedPositionRule.mjs +3 -0
- package/__dev__/validation/rules/custom/NoDeprecatedCustomRule.d.mts +1 -0
- package/__dev__/validation/rules/custom/NoDeprecatedCustomRule.d.ts +1 -0
- package/__dev__/validation/rules/custom/NoDeprecatedCustomRule.js +3 -0
- package/__dev__/validation/rules/custom/NoDeprecatedCustomRule.mjs +3 -0
- package/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.mts +1 -0
- package/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts +1 -0
- package/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.js +3 -0
- package/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs +3 -0
- package/__dev__/validation/specifiedRules.d.mts +1 -0
- package/__dev__/validation/specifiedRules.d.ts +1 -0
- package/__dev__/validation/specifiedRules.js +3 -0
- package/__dev__/validation/specifiedRules.mjs +3 -0
- package/__dev__/validation/validate.d.mts +1 -0
- package/__dev__/validation/validate.d.ts +1 -0
- package/__dev__/validation/validate.js +3 -0
- package/__dev__/validation/validate.mjs +3 -0
- package/__dev__/version.d.mts +1 -0
- package/__dev__/version.d.ts +1 -0
- package/__dev__/version.js +3 -0
- package/__dev__/version.mjs +3 -0
- package/devMode.d.mts +2 -0
- package/devMode.d.ts +2 -0
- package/devMode.js +14 -0
- package/devMode.js.map +1 -0
- package/devMode.mjs +10 -0
- package/devMode.mjs.map +1 -0
- package/error/GraphQLError.d.mts +120 -0
- package/error/ensureGraphQLError.d.mts +5 -0
- package/error/ensureGraphQLError.d.ts +5 -0
- package/error/ensureGraphQLError.js +16 -0
- package/error/ensureGraphQLError.js.map +1 -0
- package/error/ensureGraphQLError.mjs +13 -0
- package/error/ensureGraphQLError.mjs.map +1 -0
- package/error/index.d.mts +4 -0
- package/error/locatedError.d.mts +9 -0
- package/error/syntaxError.d.mts +7 -0
- package/execution/AbortedGraphQLExecutionError.d.mts +6 -0
- package/execution/AbortedGraphQLExecutionError.d.ts +6 -0
- package/execution/AbortedGraphQLExecutionError.js +27 -0
- package/execution/AbortedGraphQLExecutionError.js.map +1 -0
- package/execution/AbortedGraphQLExecutionError.mjs +23 -0
- package/execution/AbortedGraphQLExecutionError.mjs.map +1 -0
- package/execution/AsyncWorkTracker.d.mts +10 -0
- package/execution/AsyncWorkTracker.d.ts +10 -0
- package/execution/AsyncWorkTracker.js +49 -0
- package/execution/AsyncWorkTracker.js.map +1 -0
- package/execution/AsyncWorkTracker.mjs +45 -0
- package/execution/AsyncWorkTracker.mjs.map +1 -0
- package/execution/Executor.d.mts +212 -0
- package/execution/Executor.d.ts +212 -0
- package/execution/Executor.js +655 -0
- package/execution/Executor.js.map +1 -0
- package/execution/Executor.mjs +651 -0
- package/execution/Executor.mjs.map +1 -0
- package/execution/ExecutorThrowingOnIncremental.d.mts +12 -0
- package/execution/ExecutorThrowingOnIncremental.d.ts +12 -0
- package/execution/ExecutorThrowingOnIncremental.js +47 -0
- package/execution/ExecutorThrowingOnIncremental.js.map +1 -0
- package/execution/ExecutorThrowingOnIncremental.mjs +43 -0
- package/execution/ExecutorThrowingOnIncremental.mjs.map +1 -0
- package/execution/cancellablePromise.d.mts +6 -0
- package/execution/cancellablePromise.d.ts +6 -0
- package/execution/cancellablePromise.js +49 -0
- package/execution/cancellablePromise.js.map +1 -0
- package/execution/cancellablePromise.mjs +45 -0
- package/execution/cancellablePromise.mjs.map +1 -0
- package/execution/collectFields.d.mts +59 -0
- package/execution/collectFields.d.ts +15 -4
- package/execution/collectFields.js +57 -22
- package/execution/collectFields.js.map +1 -1
- package/execution/collectFields.mjs +58 -23
- package/execution/collectFields.mjs.map +1 -1
- package/execution/collectIteratorPromises.d.mts +5 -0
- package/execution/collectIteratorPromises.d.ts +5 -0
- package/execution/collectIteratorPromises.js +27 -0
- package/execution/collectIteratorPromises.js.map +1 -0
- package/execution/collectIteratorPromises.mjs +24 -0
- package/execution/collectIteratorPromises.mjs.map +1 -0
- package/execution/createSharedExecutionContext.d.mts +10 -0
- package/execution/createSharedExecutionContext.d.ts +10 -0
- package/execution/createSharedExecutionContext.js +20 -0
- package/execution/createSharedExecutionContext.js.map +1 -0
- package/execution/createSharedExecutionContext.mjs +17 -0
- package/execution/createSharedExecutionContext.mjs.map +1 -0
- package/execution/execute.d.mts +180 -0
- package/execution/execute.d.ts +73 -118
- package/execution/execute.js +218 -1121
- package/execution/execute.js.map +1 -1
- package/execution/execute.mjs +213 -1119
- package/execution/execute.mjs.map +1 -1
- package/execution/getStreamUsage.d.mts +13 -0
- package/execution/getStreamUsage.d.ts +13 -0
- package/execution/getStreamUsage.js +41 -0
- package/execution/getStreamUsage.js.map +1 -0
- package/execution/getStreamUsage.mjs +38 -0
- package/execution/getStreamUsage.mjs.map +1 -0
- package/execution/getVariableSignature.d.mts +18 -0
- package/execution/hooks.d.mts +9 -0
- package/execution/hooks.d.ts +9 -0
- package/execution/hooks.js +24 -0
- package/execution/hooks.js.map +1 -0
- package/execution/hooks.mjs +21 -0
- package/execution/hooks.mjs.map +1 -0
- package/execution/incremental/Computation.d.mts +22 -0
- package/execution/incremental/Computation.d.ts +22 -0
- package/execution/incremental/Computation.js +68 -0
- package/execution/incremental/Computation.js.map +1 -0
- package/execution/incremental/Computation.mjs +64 -0
- package/execution/incremental/Computation.mjs.map +1 -0
- package/execution/incremental/IncrementalExecutor.d.mts +182 -0
- package/execution/incremental/IncrementalExecutor.d.ts +182 -0
- package/execution/incremental/IncrementalExecutor.js +390 -0
- package/execution/incremental/IncrementalExecutor.js.map +1 -0
- package/execution/incremental/IncrementalExecutor.mjs +386 -0
- package/execution/incremental/IncrementalExecutor.mjs.map +1 -0
- package/execution/incremental/IncrementalPublisher.d.mts +17 -0
- package/execution/incremental/IncrementalPublisher.d.ts +17 -0
- package/execution/incremental/IncrementalPublisher.js +201 -0
- package/execution/incremental/IncrementalPublisher.js.map +1 -0
- package/execution/incremental/IncrementalPublisher.mjs +197 -0
- package/execution/incremental/IncrementalPublisher.mjs.map +1 -0
- package/execution/incremental/Queue.d.mts +86 -0
- package/execution/incremental/Queue.d.ts +86 -0
- package/execution/incremental/Queue.js +330 -0
- package/execution/incremental/Queue.js.map +1 -0
- package/execution/incremental/Queue.mjs +325 -0
- package/execution/incremental/Queue.mjs.map +1 -0
- package/execution/incremental/WorkQueue.d.mts +67 -0
- package/execution/incremental/WorkQueue.d.ts +67 -0
- package/execution/incremental/WorkQueue.js +396 -0
- package/execution/incremental/WorkQueue.js.map +1 -0
- package/execution/incremental/WorkQueue.mjs +393 -0
- package/execution/incremental/WorkQueue.mjs.map +1 -0
- package/execution/incremental/buildExecutionPlan.d.mts +7 -0
- package/execution/{buildExecutionPlan.d.ts → incremental/buildExecutionPlan.d.ts} +1 -1
- package/execution/{buildExecutionPlan.js → incremental/buildExecutionPlan.js} +2 -2
- package/execution/incremental/buildExecutionPlan.js.map +1 -0
- package/execution/{buildExecutionPlan.mjs → incremental/buildExecutionPlan.mjs} +2 -2
- package/execution/incremental/buildExecutionPlan.mjs.map +1 -0
- package/execution/index.d.mts +8 -0
- package/execution/index.d.ts +6 -3
- package/execution/index.js +8 -4
- package/execution/index.js.map +1 -1
- package/execution/index.mjs +2 -1
- package/execution/index.mjs.map +1 -1
- package/execution/mapAsyncIterable.d.mts +6 -0
- package/execution/mapAsyncIterable.d.ts +1 -1
- package/execution/mapAsyncIterable.js +28 -51
- package/execution/mapAsyncIterable.js.map +1 -1
- package/execution/mapAsyncIterable.mjs +28 -51
- package/execution/mapAsyncIterable.mjs.map +1 -1
- package/execution/returnIteratorCatchingErrors.d.mts +1 -0
- package/execution/returnIteratorCatchingErrors.d.ts +1 -0
- package/execution/returnIteratorCatchingErrors.js +12 -0
- package/execution/returnIteratorCatchingErrors.js.map +1 -0
- package/execution/returnIteratorCatchingErrors.mjs +9 -0
- package/execution/returnIteratorCatchingErrors.mjs.map +1 -0
- package/execution/values.d.mts +61 -0
- package/execution/values.d.ts +12 -21
- package/execution/values.js +111 -74
- package/execution/values.js.map +1 -1
- package/execution/values.mjs +111 -73
- package/execution/values.mjs.map +1 -1
- package/execution/withConcurrentAbruptClose.d.mts +13 -0
- package/execution/withConcurrentAbruptClose.d.ts +13 -0
- package/execution/withConcurrentAbruptClose.js +72 -0
- package/execution/withConcurrentAbruptClose.js.map +1 -0
- package/execution/withConcurrentAbruptClose.mjs +69 -0
- package/execution/withConcurrentAbruptClose.mjs.map +1 -0
- package/graphql.d.mts +61 -0
- package/graphql.d.ts +9 -16
- package/graphql.js +22 -22
- package/graphql.js.map +1 -1
- package/graphql.mjs +22 -22
- package/graphql.mjs.map +1 -1
- package/harness.d.mts +15 -0
- package/harness.d.ts +15 -0
- package/harness.js +13 -0
- package/harness.js.map +1 -0
- package/harness.mjs +10 -0
- package/harness.mjs.map +1 -0
- package/index.d.mts +51 -0
- package/index.d.ts +10 -7
- package/index.js +25 -8
- package/index.js.map +1 -1
- package/index.mjs +11 -5
- package/index.mjs.map +1 -1
- package/jsutils/AccumulatorMap.d.mts +7 -0
- package/jsutils/AccumulatorMap.js +1 -0
- package/jsutils/AccumulatorMap.js.map +1 -1
- package/jsutils/AccumulatorMap.mjs +1 -0
- package/jsutils/AccumulatorMap.mjs.map +1 -1
- package/jsutils/Maybe.d.mts +2 -0
- package/jsutils/ObjMap.d.mts +18 -0
- package/jsutils/Path.d.mts +14 -0
- package/jsutils/PromiseOrValue.d.mts +1 -0
- package/jsutils/capitalize.d.mts +4 -0
- package/jsutils/devAssert.d.mts +1 -0
- package/jsutils/didYouMean.d.mts +5 -0
- package/jsutils/formatList.d.mts +8 -0
- package/jsutils/formatList.js +2 -1
- package/jsutils/formatList.js.map +1 -1
- package/jsutils/formatList.mjs +2 -1
- package/jsutils/formatList.mjs.map +1 -1
- package/jsutils/getBySet.d.mts +1 -0
- package/jsutils/groupBy.d.mts +4 -0
- package/jsutils/identityFunc.d.mts +4 -0
- package/jsutils/inspect.d.mts +4 -0
- package/jsutils/instanceOf.d.mts +15 -0
- package/jsutils/instanceOf.d.ts +8 -7
- package/jsutils/instanceOf.js +29 -30
- package/jsutils/instanceOf.js.map +1 -1
- package/jsutils/instanceOf.mjs +28 -30
- package/jsutils/instanceOf.mjs.map +1 -1
- package/jsutils/invariant.d.mts +1 -0
- package/jsutils/isAsyncIterable.d.mts +5 -0
- package/jsutils/isIterableObject.d.mts +18 -0
- package/jsutils/isObjectLike.d.mts +7 -0
- package/jsutils/isPromise.d.mts +6 -0
- package/jsutils/isPromise.d.ts +2 -1
- package/jsutils/isPromise.js +5 -1
- package/jsutils/isPromise.js.map +1 -1
- package/jsutils/isPromise.mjs +4 -1
- package/jsutils/isPromise.mjs.map +1 -1
- package/jsutils/isSameSet.d.mts +1 -0
- package/jsutils/keyMap.d.mts +29 -0
- package/jsutils/keyValMap.d.mts +19 -0
- package/jsutils/mapValue.d.mts +6 -0
- package/jsutils/memoize1.d.mts +4 -0
- package/jsutils/memoize1.d.ts +4 -0
- package/jsutils/memoize1.js +19 -0
- package/jsutils/memoize1.js.map +1 -0
- package/jsutils/memoize1.mjs +16 -0
- package/jsutils/memoize1.mjs.map +1 -0
- package/jsutils/memoize2.d.mts +4 -0
- package/jsutils/memoize2.d.ts +4 -0
- package/jsutils/memoize2.js +24 -0
- package/jsutils/memoize2.js.map +1 -0
- package/jsutils/memoize2.mjs +21 -0
- package/jsutils/memoize2.mjs.map +1 -0
- package/jsutils/memoize3.d.mts +4 -0
- package/jsutils/memoize3.js +1 -3
- package/jsutils/memoize3.js.map +1 -1
- package/jsutils/memoize3.mjs +1 -3
- package/jsutils/memoize3.mjs.map +1 -1
- package/jsutils/naturalCompare.d.mts +8 -0
- package/jsutils/printPathArray.d.mts +4 -0
- package/jsutils/promiseForObject.d.mts +10 -0
- package/jsutils/promiseForObject.d.ts +2 -1
- package/jsutils/promiseForObject.js +8 -7
- package/jsutils/promiseForObject.js.map +1 -1
- package/jsutils/promiseForObject.mjs +8 -7
- package/jsutils/promiseForObject.mjs.map +1 -1
- package/jsutils/promiseReduce.d.mts +9 -0
- package/jsutils/promiseWithResolvers.d.mts +10 -0
- package/jsutils/suggestionList.d.mts +5 -0
- package/jsutils/toError.d.mts +4 -0
- package/jsutils/toObjMap.d.mts +4 -0
- package/language/KindTypeMap.d.mts +2 -0
- package/language/KindTypeMap.d.ts +2 -0
- package/language/KindTypeMap.js +3 -0
- package/language/KindTypeMap.js.map +1 -0
- package/language/KindTypeMap.mjs +2 -0
- package/language/KindTypeMap.mjs.map +1 -0
- package/language/ast.d.mts +495 -0
- package/language/ast.d.ts +94 -51
- package/language/ast.js +15 -2
- package/language/ast.js.map +1 -1
- package/language/ast.mjs +15 -2
- package/language/ast.mjs.map +1 -1
- package/language/blockString.d.mts +23 -0
- package/language/characterClasses.d.mts +47 -0
- package/language/directiveLocation.d.mts +28 -0
- package/language/index.d.mts +16 -0
- package/language/index.d.ts +3 -3
- package/language/index.js +7 -2
- package/language/index.js.map +1 -1
- package/language/index.mjs +5 -3
- package/language/index.mjs.map +1 -1
- package/language/kinds.d.mts +3 -0
- package/language/kinds.js +34 -1
- package/language/kinds.js.map +1 -1
- package/language/kinds_.d.mts +109 -0
- package/language/kinds_.d.ts +11 -0
- package/language/kinds_.js +7 -1
- package/language/kinds_.js.map +1 -1
- package/language/kinds_.mjs +6 -0
- package/language/kinds_.mjs.map +1 -1
- package/language/lexer.d.mts +87 -0
- package/language/lexer.d.ts +43 -1
- package/language/lexer.js +10 -0
- package/language/lexer.js.map +1 -1
- package/language/lexer.mjs +10 -3
- package/language/lexer.mjs.map +1 -1
- package/language/location.d.mts +13 -0
- package/language/location.js +2 -1
- package/language/location.js.map +1 -1
- package/language/location.mjs +2 -1
- package/language/location.mjs.map +1 -1
- package/language/parser.d.mts +522 -0
- package/language/parser.d.ts +28 -4
- package/language/parser.js +101 -6
- package/language/parser.js.map +1 -1
- package/language/parser.mjs +100 -6
- package/language/parser.mjs.map +1 -1
- package/language/predicates.d.mts +19 -0
- package/language/predicates.d.ts +9 -1
- package/language/predicates.js +19 -0
- package/language/predicates.js.map +1 -1
- package/language/predicates.mjs +17 -0
- package/language/predicates.mjs.map +1 -1
- package/language/printLocation.d.mts +11 -0
- package/language/printString.d.mts +5 -0
- package/language/printer.d.mts +6 -0
- package/language/printer.js +28 -12
- package/language/printer.js.map +1 -1
- package/language/printer.mjs +28 -12
- package/language/printer.mjs.map +1 -1
- package/language/schemaCoordinateLexer.d.mts +43 -0
- package/language/schemaCoordinateLexer.d.ts +43 -0
- package/language/schemaCoordinateLexer.js +93 -0
- package/language/schemaCoordinateLexer.js.map +1 -0
- package/language/schemaCoordinateLexer.mjs +89 -0
- package/language/schemaCoordinateLexer.mjs.map +1 -0
- package/language/source.d.mts +26 -0
- package/language/source.d.ts +1 -0
- package/language/source.js +7 -3
- package/language/source.js.map +1 -1
- package/language/source.mjs +7 -3
- package/language/source.mjs.map +1 -1
- package/language/tokenKind.d.mts +30 -0
- package/language/tokenKind.d.ts +1 -0
- package/language/tokenKind.js +1 -0
- package/language/tokenKind.js.map +1 -1
- package/language/tokenKind.mjs +1 -0
- package/language/tokenKind.mjs.map +1 -1
- package/language/visitor.d.mts +160 -0
- package/language/visitor.js +3 -2
- package/language/visitor.js.map +1 -1
- package/language/visitor.mjs +3 -2
- package/language/visitor.mjs.map +1 -1
- package/package.json +174 -7
- package/type/assertName.d.mts +10 -0
- package/type/definition.d.mts +933 -0
- package/type/definition.d.ts +58 -16
- package/type/definition.js +53 -28
- package/type/definition.js.map +1 -1
- package/type/definition.mjs +53 -28
- package/type/definition.mjs.map +1 -1
- package/type/directives.d.mts +97 -0
- package/type/directives.d.ts +5 -0
- package/type/directives.js +20 -4
- package/type/directives.js.map +1 -1
- package/type/directives.mjs +19 -3
- package/type/directives.mjs.map +1 -1
- package/type/index.d.mts +12 -0
- package/type/index.d.ts +1 -1
- package/type/index.js.map +1 -1
- package/type/index.mjs.map +1 -1
- package/type/introspection.d.mts +26 -0
- package/type/introspection.d.ts +3 -3
- package/type/introspection.js +9 -7
- package/type/introspection.js.map +1 -1
- package/type/introspection.mjs +9 -7
- package/type/introspection.mjs.map +1 -1
- package/type/scalars.d.mts +19 -0
- package/type/scalars.d.ts +5 -5
- package/type/scalars.js +130 -38
- package/type/scalars.js.map +1 -1
- package/type/scalars.mjs +130 -38
- package/type/scalars.mjs.map +1 -1
- package/type/schema.d.mts +172 -0
- package/type/schema.d.ts +2 -0
- package/type/schema.js +11 -13
- package/type/schema.js.map +1 -1
- package/type/schema.mjs +11 -13
- package/type/schema.mjs.map +1 -1
- package/type/validate.d.mts +21 -0
- package/type/validate.d.ts +6 -0
- package/type/validate.js +48 -30
- package/type/validate.js.map +1 -1
- package/type/validate.mjs +47 -30
- package/type/validate.mjs.map +1 -1
- package/utilities/TypeInfo.d.mts +55 -0
- package/utilities/TypeInfo.js +3 -1
- package/utilities/TypeInfo.js.map +1 -1
- package/utilities/TypeInfo.mjs +3 -1
- package/utilities/TypeInfo.mjs.map +1 -1
- package/utilities/astFromValue.d.mts +27 -0
- package/utilities/astFromValue.d.ts +1 -0
- package/utilities/astFromValue.js +8 -2
- package/utilities/astFromValue.js.map +1 -1
- package/utilities/astFromValue.mjs +8 -2
- package/utilities/astFromValue.mjs.map +1 -1
- package/utilities/buildASTSchema.d.mts +29 -0
- package/utilities/buildClientSchema.d.mts +16 -0
- package/utilities/buildClientSchema.js +10 -6
- package/utilities/buildClientSchema.js.map +1 -1
- package/utilities/buildClientSchema.mjs +9 -6
- package/utilities/buildClientSchema.mjs.map +1 -1
- package/utilities/coerceInputValue.d.mts +34 -0
- package/utilities/coerceInputValue.d.ts +7 -1
- package/utilities/coerceInputValue.js +36 -13
- package/utilities/coerceInputValue.js.map +1 -1
- package/utilities/coerceInputValue.mjs +36 -13
- package/utilities/coerceInputValue.mjs.map +1 -1
- package/utilities/concatAST.d.mts +7 -0
- package/utilities/extendSchema.d.mts +29 -0
- package/utilities/extendSchema.js +2 -1
- package/utilities/extendSchema.js.map +1 -1
- package/utilities/extendSchema.mjs +2 -1
- package/utilities/extendSchema.mjs.map +1 -1
- package/utilities/findSchemaChanges.d.mts +72 -0
- package/utilities/findSchemaChanges.d.ts +18 -18
- package/utilities/findSchemaChanges.js +4 -2
- package/utilities/findSchemaChanges.js.map +1 -1
- package/utilities/findSchemaChanges.mjs +4 -2
- package/utilities/findSchemaChanges.mjs.map +1 -1
- package/utilities/getDefaultValueAST.d.mts +3 -0
- package/utilities/getDefaultValueAST.js +4 -2
- package/utilities/getDefaultValueAST.js.map +1 -1
- package/utilities/getDefaultValueAST.mjs +4 -2
- package/utilities/getDefaultValueAST.mjs.map +1 -1
- package/utilities/getIntrospectionQuery.d.mts +138 -0
- package/utilities/getOperationAST.d.mts +8 -0
- package/utilities/index.d.mts +32 -0
- package/utilities/index.d.ts +2 -0
- package/utilities/index.js +5 -1
- package/utilities/index.js.map +1 -1
- package/utilities/index.mjs +2 -0
- package/utilities/index.mjs.map +1 -1
- package/utilities/introspectionFromSchema.d.mts +12 -0
- package/utilities/introspectionFromSchema.js +2 -1
- package/utilities/introspectionFromSchema.js.map +1 -1
- package/utilities/introspectionFromSchema.mjs +2 -1
- package/utilities/introspectionFromSchema.mjs.map +1 -1
- package/utilities/lexicographicSortSchema.d.mts +7 -0
- package/utilities/mapSchemaConfig.d.mts +66 -0
- package/utilities/mapSchemaConfig.d.ts +1 -1
- package/utilities/mapSchemaConfig.js +6 -3
- package/utilities/mapSchemaConfig.js.map +1 -1
- package/utilities/mapSchemaConfig.mjs +6 -3
- package/utilities/mapSchemaConfig.mjs.map +1 -1
- package/utilities/printSchema.d.mts +7 -0
- package/utilities/printSchema.js +4 -2
- package/utilities/printSchema.js.map +1 -1
- package/utilities/printSchema.mjs +4 -2
- package/utilities/printSchema.mjs.map +1 -1
- package/utilities/replaceVariables.d.mts +13 -0
- package/utilities/replaceVariables.d.ts +2 -1
- package/utilities/replaceVariables.js +17 -8
- package/utilities/replaceVariables.js.map +1 -1
- package/utilities/replaceVariables.mjs +17 -8
- package/utilities/replaceVariables.mjs.map +1 -1
- package/utilities/resolveSchemaCoordinate.d.mts +57 -0
- package/utilities/resolveSchemaCoordinate.d.ts +57 -0
- package/utilities/resolveSchemaCoordinate.js +167 -0
- package/utilities/resolveSchemaCoordinate.js.map +1 -0
- package/utilities/resolveSchemaCoordinate.mjs +163 -0
- package/utilities/resolveSchemaCoordinate.mjs.map +1 -0
- package/utilities/separateOperations.d.mts +9 -0
- package/utilities/sortValueNode.d.mts +9 -0
- package/utilities/stripIgnoredCharacters.d.mts +62 -0
- package/utilities/typeComparators.d.mts +21 -0
- package/utilities/typeFromAST.d.mts +15 -0
- package/utilities/typedQueryDocumentNode.d.mts +17 -0
- package/utilities/validateInputValue.d.mts +19 -0
- package/utilities/validateInputValue.d.ts +2 -1
- package/utilities/validateInputValue.js +42 -17
- package/utilities/validateInputValue.js.map +1 -1
- package/utilities/validateInputValue.mjs +42 -17
- package/utilities/validateInputValue.mjs.map +1 -1
- package/utilities/valueFromAST.d.mts +26 -0
- package/utilities/valueFromAST.js +24 -9
- package/utilities/valueFromAST.js.map +1 -1
- package/utilities/valueFromAST.mjs +24 -9
- package/utilities/valueFromAST.mjs.map +1 -1
- package/utilities/valueFromASTUntyped.d.mts +20 -0
- package/utilities/valueToLiteral.d.mts +31 -0
- package/utilities/valueToLiteral.d.ts +1 -0
- package/utilities/valueToLiteral.js +4 -1
- package/utilities/valueToLiteral.js.map +1 -1
- package/utilities/valueToLiteral.mjs +4 -1
- package/utilities/valueToLiteral.mjs.map +1 -1
- package/validation/ValidationContext.d.mts +70 -0
- package/validation/ValidationContext.js +2 -0
- package/validation/ValidationContext.js.map +1 -1
- package/validation/ValidationContext.mjs +2 -0
- package/validation/ValidationContext.mjs.map +1 -1
- package/validation/index.d.mts +46 -0
- package/validation/rules/DeferStreamDirectiveLabelRule.d.mts +8 -0
- package/validation/rules/DeferStreamDirectiveLabelRule.js +1 -1
- package/validation/rules/DeferStreamDirectiveLabelRule.js.map +1 -1
- package/validation/rules/DeferStreamDirectiveLabelRule.mjs +1 -1
- package/validation/rules/DeferStreamDirectiveLabelRule.mjs.map +1 -1
- package/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.mts +8 -0
- package/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.mts +8 -0
- package/validation/rules/ExecutableDefinitionsRule.d.mts +11 -0
- package/validation/rules/FieldsOnCorrectTypeRule.d.mts +11 -0
- package/validation/rules/FragmentsOnCompositeTypesRule.d.mts +12 -0
- package/validation/rules/KnownArgumentNamesRule.d.mts +16 -0
- package/validation/rules/KnownDirectivesRule.d.mts +11 -0
- package/validation/rules/KnownDirectivesRule.js +7 -4
- package/validation/rules/KnownDirectivesRule.js.map +1 -1
- package/validation/rules/KnownDirectivesRule.mjs +7 -4
- package/validation/rules/KnownDirectivesRule.mjs.map +1 -1
- package/validation/rules/KnownFragmentNamesRule.d.mts +11 -0
- package/validation/rules/KnownOperationTypesRule.d.mts +11 -0
- package/validation/rules/KnownTypeNamesRule.d.mts +11 -0
- package/validation/rules/LoneAnonymousOperationRule.d.mts +11 -0
- package/validation/rules/LoneSchemaDefinitionRule.d.mts +8 -0
- package/validation/rules/MaxIntrospectionDepthRule.d.mts +3 -0
- package/validation/rules/MaxIntrospectionDepthRule.d.ts +2 -2
- package/validation/rules/MaxIntrospectionDepthRule.js +1 -2
- package/validation/rules/MaxIntrospectionDepthRule.js.map +1 -1
- package/validation/rules/MaxIntrospectionDepthRule.mjs +1 -2
- package/validation/rules/MaxIntrospectionDepthRule.mjs.map +1 -1
- package/validation/rules/NoFragmentCyclesRule.d.mts +11 -0
- package/validation/rules/NoUndefinedVariablesRule.d.mts +11 -0
- package/validation/rules/NoUnusedFragmentsRule.d.mts +11 -0
- package/validation/rules/NoUnusedVariablesRule.d.mts +11 -0
- package/validation/rules/OverlappingFieldsCanBeMergedRule.d.mts +12 -0
- package/validation/rules/OverlappingFieldsCanBeMergedRule.js +15 -14
- package/validation/rules/OverlappingFieldsCanBeMergedRule.js.map +1 -1
- package/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +15 -14
- package/validation/rules/OverlappingFieldsCanBeMergedRule.mjs.map +1 -1
- package/validation/rules/PossibleFragmentSpreadsRule.d.mts +10 -0
- package/validation/rules/PossibleTypeExtensionsRule.d.mts +8 -0
- package/validation/rules/PossibleTypeExtensionsRule.js +5 -3
- package/validation/rules/PossibleTypeExtensionsRule.js.map +1 -1
- package/validation/rules/PossibleTypeExtensionsRule.mjs +5 -3
- package/validation/rules/PossibleTypeExtensionsRule.mjs.map +1 -1
- package/validation/rules/ProvidedRequiredArgumentsRule.d.mts +13 -0
- package/validation/rules/ScalarLeafsRule.d.mts +9 -0
- package/validation/rules/SingleFieldSubscriptionsRule.d.mts +12 -0
- package/validation/rules/SingleFieldSubscriptionsRule.d.ts +2 -1
- package/validation/rules/SingleFieldSubscriptionsRule.js +9 -2
- package/validation/rules/SingleFieldSubscriptionsRule.js.map +1 -1
- package/validation/rules/SingleFieldSubscriptionsRule.mjs +9 -2
- package/validation/rules/SingleFieldSubscriptionsRule.mjs.map +1 -1
- package/validation/rules/StreamDirectiveOnListFieldRule.d.mts +8 -0
- package/validation/rules/UniqueArgumentDefinitionNamesRule.d.mts +9 -0
- package/validation/rules/UniqueArgumentNamesRule.d.mts +11 -0
- package/validation/rules/UniqueDirectiveNamesRule.d.mts +8 -0
- package/validation/rules/UniqueDirectivesPerLocationRule.d.mts +11 -0
- package/validation/rules/UniqueEnumValueNamesRule.d.mts +8 -0
- package/validation/rules/UniqueFieldDefinitionNamesRule.d.mts +8 -0
- package/validation/rules/UniqueFragmentNamesRule.d.mts +10 -0
- package/validation/rules/UniqueInputFieldNamesRule.d.mts +11 -0
- package/validation/rules/UniqueInputFieldNamesRule.js +2 -1
- package/validation/rules/UniqueInputFieldNamesRule.js.map +1 -1
- package/validation/rules/UniqueInputFieldNamesRule.mjs +2 -1
- package/validation/rules/UniqueInputFieldNamesRule.mjs.map +1 -1
- package/validation/rules/UniqueOperationNamesRule.d.mts +10 -0
- package/validation/rules/UniqueOperationTypesRule.d.mts +8 -0
- package/validation/rules/UniqueTypeNamesRule.d.mts +8 -0
- package/validation/rules/UniqueVariableNamesRule.d.mts +8 -0
- package/validation/rules/ValuesOfCorrectTypeRule.d.mts +11 -0
- package/validation/rules/ValuesOfCorrectTypeRule.js +5 -0
- package/validation/rules/ValuesOfCorrectTypeRule.js.map +1 -1
- package/validation/rules/ValuesOfCorrectTypeRule.mjs +5 -0
- package/validation/rules/ValuesOfCorrectTypeRule.mjs.map +1 -1
- package/validation/rules/VariablesAreInputTypesRule.d.mts +11 -0
- package/validation/rules/VariablesInAllowedPositionRule.d.mts +10 -0
- package/validation/rules/VariablesInAllowedPositionRule.js +1 -3
- package/validation/rules/VariablesInAllowedPositionRule.js.map +1 -1
- package/validation/rules/VariablesInAllowedPositionRule.mjs +1 -3
- package/validation/rules/VariablesInAllowedPositionRule.mjs.map +1 -1
- package/validation/rules/custom/NoDeprecatedCustomRule.d.mts +13 -0
- package/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.mts +13 -0
- package/validation/specifiedRules.d.mts +17 -0
- package/validation/specifiedRules.d.ts +1 -2
- package/validation/specifiedRules.js +3 -1
- package/validation/specifiedRules.js.map +1 -1
- package/validation/specifiedRules.mjs +3 -1
- package/validation/specifiedRules.mjs.map +1 -1
- package/validation/validate.d.mts +48 -0
- package/validation/validate.d.ts +5 -4
- package/validation/validate.js +10 -5
- package/validation/validate.js.map +1 -1
- package/validation/validate.mjs +10 -5
- package/validation/validate.mjs.map +1 -1
- package/version.d.mts +13 -0
- package/version.js +2 -2
- package/version.js.map +1 -1
- package/version.mjs +2 -2
- package/version.mjs.map +1 -1
- package/execution/AbortSignalListener.d.ts +0 -17
- package/execution/AbortSignalListener.js +0 -71
- package/execution/AbortSignalListener.js.map +0 -1
- package/execution/AbortSignalListener.mjs +0 -65
- package/execution/AbortSignalListener.mjs.map +0 -1
- package/execution/IncrementalGraph.d.ts +0 -29
- package/execution/IncrementalGraph.js +0 -232
- package/execution/IncrementalGraph.js.map +0 -1
- package/execution/IncrementalGraph.mjs +0 -228
- package/execution/IncrementalGraph.mjs.map +0 -1
- package/execution/IncrementalPublisher.d.ts +0 -10
- package/execution/IncrementalPublisher.js +0 -259
- package/execution/IncrementalPublisher.js.map +0 -1
- package/execution/IncrementalPublisher.mjs +0 -256
- package/execution/IncrementalPublisher.mjs.map +0 -1
- package/execution/buildExecutionPlan.js.map +0 -1
- package/execution/buildExecutionPlan.mjs.map +0 -1
- package/execution/types.d.ts +0 -161
- package/execution/types.js +0 -36
- package/execution/types.js.map +0 -1
- package/execution/types.mjs +0 -27
- package/execution/types.mjs.map +0 -1
- package/jsutils/BoxedPromiseOrValue.d.ts +0 -15
- package/jsutils/BoxedPromiseOrValue.js +0 -27
- package/jsutils/BoxedPromiseOrValue.js.map +0 -1
- package/jsutils/BoxedPromiseOrValue.mjs +0 -23
- package/jsutils/BoxedPromiseOrValue.mjs.map +0 -1
package/execution/execute.js
CHANGED
|
@@ -3,54 +3,39 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.defaultFieldResolver = exports.defaultTypeResolver = void 0;
|
|
4
4
|
exports.execute = execute;
|
|
5
5
|
exports.experimentalExecuteIncrementally = experimentalExecuteIncrementally;
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
6
|
+
exports.executeIgnoringIncremental = executeIgnoringIncremental;
|
|
7
|
+
exports.executeRootSelectionSet = executeRootSelectionSet;
|
|
8
|
+
exports.experimentalExecuteRootSelectionSet = experimentalExecuteRootSelectionSet;
|
|
9
|
+
exports.executeRootSelectionSetIgnoringIncremental = executeRootSelectionSetIgnoringIncremental;
|
|
8
10
|
exports.executeSync = executeSync;
|
|
9
|
-
exports.validateExecutionArgs = validateExecutionArgs;
|
|
10
|
-
exports.buildResolveInfo = buildResolveInfo;
|
|
11
|
-
exports.subscribe = subscribe;
|
|
12
11
|
exports.executeSubscriptionEvent = executeSubscriptionEvent;
|
|
12
|
+
exports.subscribe = subscribe;
|
|
13
13
|
exports.createSourceEventStream = createSourceEventStream;
|
|
14
|
-
|
|
14
|
+
exports.validateExecutionArgs = validateExecutionArgs;
|
|
15
|
+
exports.validateSubscriptionArgs = validateSubscriptionArgs;
|
|
16
|
+
exports.buildResolveInfo = buildResolveInfo;
|
|
15
17
|
const inspect_js_1 = require("../jsutils/inspect.js");
|
|
16
|
-
const invariant_js_1 = require("../jsutils/invariant.js");
|
|
17
18
|
const isAsyncIterable_js_1 = require("../jsutils/isAsyncIterable.js");
|
|
18
|
-
const isIterableObject_js_1 = require("../jsutils/isIterableObject.js");
|
|
19
19
|
const isObjectLike_js_1 = require("../jsutils/isObjectLike.js");
|
|
20
20
|
const isPromise_js_1 = require("../jsutils/isPromise.js");
|
|
21
|
-
const memoize3_js_1 = require("../jsutils/memoize3.js");
|
|
22
21
|
const Path_js_1 = require("../jsutils/Path.js");
|
|
23
|
-
const
|
|
24
|
-
const promiseReduce_js_1 = require("../jsutils/promiseReduce.js");
|
|
22
|
+
const ensureGraphQLError_js_1 = require("../error/ensureGraphQLError.js");
|
|
25
23
|
const GraphQLError_js_1 = require("../error/GraphQLError.js");
|
|
26
24
|
const locatedError_js_1 = require("../error/locatedError.js");
|
|
27
|
-
const ast_js_1 = require("../language/ast.js");
|
|
28
25
|
const kinds_js_1 = require("../language/kinds.js");
|
|
29
|
-
const
|
|
26
|
+
const predicates_js_1 = require("../language/predicates.js");
|
|
30
27
|
const directives_js_1 = require("../type/directives.js");
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const buildExecutionPlan_js_1 = require("./buildExecutionPlan.js");
|
|
28
|
+
const index_js_1 = require("../type/index.js");
|
|
29
|
+
const cancellablePromise_js_1 = require("./cancellablePromise.js");
|
|
34
30
|
const collectFields_js_1 = require("./collectFields.js");
|
|
31
|
+
const createSharedExecutionContext_js_1 = require("./createSharedExecutionContext.js");
|
|
32
|
+
const Executor_js_1 = require("./Executor.js");
|
|
33
|
+
const ExecutorThrowingOnIncremental_js_1 = require("./ExecutorThrowingOnIncremental.js");
|
|
35
34
|
const getVariableSignature_js_1 = require("./getVariableSignature.js");
|
|
36
|
-
const
|
|
35
|
+
const IncrementalExecutor_js_1 = require("./incremental/IncrementalExecutor.js");
|
|
37
36
|
const mapAsyncIterable_js_1 = require("./mapAsyncIterable.js");
|
|
38
|
-
const types_js_1 = require("./types.js");
|
|
39
37
|
const values_js_1 = require("./values.js");
|
|
40
|
-
/* eslint-disable @typescript-eslint/max-params */
|
|
41
|
-
// This file contains a lot of such errors but we plan to refactor it anyway
|
|
42
|
-
// so just disable it for entire file.
|
|
43
|
-
/**
|
|
44
|
-
* A memoized collection of relevant subfields with regard to the return
|
|
45
|
-
* type. Memoizing ensures the subfields are not repeatedly calculated, which
|
|
46
|
-
* saves overhead when resolving lists of values.
|
|
47
|
-
*/
|
|
48
|
-
const collectSubfields = (0, memoize3_js_1.memoize3)((validatedExecutionArgs, returnType, fieldDetailsList) => {
|
|
49
|
-
const { schema, fragments, variableValues, hideSuggestions } = validatedExecutionArgs;
|
|
50
|
-
return (0, collectFields_js_1.collectSubfields)(schema, fragments, variableValues, returnType, fieldDetailsList, hideSuggestions);
|
|
51
|
-
});
|
|
52
38
|
const UNEXPECTED_EXPERIMENTAL_DIRECTIVES = 'The provided schema unexpectedly contains experimental directives (@defer or @stream). These directives may only be utilized if experimental execution features are explicitly enabled.';
|
|
53
|
-
const UNEXPECTED_MULTIPLE_PAYLOADS = 'Executing this GraphQL operation would unexpectedly produce multiple payloads (due to @defer or @stream directive)';
|
|
54
39
|
/**
|
|
55
40
|
* Implements the "Executing requests" section of the GraphQL specification.
|
|
56
41
|
*
|
|
@@ -71,24 +56,12 @@ function execute(args) {
|
|
|
71
56
|
if (args.schema.getDirective('defer') || args.schema.getDirective('stream')) {
|
|
72
57
|
throw new Error(UNEXPECTED_EXPERIMENTAL_DIRECTIVES);
|
|
73
58
|
}
|
|
74
|
-
const
|
|
75
|
-
//
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
function ensureSinglePayload(result) {
|
|
80
|
-
if ((0, isPromise_js_1.isPromise)(result)) {
|
|
81
|
-
return result.then((resolved) => {
|
|
82
|
-
if ('initialResult' in resolved) {
|
|
83
|
-
throw new Error(UNEXPECTED_MULTIPLE_PAYLOADS);
|
|
84
|
-
}
|
|
85
|
-
return resolved;
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
if ('initialResult' in result) {
|
|
89
|
-
throw new Error(UNEXPECTED_MULTIPLE_PAYLOADS);
|
|
59
|
+
const validatedExecutionArgs = validateExecutionArgs(args);
|
|
60
|
+
// Return early errors if execution context failed.
|
|
61
|
+
if (!('schema' in validatedExecutionArgs)) {
|
|
62
|
+
return { errors: validatedExecutionArgs };
|
|
90
63
|
}
|
|
91
|
-
return
|
|
64
|
+
return executeRootSelectionSet(validatedExecutionArgs);
|
|
92
65
|
}
|
|
93
66
|
/**
|
|
94
67
|
* Implements the "Executing requests" section of the GraphQL specification,
|
|
@@ -110,7 +83,17 @@ function experimentalExecuteIncrementally(args) {
|
|
|
110
83
|
if (!('schema' in validatedExecutionArgs)) {
|
|
111
84
|
return { errors: validatedExecutionArgs };
|
|
112
85
|
}
|
|
113
|
-
return
|
|
86
|
+
return experimentalExecuteRootSelectionSet(validatedExecutionArgs);
|
|
87
|
+
}
|
|
88
|
+
function executeIgnoringIncremental(args) {
|
|
89
|
+
// If a valid execution context cannot be created due to incorrect arguments,
|
|
90
|
+
// a "Response" with only errors is returned.
|
|
91
|
+
const validatedExecutionArgs = validateExecutionArgs(args);
|
|
92
|
+
// Return early errors if execution context failed.
|
|
93
|
+
if (!('schema' in validatedExecutionArgs)) {
|
|
94
|
+
return { errors: validatedExecutionArgs };
|
|
95
|
+
}
|
|
96
|
+
return executeRootSelectionSetIgnoringIncremental(validatedExecutionArgs);
|
|
114
97
|
}
|
|
115
98
|
/**
|
|
116
99
|
* Implements the "Executing operations" section of the spec.
|
|
@@ -127,65 +110,14 @@ function experimentalExecuteIncrementally(args) {
|
|
|
127
110
|
* at which point we still log the error and null the parent field, which
|
|
128
111
|
* in this case is the entire response.
|
|
129
112
|
*/
|
|
130
|
-
function
|
|
131
|
-
|
|
132
|
-
return ensureSinglePayload(result);
|
|
113
|
+
function executeRootSelectionSet(validatedExecutionArgs) {
|
|
114
|
+
return new ExecutorThrowingOnIncremental_js_1.ExecutorThrowingOnIncremental(validatedExecutionArgs).executeRootSelectionSet();
|
|
133
115
|
}
|
|
134
|
-
function
|
|
135
|
-
|
|
136
|
-
const exeContext = {
|
|
137
|
-
validatedExecutionArgs,
|
|
138
|
-
errors: undefined,
|
|
139
|
-
abortSignalListener: abortSignal
|
|
140
|
-
? new AbortSignalListener_js_1.AbortSignalListener(abortSignal)
|
|
141
|
-
: undefined,
|
|
142
|
-
completed: false,
|
|
143
|
-
cancellableStreams: undefined,
|
|
144
|
-
};
|
|
145
|
-
try {
|
|
146
|
-
const { schema, fragments, rootValue, operation, variableValues, hideSuggestions, } = validatedExecutionArgs;
|
|
147
|
-
const { operation: operationType, selectionSet } = operation;
|
|
148
|
-
const rootType = schema.getRootType(operationType);
|
|
149
|
-
if (rootType == null) {
|
|
150
|
-
throw new GraphQLError_js_1.GraphQLError(`Schema is not configured to execute ${operationType} operation.`, { nodes: operation });
|
|
151
|
-
}
|
|
152
|
-
const { groupedFieldSet, newDeferUsages } = (0, collectFields_js_1.collectFields)(schema, fragments, variableValues, rootType, selectionSet, hideSuggestions);
|
|
153
|
-
const graphqlWrappedResult = executeRootExecutionPlan(exeContext, operation.operation, rootType, rootValue, groupedFieldSet, newDeferUsages);
|
|
154
|
-
if ((0, isPromise_js_1.isPromise)(graphqlWrappedResult)) {
|
|
155
|
-
return graphqlWrappedResult.then((resolved) => {
|
|
156
|
-
exeContext.completed = true;
|
|
157
|
-
return buildDataResponse(exeContext, resolved);
|
|
158
|
-
}, (error) => {
|
|
159
|
-
exeContext.completed = true;
|
|
160
|
-
exeContext.abortSignalListener?.disconnect();
|
|
161
|
-
return {
|
|
162
|
-
data: null,
|
|
163
|
-
errors: withError(exeContext.errors, error),
|
|
164
|
-
};
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
exeContext.completed = true;
|
|
168
|
-
return buildDataResponse(exeContext, graphqlWrappedResult);
|
|
169
|
-
}
|
|
170
|
-
catch (error) {
|
|
171
|
-
exeContext.completed = true;
|
|
172
|
-
// TODO: add test case for synchronous null bubbling to root with cancellation
|
|
173
|
-
/* c8 ignore next */
|
|
174
|
-
exeContext.abortSignalListener?.disconnect();
|
|
175
|
-
return { data: null, errors: withError(exeContext.errors, error) };
|
|
176
|
-
}
|
|
116
|
+
function experimentalExecuteRootSelectionSet(validatedExecutionArgs) {
|
|
117
|
+
return new IncrementalExecutor_js_1.IncrementalExecutor(validatedExecutionArgs).executeRootSelectionSet();
|
|
177
118
|
}
|
|
178
|
-
function
|
|
179
|
-
return
|
|
180
|
-
}
|
|
181
|
-
function buildDataResponse(exeContext, graphqlWrappedResult) {
|
|
182
|
-
const { rawResult: data, incrementalDataRecords } = graphqlWrappedResult;
|
|
183
|
-
const errors = exeContext.errors;
|
|
184
|
-
if (incrementalDataRecords === undefined) {
|
|
185
|
-
exeContext.abortSignalListener?.disconnect();
|
|
186
|
-
return errors !== undefined ? { errors, data } : { data };
|
|
187
|
-
}
|
|
188
|
-
return (0, IncrementalPublisher_js_1.buildIncrementalResponse)(exeContext, data, errors, incrementalDataRecords);
|
|
119
|
+
function executeRootSelectionSetIgnoringIncremental(validatedExecutionArgs) {
|
|
120
|
+
return new Executor_js_1.Executor(validatedExecutionArgs).executeRootSelectionSet();
|
|
189
121
|
}
|
|
190
122
|
/**
|
|
191
123
|
* Also implements the "Executing requests" section of the GraphQL specification.
|
|
@@ -200,6 +132,95 @@ function executeSync(args) {
|
|
|
200
132
|
}
|
|
201
133
|
return result;
|
|
202
134
|
}
|
|
135
|
+
function executeSubscriptionEvent(validatedExecutionArgs) {
|
|
136
|
+
return new ExecutorThrowingOnIncremental_js_1.ExecutorThrowingOnIncremental(validatedExecutionArgs).executeRootSelectionSet(false);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Implements the "Subscribe" algorithm described in the GraphQL specification.
|
|
140
|
+
*
|
|
141
|
+
* Returns a Promise which resolves to either an AsyncIterator (if successful)
|
|
142
|
+
* or an ExecutionResult (error). The promise will be rejected if the schema or
|
|
143
|
+
* other arguments to this function are invalid, or if the resolved event stream
|
|
144
|
+
* is not an async iterable.
|
|
145
|
+
*
|
|
146
|
+
* If the client-provided arguments to this function do not result in a
|
|
147
|
+
* compliant subscription, a GraphQL Response (ExecutionResult) with descriptive
|
|
148
|
+
* errors and no data will be returned.
|
|
149
|
+
*
|
|
150
|
+
* If the source stream could not be created due to faulty subscription resolver
|
|
151
|
+
* logic or underlying systems, the promise will resolve to a single
|
|
152
|
+
* ExecutionResult containing `errors` and no `data`.
|
|
153
|
+
*
|
|
154
|
+
* If the operation succeeded, the promise resolves to an AsyncIterator, which
|
|
155
|
+
* yields a stream of ExecutionResults representing the response stream.
|
|
156
|
+
*
|
|
157
|
+
* This function does not support incremental delivery (`@defer` and `@stream`).
|
|
158
|
+
* If an operation which would defer or stream data is executed with this
|
|
159
|
+
* function, a field error will be raised at the location of the `@defer` or
|
|
160
|
+
* `@stream` directive.
|
|
161
|
+
*
|
|
162
|
+
* Accepts an object with named arguments.
|
|
163
|
+
*/
|
|
164
|
+
function subscribe(args) {
|
|
165
|
+
// If a valid execution context cannot be created due to incorrect arguments,
|
|
166
|
+
// a "Response" with only errors is returned.
|
|
167
|
+
const validatedExecutionArgs = validateSubscriptionArgs(args);
|
|
168
|
+
// Return early errors if execution context failed.
|
|
169
|
+
if (!('schema' in validatedExecutionArgs)) {
|
|
170
|
+
return { errors: validatedExecutionArgs };
|
|
171
|
+
}
|
|
172
|
+
const resultOrStream = createSourceEventStream(validatedExecutionArgs);
|
|
173
|
+
if ((0, isPromise_js_1.isPromise)(resultOrStream)) {
|
|
174
|
+
return resultOrStream.then((resolvedResultOrStream) => mapSourceToResponse(validatedExecutionArgs, resolvedResultOrStream));
|
|
175
|
+
}
|
|
176
|
+
return mapSourceToResponse(validatedExecutionArgs, resultOrStream);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Implements the "CreateSourceEventStream" algorithm described in the
|
|
180
|
+
* GraphQL specification, resolving the subscription source event stream for a
|
|
181
|
+
* previously validated subscription request.
|
|
182
|
+
*
|
|
183
|
+
* Returns a Promise which resolves to either an AsyncIterable (if successful)
|
|
184
|
+
* or an ExecutionResult (error). The promise will be rejected if the validated
|
|
185
|
+
* execution arguments are invalid, or if the resolved event stream is not an
|
|
186
|
+
* async iterable.
|
|
187
|
+
*
|
|
188
|
+
* If the client-provided arguments to this function do not result in a
|
|
189
|
+
* compliant subscription, a GraphQL Response (ExecutionResult) with
|
|
190
|
+
* descriptive errors and no data will be returned.
|
|
191
|
+
*
|
|
192
|
+
* If the the source stream could not be created due to faulty subscription
|
|
193
|
+
* resolver logic or underlying systems, the promise will resolve to a single
|
|
194
|
+
* ExecutionResult containing `errors` and no `data`.
|
|
195
|
+
*
|
|
196
|
+
* If the operation succeeded, the promise resolves to the AsyncIterable for the
|
|
197
|
+
* event stream returned by the resolver.
|
|
198
|
+
*
|
|
199
|
+
* A Source Event Stream represents a sequence of events, each of which triggers
|
|
200
|
+
* a GraphQL execution for that event.
|
|
201
|
+
*
|
|
202
|
+
* This may be useful when hosting the stateful subscription service in a
|
|
203
|
+
* different process or machine than the stateless GraphQL execution engine,
|
|
204
|
+
* or otherwise separating these two steps. For more on this, see the
|
|
205
|
+
* "Supporting Subscriptions at Scale" information in the GraphQL specification.
|
|
206
|
+
*/
|
|
207
|
+
function createSourceEventStream(validatedExecutionArgs) {
|
|
208
|
+
if (!('operation' in validatedExecutionArgs)) {
|
|
209
|
+
throw new GraphQLError_js_1.GraphQLError('Passing ExecutionArgs to createSourceEventStream() was removed in graphql-js@17.0.0; call validateSubscriptionArgs() first and pass the result instead, or use subscribe() for the full subscription pipeline.');
|
|
210
|
+
}
|
|
211
|
+
try {
|
|
212
|
+
const eventStream = executeSubscription(validatedExecutionArgs);
|
|
213
|
+
if ((0, isPromise_js_1.isPromise)(eventStream)) {
|
|
214
|
+
return eventStream.then(undefined, (error) => ({
|
|
215
|
+
errors: [(0, ensureGraphQLError_js_1.ensureGraphQLError)(error)],
|
|
216
|
+
}));
|
|
217
|
+
}
|
|
218
|
+
return eventStream;
|
|
219
|
+
}
|
|
220
|
+
catch (error) {
|
|
221
|
+
return { errors: [(0, ensureGraphQLError_js_1.ensureGraphQLError)(error)] };
|
|
222
|
+
}
|
|
223
|
+
}
|
|
203
224
|
/**
|
|
204
225
|
* Constructs a ExecutionContext object from the arguments passed to
|
|
205
226
|
* execute, which we will pass throughout the other execution methods.
|
|
@@ -210,12 +231,9 @@ function executeSync(args) {
|
|
|
210
231
|
* @internal
|
|
211
232
|
*/
|
|
212
233
|
function validateExecutionArgs(args) {
|
|
213
|
-
const { schema, document, rootValue, contextValue, variableValues: rawVariableValues, operationName, fieldResolver, typeResolver, subscribeFieldResolver, perEventExecutor, enableEarlyExecution,
|
|
214
|
-
if (abortSignal?.aborted) {
|
|
215
|
-
return [(0, locatedError_js_1.locatedError)(abortSignal.reason, undefined)];
|
|
216
|
-
}
|
|
234
|
+
const { schema, document, rootValue, contextValue, variableValues: rawVariableValues, operationName, fieldResolver, typeResolver, subscribeFieldResolver, perEventExecutor, abortSignal: externalAbortSignal, enableEarlyExecution, hooks, options, } = args;
|
|
217
235
|
// If the schema used for execution is invalid, throw an error.
|
|
218
|
-
(0,
|
|
236
|
+
(0, index_js_1.assertValidSchema)(schema);
|
|
219
237
|
let operation;
|
|
220
238
|
const fragmentDefinitions = Object.create(null);
|
|
221
239
|
const fragments = Object.create(null);
|
|
@@ -260,12 +278,13 @@ function validateExecutionArgs(args) {
|
|
|
260
278
|
const variableDefinitions = operation.variableDefinitions ?? [];
|
|
261
279
|
const hideSuggestions = args.hideSuggestions ?? false;
|
|
262
280
|
const variableValuesOrErrors = (0, values_js_1.getVariableValues)(schema, variableDefinitions, rawVariableValues ?? {}, {
|
|
263
|
-
maxErrors: 50,
|
|
281
|
+
maxErrors: options?.maxCoercionErrors ?? 50,
|
|
264
282
|
hideSuggestions,
|
|
265
283
|
});
|
|
266
284
|
if (variableValuesOrErrors.errors) {
|
|
267
285
|
return variableValuesOrErrors.errors;
|
|
268
286
|
}
|
|
287
|
+
const errorPropagation = !operation.directives?.find((directive) => directive.name.value === directives_js_1.GraphQLDisableErrorPropagationDirective.name);
|
|
269
288
|
return {
|
|
270
289
|
schema,
|
|
271
290
|
fragmentDefinitions,
|
|
@@ -278,690 +297,25 @@ function validateExecutionArgs(args) {
|
|
|
278
297
|
typeResolver: typeResolver ?? exports.defaultTypeResolver,
|
|
279
298
|
subscribeFieldResolver: subscribeFieldResolver ?? exports.defaultFieldResolver,
|
|
280
299
|
perEventExecutor: perEventExecutor ?? executeSubscriptionEvent,
|
|
281
|
-
enableEarlyExecution: enableEarlyExecution === true,
|
|
282
300
|
hideSuggestions,
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
if (newDeferUsages.length === 0) {
|
|
288
|
-
return executeRootGroupedFieldSet(exeContext, operation, rootType, rootValue, originalGroupedFieldSet, undefined);
|
|
289
|
-
}
|
|
290
|
-
const newDeferMap = getNewDeferMap(newDeferUsages, undefined, undefined);
|
|
291
|
-
const { groupedFieldSet, newGroupedFieldSets } = (0, buildExecutionPlan_js_1.buildExecutionPlan)(originalGroupedFieldSet);
|
|
292
|
-
const graphqlWrappedResult = executeRootGroupedFieldSet(exeContext, operation, rootType, rootValue, groupedFieldSet, newDeferMap);
|
|
293
|
-
if (newGroupedFieldSets.size > 0) {
|
|
294
|
-
const newPendingExecutionGroups = collectExecutionGroups(exeContext, rootType, rootValue, undefined, undefined, newGroupedFieldSets, newDeferMap);
|
|
295
|
-
return withNewExecutionGroups(graphqlWrappedResult, newPendingExecutionGroups);
|
|
296
|
-
}
|
|
297
|
-
return graphqlWrappedResult;
|
|
298
|
-
}
|
|
299
|
-
function withNewExecutionGroups(result, newPendingExecutionGroups) {
|
|
300
|
-
if ((0, isPromise_js_1.isPromise)(result)) {
|
|
301
|
-
return result.then((resolved) => {
|
|
302
|
-
addIncrementalDataRecords(resolved, newPendingExecutionGroups);
|
|
303
|
-
return resolved;
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
addIncrementalDataRecords(result, newPendingExecutionGroups);
|
|
307
|
-
return result;
|
|
308
|
-
}
|
|
309
|
-
function executeRootGroupedFieldSet(exeContext, operation, rootType, rootValue, groupedFieldSet, deferMap) {
|
|
310
|
-
switch (operation) {
|
|
311
|
-
case ast_js_1.OperationTypeNode.QUERY:
|
|
312
|
-
return executeFields(exeContext, rootType, rootValue, undefined, groupedFieldSet, undefined, deferMap);
|
|
313
|
-
case ast_js_1.OperationTypeNode.MUTATION:
|
|
314
|
-
return executeFieldsSerially(exeContext, rootType, rootValue, undefined, groupedFieldSet, undefined, deferMap);
|
|
315
|
-
case ast_js_1.OperationTypeNode.SUBSCRIPTION:
|
|
316
|
-
// TODO: deprecate `subscribe` and move all logic here
|
|
317
|
-
// Temporary solution until we finish merging execute and subscribe together
|
|
318
|
-
return executeFields(exeContext, rootType, rootValue, undefined, groupedFieldSet, undefined, deferMap);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* Implements the "Executing selection sets" section of the spec
|
|
323
|
-
* for fields that must be executed serially.
|
|
324
|
-
*/
|
|
325
|
-
function executeFieldsSerially(exeContext, parentType, sourceValue, path, groupedFieldSet, incrementalContext, deferMap) {
|
|
326
|
-
const abortSignal = exeContext.validatedExecutionArgs.abortSignal;
|
|
327
|
-
return (0, promiseReduce_js_1.promiseReduce)(groupedFieldSet, (graphqlWrappedResult, [responseName, fieldDetailsList]) => {
|
|
328
|
-
const fieldPath = (0, Path_js_1.addPath)(path, responseName, parentType.name);
|
|
329
|
-
if (abortSignal?.aborted) {
|
|
330
|
-
handleFieldError(abortSignal.reason, exeContext, parentType, fieldDetailsList, fieldPath, incrementalContext);
|
|
331
|
-
graphqlWrappedResult.rawResult[responseName] = null;
|
|
332
|
-
return graphqlWrappedResult;
|
|
333
|
-
}
|
|
334
|
-
const result = executeField(exeContext, parentType, sourceValue, fieldDetailsList, fieldPath, incrementalContext, deferMap);
|
|
335
|
-
if (result === undefined) {
|
|
336
|
-
return graphqlWrappedResult;
|
|
337
|
-
}
|
|
338
|
-
if ((0, isPromise_js_1.isPromise)(result)) {
|
|
339
|
-
return result.then((resolved) => {
|
|
340
|
-
graphqlWrappedResult.rawResult[responseName] = resolved.rawResult;
|
|
341
|
-
addIncrementalDataRecords(graphqlWrappedResult, resolved.incrementalDataRecords);
|
|
342
|
-
return graphqlWrappedResult;
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
|
-
graphqlWrappedResult.rawResult[responseName] = result.rawResult;
|
|
346
|
-
addIncrementalDataRecords(graphqlWrappedResult, result.incrementalDataRecords);
|
|
347
|
-
return graphqlWrappedResult;
|
|
348
|
-
}, {
|
|
349
|
-
rawResult: Object.create(null),
|
|
350
|
-
incrementalDataRecords: undefined,
|
|
351
|
-
});
|
|
352
|
-
}
|
|
353
|
-
function addIncrementalDataRecords(graphqlWrappedResult, incrementalDataRecords) {
|
|
354
|
-
if (incrementalDataRecords === undefined) {
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
357
|
-
if (graphqlWrappedResult.incrementalDataRecords === undefined) {
|
|
358
|
-
graphqlWrappedResult.incrementalDataRecords = [...incrementalDataRecords];
|
|
359
|
-
}
|
|
360
|
-
else {
|
|
361
|
-
graphqlWrappedResult.incrementalDataRecords.push(...incrementalDataRecords);
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
/**
|
|
365
|
-
* Implements the "Executing selection sets" section of the spec
|
|
366
|
-
* for fields that may be executed in parallel.
|
|
367
|
-
*/
|
|
368
|
-
function executeFields(exeContext, parentType, sourceValue, path, groupedFieldSet, incrementalContext, deferMap) {
|
|
369
|
-
const results = Object.create(null);
|
|
370
|
-
const graphqlWrappedResult = {
|
|
371
|
-
rawResult: results,
|
|
372
|
-
incrementalDataRecords: undefined,
|
|
373
|
-
};
|
|
374
|
-
let containsPromise = false;
|
|
375
|
-
try {
|
|
376
|
-
for (const [responseName, fieldDetailsList] of groupedFieldSet) {
|
|
377
|
-
const fieldPath = (0, Path_js_1.addPath)(path, responseName, parentType.name);
|
|
378
|
-
const result = executeField(exeContext, parentType, sourceValue, fieldDetailsList, fieldPath, incrementalContext, deferMap);
|
|
379
|
-
if (result !== undefined) {
|
|
380
|
-
if ((0, isPromise_js_1.isPromise)(result)) {
|
|
381
|
-
results[responseName] = result.then((resolved) => {
|
|
382
|
-
addIncrementalDataRecords(graphqlWrappedResult, resolved.incrementalDataRecords);
|
|
383
|
-
return resolved.rawResult;
|
|
384
|
-
});
|
|
385
|
-
containsPromise = true;
|
|
386
|
-
}
|
|
387
|
-
else {
|
|
388
|
-
results[responseName] = result.rawResult;
|
|
389
|
-
addIncrementalDataRecords(graphqlWrappedResult, result.incrementalDataRecords);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
catch (error) {
|
|
395
|
-
if (containsPromise) {
|
|
396
|
-
// Ensure that any promises returned by other fields are handled, as they may also reject.
|
|
397
|
-
return (0, promiseForObject_js_1.promiseForObject)(results, () => {
|
|
398
|
-
/* noop */
|
|
399
|
-
}).finally(() => {
|
|
400
|
-
throw error;
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
throw error;
|
|
404
|
-
}
|
|
405
|
-
// If there are no promises, we can just return the object and any incrementalDataRecords
|
|
406
|
-
if (!containsPromise) {
|
|
407
|
-
return graphqlWrappedResult;
|
|
408
|
-
}
|
|
409
|
-
// Otherwise, results is a map from field name to the result of resolving that
|
|
410
|
-
// field, which is possibly a promise. Return a promise that will return this
|
|
411
|
-
// same map, but with any promises replaced with the values they resolved to.
|
|
412
|
-
return (0, promiseForObject_js_1.promiseForObject)(results, (resolved) => ({
|
|
413
|
-
rawResult: resolved,
|
|
414
|
-
incrementalDataRecords: graphqlWrappedResult.incrementalDataRecords,
|
|
415
|
-
}));
|
|
416
|
-
}
|
|
417
|
-
function toNodes(fieldDetailsList) {
|
|
418
|
-
return fieldDetailsList.map((fieldDetails) => fieldDetails.node);
|
|
419
|
-
}
|
|
420
|
-
/**
|
|
421
|
-
* Implements the "Executing fields" section of the spec
|
|
422
|
-
* In particular, this function figures out the value that the field returns by
|
|
423
|
-
* calling its resolve function, then calls completeValue to complete promises,
|
|
424
|
-
* coercing scalars, or execute the sub-selection-set for objects.
|
|
425
|
-
*/
|
|
426
|
-
function executeField(exeContext, parentType, source, fieldDetailsList, path, incrementalContext, deferMap) {
|
|
427
|
-
const { validatedExecutionArgs, abortSignalListener } = exeContext;
|
|
428
|
-
const { schema, contextValue, variableValues, hideSuggestions, abortSignal } = validatedExecutionArgs;
|
|
429
|
-
const fieldName = fieldDetailsList[0].node.name.value;
|
|
430
|
-
const fieldDef = schema.getField(parentType, fieldName);
|
|
431
|
-
if (!fieldDef) {
|
|
432
|
-
return;
|
|
433
|
-
}
|
|
434
|
-
const returnType = fieldDef.type;
|
|
435
|
-
const resolveFn = fieldDef.resolve ?? validatedExecutionArgs.fieldResolver;
|
|
436
|
-
const info = buildResolveInfo(validatedExecutionArgs, fieldDef, toNodes(fieldDetailsList), parentType, path);
|
|
437
|
-
// Get the resolve function, regardless of if its result is normal or abrupt (error).
|
|
438
|
-
try {
|
|
439
|
-
// Build a JS object of arguments from the field.arguments AST, using the
|
|
440
|
-
// variables scope to fulfill any variable references.
|
|
441
|
-
// TODO: find a way to memoize, in case this field is within a List type.
|
|
442
|
-
const args = (0, values_js_1.experimentalGetArgumentValues)(fieldDetailsList[0].node, fieldDef.args, variableValues, fieldDetailsList[0].fragmentVariableValues, hideSuggestions);
|
|
443
|
-
// The resolve function's optional third argument is a context value that
|
|
444
|
-
// is provided to every resolve function within an execution. It is commonly
|
|
445
|
-
// used to represent an authenticated user, or request-specific caches.
|
|
446
|
-
const result = resolveFn(source, args, contextValue, info, abortSignal);
|
|
447
|
-
if ((0, isPromise_js_1.isPromise)(result)) {
|
|
448
|
-
return completePromisedValue(exeContext, returnType, fieldDetailsList, info, path, abortSignalListener
|
|
449
|
-
? (0, AbortSignalListener_js_1.cancellablePromise)(result, abortSignalListener)
|
|
450
|
-
: result, incrementalContext, deferMap);
|
|
451
|
-
}
|
|
452
|
-
const completed = completeValue(exeContext, returnType, fieldDetailsList, info, path, result, incrementalContext, deferMap);
|
|
453
|
-
if ((0, isPromise_js_1.isPromise)(completed)) {
|
|
454
|
-
// Note: we don't rely on a `catch` method, but we do expect "thenable"
|
|
455
|
-
// to take a second callback for the error case.
|
|
456
|
-
return completed.then(undefined, (rawError) => {
|
|
457
|
-
handleFieldError(rawError, exeContext, returnType, fieldDetailsList, path, incrementalContext);
|
|
458
|
-
return { rawResult: null, incrementalDataRecords: undefined };
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
return completed;
|
|
462
|
-
}
|
|
463
|
-
catch (rawError) {
|
|
464
|
-
handleFieldError(rawError, exeContext, returnType, fieldDetailsList, path, incrementalContext);
|
|
465
|
-
return { rawResult: null, incrementalDataRecords: undefined };
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
/**
|
|
469
|
-
* TODO: consider no longer exporting this function
|
|
470
|
-
* @internal
|
|
471
|
-
*/
|
|
472
|
-
function buildResolveInfo(validatedExecutionArgs, fieldDef, fieldNodes, parentType, path) {
|
|
473
|
-
const { schema, fragmentDefinitions, rootValue, operation, variableValues } = validatedExecutionArgs;
|
|
474
|
-
// The resolve function's optional fourth argument is a collection of
|
|
475
|
-
// information about the current execution state.
|
|
476
|
-
return {
|
|
477
|
-
fieldName: fieldDef.name,
|
|
478
|
-
fieldNodes,
|
|
479
|
-
returnType: fieldDef.type,
|
|
480
|
-
parentType,
|
|
481
|
-
path,
|
|
482
|
-
schema,
|
|
483
|
-
fragments: fragmentDefinitions,
|
|
484
|
-
rootValue,
|
|
485
|
-
operation,
|
|
486
|
-
variableValues,
|
|
487
|
-
};
|
|
488
|
-
}
|
|
489
|
-
function handleFieldError(rawError, exeContext, returnType, fieldDetailsList, path, incrementalContext) {
|
|
490
|
-
const error = (0, locatedError_js_1.locatedError)(rawError, toNodes(fieldDetailsList), (0, Path_js_1.pathToArray)(path));
|
|
491
|
-
// If the field type is non-nullable, then it is resolved without any
|
|
492
|
-
// protection from errors, however it still properly locates the error.
|
|
493
|
-
if ((0, definition_js_1.isNonNullType)(returnType)) {
|
|
494
|
-
throw error;
|
|
495
|
-
}
|
|
496
|
-
// Otherwise, error protection is applied, logging the error and resolving
|
|
497
|
-
// a null value for this field if one is encountered.
|
|
498
|
-
const context = incrementalContext ?? exeContext;
|
|
499
|
-
let errors = context.errors;
|
|
500
|
-
if (errors === undefined) {
|
|
501
|
-
errors = [];
|
|
502
|
-
context.errors = errors;
|
|
503
|
-
}
|
|
504
|
-
errors.push(error);
|
|
505
|
-
}
|
|
506
|
-
/**
|
|
507
|
-
* Implements the instructions for completeValue as defined in the
|
|
508
|
-
* "Value Completion" section of the spec.
|
|
509
|
-
*
|
|
510
|
-
* If the field type is Non-Null, then this recursively completes the value
|
|
511
|
-
* for the inner type. It throws a field error if that completion returns null,
|
|
512
|
-
* as per the "Nullability" section of the spec.
|
|
513
|
-
*
|
|
514
|
-
* If the field type is a List, then this recursively completes the value
|
|
515
|
-
* for the inner type on each item in the list.
|
|
516
|
-
*
|
|
517
|
-
* If the field type is a Scalar or Enum, ensures the completed value is a legal
|
|
518
|
-
* value of the type by calling the `coerceOutputValue` method of GraphQL type
|
|
519
|
-
* definition.
|
|
520
|
-
*
|
|
521
|
-
* If the field is an abstract type, determine the runtime type of the value
|
|
522
|
-
* and then complete based on that type
|
|
523
|
-
*
|
|
524
|
-
* Otherwise, the field type expects a sub-selection set, and will complete the
|
|
525
|
-
* value by executing all sub-selections.
|
|
526
|
-
*/
|
|
527
|
-
function completeValue(exeContext, returnType, fieldDetailsList, info, path, result, incrementalContext, deferMap) {
|
|
528
|
-
// If result is an Error, throw a located error.
|
|
529
|
-
if (result instanceof Error) {
|
|
530
|
-
throw result;
|
|
531
|
-
}
|
|
532
|
-
// If field type is NonNull, complete for inner type, and throw field error
|
|
533
|
-
// if result is null.
|
|
534
|
-
if ((0, definition_js_1.isNonNullType)(returnType)) {
|
|
535
|
-
const completed = completeValue(exeContext, returnType.ofType, fieldDetailsList, info, path, result, incrementalContext, deferMap);
|
|
536
|
-
if (completed.rawResult === null) {
|
|
537
|
-
throw new Error(`Cannot return null for non-nullable field ${info.parentType}.${info.fieldName}.`);
|
|
538
|
-
}
|
|
539
|
-
return completed;
|
|
540
|
-
}
|
|
541
|
-
// If result value is null or undefined then return null.
|
|
542
|
-
if (result == null) {
|
|
543
|
-
return { rawResult: null, incrementalDataRecords: undefined };
|
|
544
|
-
}
|
|
545
|
-
// If field type is List, complete each item in the list with the inner type
|
|
546
|
-
if ((0, definition_js_1.isListType)(returnType)) {
|
|
547
|
-
return completeListValue(exeContext, returnType, fieldDetailsList, info, path, result, incrementalContext, deferMap);
|
|
548
|
-
}
|
|
549
|
-
// If field type is a leaf type, Scalar or Enum, coerce to a valid value,
|
|
550
|
-
// returning null if coercion is not possible.
|
|
551
|
-
if ((0, definition_js_1.isLeafType)(returnType)) {
|
|
552
|
-
return {
|
|
553
|
-
rawResult: completeLeafValue(returnType, result),
|
|
554
|
-
incrementalDataRecords: undefined,
|
|
555
|
-
};
|
|
556
|
-
}
|
|
557
|
-
// If field type is an abstract type, Interface or Union, determine the
|
|
558
|
-
// runtime Object type and complete for that type.
|
|
559
|
-
if ((0, definition_js_1.isAbstractType)(returnType)) {
|
|
560
|
-
return completeAbstractValue(exeContext, returnType, fieldDetailsList, info, path, result, incrementalContext, deferMap);
|
|
561
|
-
}
|
|
562
|
-
// If field type is Object, execute and complete all sub-selections.
|
|
563
|
-
if ((0, definition_js_1.isObjectType)(returnType)) {
|
|
564
|
-
return completeObjectValue(exeContext, returnType, fieldDetailsList, info, path, result, incrementalContext, deferMap);
|
|
565
|
-
}
|
|
566
|
-
/* c8 ignore next 6 */
|
|
567
|
-
// Not reachable, all possible output types have been considered.
|
|
568
|
-
(false) || (0, invariant_js_1.invariant)(false, 'Cannot complete value of unexpected output type: ' + (0, inspect_js_1.inspect)(returnType));
|
|
569
|
-
}
|
|
570
|
-
async function completePromisedValue(exeContext, returnType, fieldDetailsList, info, path, result, incrementalContext, deferMap) {
|
|
571
|
-
try {
|
|
572
|
-
const resolved = await result;
|
|
573
|
-
let completed = completeValue(exeContext, returnType, fieldDetailsList, info, path, resolved, incrementalContext, deferMap);
|
|
574
|
-
if ((0, isPromise_js_1.isPromise)(completed)) {
|
|
575
|
-
completed = await completed;
|
|
576
|
-
}
|
|
577
|
-
return completed;
|
|
578
|
-
}
|
|
579
|
-
catch (rawError) {
|
|
580
|
-
handleFieldError(rawError, exeContext, returnType, fieldDetailsList, path, incrementalContext);
|
|
581
|
-
return { rawResult: null, incrementalDataRecords: undefined };
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
/**
|
|
585
|
-
* Returns an object containing info for streaming if a field should be
|
|
586
|
-
* streamed based on the experimental flag, stream directive present and
|
|
587
|
-
* not disabled by the "if" argument.
|
|
588
|
-
*/
|
|
589
|
-
function getStreamUsage(validatedExecutionArgs, fieldDetailsList, path) {
|
|
590
|
-
// do not stream inner lists of multi-dimensional lists
|
|
591
|
-
if (typeof path.key === 'number') {
|
|
592
|
-
return;
|
|
593
|
-
}
|
|
594
|
-
// TODO: add test for this case (a streamed list nested under a list).
|
|
595
|
-
/* c8 ignore next 7 */
|
|
596
|
-
if (fieldDetailsList
|
|
597
|
-
._streamUsage !== undefined) {
|
|
598
|
-
return fieldDetailsList
|
|
599
|
-
._streamUsage;
|
|
600
|
-
}
|
|
601
|
-
const { operation, variableValues } = validatedExecutionArgs;
|
|
602
|
-
// validation only allows equivalent streams on multiple fields, so it is
|
|
603
|
-
// safe to only check the first fieldNode for the stream directive
|
|
604
|
-
const stream = (0, values_js_1.getDirectiveValues)(directives_js_1.GraphQLStreamDirective, fieldDetailsList[0].node, variableValues, fieldDetailsList[0].fragmentVariableValues);
|
|
605
|
-
if (!stream) {
|
|
606
|
-
return;
|
|
607
|
-
}
|
|
608
|
-
if (stream.if === false) {
|
|
609
|
-
return;
|
|
610
|
-
}
|
|
611
|
-
(typeof stream.initialCount === 'number') || (0, invariant_js_1.invariant)(false, 'initialCount must be a number');
|
|
612
|
-
(stream.initialCount >= 0) || (0, invariant_js_1.invariant)(false, 'initialCount must be a positive integer');
|
|
613
|
-
(operation.operation !== ast_js_1.OperationTypeNode.SUBSCRIPTION) || (0, invariant_js_1.invariant)(false, '`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.');
|
|
614
|
-
const streamedFieldDetailsList = fieldDetailsList.map((fieldDetails) => ({
|
|
615
|
-
node: fieldDetails.node,
|
|
616
|
-
deferUsage: undefined,
|
|
617
|
-
fragmentVariableValues: fieldDetails.fragmentVariableValues,
|
|
618
|
-
}));
|
|
619
|
-
const streamUsage = {
|
|
620
|
-
initialCount: stream.initialCount,
|
|
621
|
-
label: typeof stream.label === 'string' ? stream.label : undefined,
|
|
622
|
-
fieldDetailsList: streamedFieldDetailsList,
|
|
623
|
-
};
|
|
624
|
-
fieldDetailsList._streamUsage =
|
|
625
|
-
streamUsage;
|
|
626
|
-
return streamUsage;
|
|
627
|
-
}
|
|
628
|
-
/**
|
|
629
|
-
* Complete a async iterator value by completing the result and calling
|
|
630
|
-
* recursively until all the results are completed.
|
|
631
|
-
*/
|
|
632
|
-
async function completeAsyncIteratorValue(exeContext, itemType, fieldDetailsList, info, path, asyncIterator, incrementalContext, deferMap) {
|
|
633
|
-
let containsPromise = false;
|
|
634
|
-
const completedResults = [];
|
|
635
|
-
const graphqlWrappedResult = {
|
|
636
|
-
rawResult: completedResults,
|
|
637
|
-
incrementalDataRecords: undefined,
|
|
638
|
-
};
|
|
639
|
-
let index = 0;
|
|
640
|
-
const streamUsage = getStreamUsage(exeContext.validatedExecutionArgs, fieldDetailsList, path);
|
|
641
|
-
const earlyReturn = asyncIterator.return === undefined
|
|
642
|
-
? undefined
|
|
643
|
-
: asyncIterator.return.bind(asyncIterator);
|
|
644
|
-
try {
|
|
645
|
-
while (true) {
|
|
646
|
-
if (streamUsage && index >= streamUsage.initialCount) {
|
|
647
|
-
const streamItemQueue = buildAsyncStreamItemQueue(index, path, asyncIterator, exeContext, streamUsage.fieldDetailsList, info, itemType);
|
|
648
|
-
let streamRecord;
|
|
649
|
-
if (earlyReturn === undefined) {
|
|
650
|
-
streamRecord = {
|
|
651
|
-
label: streamUsage.label,
|
|
652
|
-
path,
|
|
653
|
-
streamItemQueue,
|
|
654
|
-
};
|
|
655
|
-
}
|
|
656
|
-
else {
|
|
657
|
-
streamRecord = {
|
|
658
|
-
label: streamUsage.label,
|
|
659
|
-
path,
|
|
660
|
-
earlyReturn,
|
|
661
|
-
streamItemQueue,
|
|
662
|
-
};
|
|
663
|
-
if (exeContext.cancellableStreams === undefined) {
|
|
664
|
-
exeContext.cancellableStreams = new Set();
|
|
665
|
-
}
|
|
666
|
-
exeContext.cancellableStreams.add(streamRecord);
|
|
667
|
-
}
|
|
668
|
-
addIncrementalDataRecords(graphqlWrappedResult, [streamRecord]);
|
|
669
|
-
break;
|
|
670
|
-
}
|
|
671
|
-
const itemPath = (0, Path_js_1.addPath)(path, index, undefined);
|
|
672
|
-
let iteration;
|
|
673
|
-
try {
|
|
674
|
-
// eslint-disable-next-line no-await-in-loop
|
|
675
|
-
iteration = await asyncIterator.next();
|
|
676
|
-
}
|
|
677
|
-
catch (rawError) {
|
|
678
|
-
throw (0, locatedError_js_1.locatedError)(rawError, toNodes(fieldDetailsList), (0, Path_js_1.pathToArray)(path));
|
|
679
|
-
}
|
|
680
|
-
// TODO: add test case for stream returning done before initialCount
|
|
681
|
-
/* c8 ignore next 3 */
|
|
682
|
-
if (iteration.done) {
|
|
683
|
-
break;
|
|
684
|
-
}
|
|
685
|
-
const item = iteration.value;
|
|
686
|
-
// TODO: add tests for stream backed by asyncIterator that returns a promise
|
|
687
|
-
/* c8 ignore start */
|
|
688
|
-
if ((0, isPromise_js_1.isPromise)(item)) {
|
|
689
|
-
completedResults.push(completePromisedListItemValue(item, graphqlWrappedResult, exeContext, itemType, fieldDetailsList, info, itemPath, incrementalContext, deferMap));
|
|
690
|
-
containsPromise = true;
|
|
691
|
-
}
|
|
692
|
-
else if (
|
|
693
|
-
/* c8 ignore stop */
|
|
694
|
-
completeListItemValue(item, completedResults, graphqlWrappedResult, exeContext, itemType, fieldDetailsList, info, itemPath, incrementalContext, deferMap)
|
|
695
|
-
// TODO: add tests for stream backed by asyncIterator that completes to a promise
|
|
696
|
-
/* c8 ignore start */
|
|
697
|
-
) {
|
|
698
|
-
containsPromise = true;
|
|
699
|
-
}
|
|
700
|
-
/* c8 ignore stop */
|
|
701
|
-
index++;
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
catch (error) {
|
|
705
|
-
if (earlyReturn !== undefined) {
|
|
706
|
-
earlyReturn().catch(() => {
|
|
707
|
-
/* c8 ignore next 1 */
|
|
708
|
-
// ignore error
|
|
709
|
-
});
|
|
710
|
-
}
|
|
711
|
-
throw error;
|
|
712
|
-
}
|
|
713
|
-
return containsPromise
|
|
714
|
-
? /* c8 ignore start */ Promise.all(completedResults).then((resolved) => ({
|
|
715
|
-
rawResult: resolved,
|
|
716
|
-
incrementalDataRecords: graphqlWrappedResult.incrementalDataRecords,
|
|
717
|
-
}))
|
|
718
|
-
: /* c8 ignore stop */ graphqlWrappedResult;
|
|
719
|
-
}
|
|
720
|
-
/**
|
|
721
|
-
* Complete a list value by completing each item in the list with the
|
|
722
|
-
* inner type
|
|
723
|
-
*/
|
|
724
|
-
function completeListValue(exeContext, returnType, fieldDetailsList, info, path, result, incrementalContext, deferMap) {
|
|
725
|
-
const itemType = returnType.ofType;
|
|
726
|
-
if ((0, isAsyncIterable_js_1.isAsyncIterable)(result)) {
|
|
727
|
-
const abortSignalListener = exeContext.abortSignalListener;
|
|
728
|
-
const maybeCancellableIterable = abortSignalListener
|
|
729
|
-
? (0, AbortSignalListener_js_1.cancellableIterable)(result, abortSignalListener)
|
|
730
|
-
: result;
|
|
731
|
-
const asyncIterator = maybeCancellableIterable[Symbol.asyncIterator]();
|
|
732
|
-
return completeAsyncIteratorValue(exeContext, itemType, fieldDetailsList, info, path, asyncIterator, incrementalContext, deferMap);
|
|
733
|
-
}
|
|
734
|
-
if (!(0, isIterableObject_js_1.isIterableObject)(result)) {
|
|
735
|
-
throw new GraphQLError_js_1.GraphQLError(`Expected Iterable, but did not find one for field "${info.parentType}.${info.fieldName}".`);
|
|
736
|
-
}
|
|
737
|
-
return completeIterableValue(exeContext, itemType, fieldDetailsList, info, path, result, incrementalContext, deferMap);
|
|
738
|
-
}
|
|
739
|
-
function completeIterableValue(exeContext, itemType, fieldDetailsList, info, path, items, incrementalContext, deferMap) {
|
|
740
|
-
// This is specified as a simple map, however we're optimizing the path
|
|
741
|
-
// where the list contains no Promises by avoiding creating another Promise.
|
|
742
|
-
let containsPromise = false;
|
|
743
|
-
const completedResults = [];
|
|
744
|
-
const graphqlWrappedResult = {
|
|
745
|
-
rawResult: completedResults,
|
|
746
|
-
incrementalDataRecords: undefined,
|
|
301
|
+
errorPropagation,
|
|
302
|
+
externalAbortSignal: externalAbortSignal ?? undefined,
|
|
303
|
+
enableEarlyExecution: enableEarlyExecution === true,
|
|
304
|
+
hooks: hooks ?? undefined,
|
|
747
305
|
};
|
|
748
|
-
let index = 0;
|
|
749
|
-
const streamUsage = getStreamUsage(exeContext.validatedExecutionArgs, fieldDetailsList, path);
|
|
750
|
-
const iterator = items[Symbol.iterator]();
|
|
751
|
-
let iteration = iterator.next();
|
|
752
|
-
while (!iteration.done) {
|
|
753
|
-
const item = iteration.value;
|
|
754
|
-
if (streamUsage && index >= streamUsage.initialCount) {
|
|
755
|
-
const syncStreamRecord = {
|
|
756
|
-
label: streamUsage.label,
|
|
757
|
-
path,
|
|
758
|
-
streamItemQueue: buildSyncStreamItemQueue(item, index, path, iterator, exeContext, streamUsage.fieldDetailsList, info, itemType),
|
|
759
|
-
};
|
|
760
|
-
addIncrementalDataRecords(graphqlWrappedResult, [syncStreamRecord]);
|
|
761
|
-
break;
|
|
762
|
-
}
|
|
763
|
-
// No need to modify the info object containing the path,
|
|
764
|
-
// since from here on it is not ever accessed by resolver functions.
|
|
765
|
-
const itemPath = (0, Path_js_1.addPath)(path, index, undefined);
|
|
766
|
-
if ((0, isPromise_js_1.isPromise)(item)) {
|
|
767
|
-
completedResults.push(completePromisedListItemValue(item, graphqlWrappedResult, exeContext, itemType, fieldDetailsList, info, itemPath, incrementalContext, deferMap));
|
|
768
|
-
containsPromise = true;
|
|
769
|
-
}
|
|
770
|
-
else if (completeListItemValue(item, completedResults, graphqlWrappedResult, exeContext, itemType, fieldDetailsList, info, itemPath, incrementalContext, deferMap)) {
|
|
771
|
-
containsPromise = true;
|
|
772
|
-
}
|
|
773
|
-
index++;
|
|
774
|
-
iteration = iterator.next();
|
|
775
|
-
}
|
|
776
|
-
return containsPromise
|
|
777
|
-
? Promise.all(completedResults).then((resolved) => ({
|
|
778
|
-
rawResult: resolved,
|
|
779
|
-
incrementalDataRecords: graphqlWrappedResult.incrementalDataRecords,
|
|
780
|
-
}))
|
|
781
|
-
: graphqlWrappedResult;
|
|
782
|
-
}
|
|
783
|
-
/**
|
|
784
|
-
* Complete a list item value by adding it to the completed results.
|
|
785
|
-
*
|
|
786
|
-
* Returns true if the value is a Promise.
|
|
787
|
-
*/
|
|
788
|
-
function completeListItemValue(item, completedResults, parent, exeContext, itemType, fieldDetailsList, info, itemPath, incrementalContext, deferMap) {
|
|
789
|
-
try {
|
|
790
|
-
const completedItem = completeValue(exeContext, itemType, fieldDetailsList, info, itemPath, item, incrementalContext, deferMap);
|
|
791
|
-
if ((0, isPromise_js_1.isPromise)(completedItem)) {
|
|
792
|
-
// Note: we don't rely on a `catch` method, but we do expect "thenable"
|
|
793
|
-
// to take a second callback for the error case.
|
|
794
|
-
completedResults.push(completedItem.then((resolved) => {
|
|
795
|
-
addIncrementalDataRecords(parent, resolved.incrementalDataRecords);
|
|
796
|
-
return resolved.rawResult;
|
|
797
|
-
}, (rawError) => {
|
|
798
|
-
handleFieldError(rawError, exeContext, itemType, fieldDetailsList, itemPath, incrementalContext);
|
|
799
|
-
return null;
|
|
800
|
-
}));
|
|
801
|
-
return true;
|
|
802
|
-
}
|
|
803
|
-
completedResults.push(completedItem.rawResult);
|
|
804
|
-
addIncrementalDataRecords(parent, completedItem.incrementalDataRecords);
|
|
805
|
-
}
|
|
806
|
-
catch (rawError) {
|
|
807
|
-
handleFieldError(rawError, exeContext, itemType, fieldDetailsList, itemPath, incrementalContext);
|
|
808
|
-
completedResults.push(null);
|
|
809
|
-
}
|
|
810
|
-
return false;
|
|
811
|
-
}
|
|
812
|
-
async function completePromisedListItemValue(item, parent, exeContext, itemType, fieldDetailsList, info, itemPath, incrementalContext, deferMap) {
|
|
813
|
-
try {
|
|
814
|
-
const abortSignalListener = exeContext.abortSignalListener;
|
|
815
|
-
const maybeCancellableItem = abortSignalListener
|
|
816
|
-
? (0, AbortSignalListener_js_1.cancellablePromise)(item, abortSignalListener)
|
|
817
|
-
: item;
|
|
818
|
-
const resolved = await maybeCancellableItem;
|
|
819
|
-
let completed = completeValue(exeContext, itemType, fieldDetailsList, info, itemPath, resolved, incrementalContext, deferMap);
|
|
820
|
-
if ((0, isPromise_js_1.isPromise)(completed)) {
|
|
821
|
-
completed = await completed;
|
|
822
|
-
}
|
|
823
|
-
addIncrementalDataRecords(parent, completed.incrementalDataRecords);
|
|
824
|
-
return completed.rawResult;
|
|
825
|
-
}
|
|
826
|
-
catch (rawError) {
|
|
827
|
-
handleFieldError(rawError, exeContext, itemType, fieldDetailsList, itemPath, incrementalContext);
|
|
828
|
-
return null;
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
/**
|
|
832
|
-
* Complete a Scalar or Enum by serializing to a valid value, returning
|
|
833
|
-
* null if serialization is not possible.
|
|
834
|
-
*/
|
|
835
|
-
function completeLeafValue(returnType, result) {
|
|
836
|
-
const coerced = returnType.coerceOutputValue(result);
|
|
837
|
-
if (coerced == null) {
|
|
838
|
-
throw new Error(`Expected \`${(0, inspect_js_1.inspect)(returnType)}.coerceOutputValue(${(0, inspect_js_1.inspect)(result)})\` to ` +
|
|
839
|
-
`return non-nullable value, returned: ${(0, inspect_js_1.inspect)(coerced)}`);
|
|
840
|
-
}
|
|
841
|
-
return coerced;
|
|
842
|
-
}
|
|
843
|
-
/**
|
|
844
|
-
* Complete a value of an abstract type by determining the runtime object type
|
|
845
|
-
* of that value, then complete the value for that type.
|
|
846
|
-
*/
|
|
847
|
-
function completeAbstractValue(exeContext, returnType, fieldDetailsList, info, path, result, incrementalContext, deferMap) {
|
|
848
|
-
const validatedExecutionArgs = exeContext.validatedExecutionArgs;
|
|
849
|
-
const { schema, contextValue } = validatedExecutionArgs;
|
|
850
|
-
const resolveTypeFn = returnType.resolveType ?? validatedExecutionArgs.typeResolver;
|
|
851
|
-
const runtimeType = resolveTypeFn(result, contextValue, info, returnType);
|
|
852
|
-
if ((0, isPromise_js_1.isPromise)(runtimeType)) {
|
|
853
|
-
return runtimeType.then((resolvedRuntimeType) => completeObjectValue(exeContext, ensureValidRuntimeType(resolvedRuntimeType, schema, returnType, fieldDetailsList, info, result), fieldDetailsList, info, path, result, incrementalContext, deferMap));
|
|
854
|
-
}
|
|
855
|
-
return completeObjectValue(exeContext, ensureValidRuntimeType(runtimeType, schema, returnType, fieldDetailsList, info, result), fieldDetailsList, info, path, result, incrementalContext, deferMap);
|
|
856
|
-
}
|
|
857
|
-
function ensureValidRuntimeType(runtimeTypeName, schema, returnType, fieldDetailsList, info, result) {
|
|
858
|
-
if (runtimeTypeName == null) {
|
|
859
|
-
throw new GraphQLError_js_1.GraphQLError(`Abstract type "${returnType}" must resolve to an Object type at runtime for field "${info.parentType}.${info.fieldName}". Either the "${returnType}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`, { nodes: toNodes(fieldDetailsList) });
|
|
860
|
-
}
|
|
861
|
-
if (typeof runtimeTypeName !== 'string') {
|
|
862
|
-
throw new GraphQLError_js_1.GraphQLError(`Abstract type "${returnType}" must resolve to an Object type at runtime for field "${info.parentType}.${info.fieldName}" with ` +
|
|
863
|
-
`value ${(0, inspect_js_1.inspect)(result)}, received "${(0, inspect_js_1.inspect)(runtimeTypeName)}", which is not a valid Object type name.`);
|
|
864
|
-
}
|
|
865
|
-
const runtimeType = schema.getType(runtimeTypeName);
|
|
866
|
-
if (runtimeType == null) {
|
|
867
|
-
throw new GraphQLError_js_1.GraphQLError(`Abstract type "${returnType}" was resolved to a type "${runtimeTypeName}" that does not exist inside the schema.`, { nodes: toNodes(fieldDetailsList) });
|
|
868
|
-
}
|
|
869
|
-
if (!(0, definition_js_1.isObjectType)(runtimeType)) {
|
|
870
|
-
throw new GraphQLError_js_1.GraphQLError(`Abstract type "${returnType}" was resolved to a non-object type "${runtimeTypeName}".`, { nodes: toNodes(fieldDetailsList) });
|
|
871
|
-
}
|
|
872
|
-
if (!schema.isSubType(returnType, runtimeType)) {
|
|
873
|
-
throw new GraphQLError_js_1.GraphQLError(`Runtime Object type "${runtimeType}" is not a possible type for "${returnType}".`, { nodes: toNodes(fieldDetailsList) });
|
|
874
|
-
}
|
|
875
|
-
return runtimeType;
|
|
876
|
-
}
|
|
877
|
-
/**
|
|
878
|
-
* Complete an Object value by executing all sub-selections.
|
|
879
|
-
*/
|
|
880
|
-
function completeObjectValue(exeContext, returnType, fieldDetailsList, info, path, result, incrementalContext, deferMap) {
|
|
881
|
-
if ((incrementalContext ?? exeContext).completed) {
|
|
882
|
-
throw new Error('Completed, aborting.');
|
|
883
|
-
}
|
|
884
|
-
// If there is an isTypeOf predicate function, call it with the
|
|
885
|
-
// current result. If isTypeOf returns false, then raise an error rather
|
|
886
|
-
// than continuing execution.
|
|
887
|
-
if (returnType.isTypeOf) {
|
|
888
|
-
const isTypeOf = returnType.isTypeOf(result, exeContext.validatedExecutionArgs.contextValue, info);
|
|
889
|
-
if ((0, isPromise_js_1.isPromise)(isTypeOf)) {
|
|
890
|
-
return isTypeOf.then((resolvedIsTypeOf) => {
|
|
891
|
-
if (!resolvedIsTypeOf) {
|
|
892
|
-
throw invalidReturnTypeError(returnType, result, fieldDetailsList);
|
|
893
|
-
}
|
|
894
|
-
return collectAndExecuteSubfields(exeContext, returnType, fieldDetailsList, path, result, incrementalContext, deferMap);
|
|
895
|
-
});
|
|
896
|
-
}
|
|
897
|
-
if (!isTypeOf) {
|
|
898
|
-
throw invalidReturnTypeError(returnType, result, fieldDetailsList);
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
return collectAndExecuteSubfields(exeContext, returnType, fieldDetailsList, path, result, incrementalContext, deferMap);
|
|
902
306
|
}
|
|
903
|
-
function
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
* Instantiates new DeferredFragmentRecords for the given path within an
|
|
908
|
-
* incremental data record, returning an updated map of DeferUsage
|
|
909
|
-
* objects to DeferredFragmentRecords.
|
|
910
|
-
*
|
|
911
|
-
* Note: As defer directives may be used with operations returning lists,
|
|
912
|
-
* a DeferUsage object may correspond to many DeferredFragmentRecords.
|
|
913
|
-
*/
|
|
914
|
-
function getNewDeferMap(newDeferUsages, deferMap, path) {
|
|
915
|
-
const newDeferMap = new Map(deferMap);
|
|
916
|
-
// For each new deferUsage object:
|
|
917
|
-
for (const newDeferUsage of newDeferUsages) {
|
|
918
|
-
const parentDeferUsage = newDeferUsage.parentDeferUsage;
|
|
919
|
-
const parent = parentDeferUsage === undefined
|
|
920
|
-
? undefined
|
|
921
|
-
: deferredFragmentRecordFromDeferUsage(parentDeferUsage, newDeferMap);
|
|
922
|
-
// Instantiate the new record.
|
|
923
|
-
const deferredFragmentRecord = new types_js_1.DeferredFragmentRecord(path, newDeferUsage.label, parent);
|
|
924
|
-
// Update the map.
|
|
925
|
-
newDeferMap.set(newDeferUsage, deferredFragmentRecord);
|
|
926
|
-
}
|
|
927
|
-
return newDeferMap;
|
|
928
|
-
}
|
|
929
|
-
function deferredFragmentRecordFromDeferUsage(deferUsage, deferMap) {
|
|
930
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
931
|
-
return deferMap.get(deferUsage);
|
|
932
|
-
}
|
|
933
|
-
function collectAndExecuteSubfields(exeContext, returnType, fieldDetailsList, path, result, incrementalContext, deferMap) {
|
|
934
|
-
const validatedExecutionArgs = exeContext.validatedExecutionArgs;
|
|
935
|
-
// Collect sub-fields to execute to complete this value.
|
|
936
|
-
const collectedSubfields = collectSubfields(validatedExecutionArgs, returnType, fieldDetailsList);
|
|
937
|
-
const { groupedFieldSet, newDeferUsages } = collectedSubfields;
|
|
938
|
-
if (newDeferUsages.length > 0) {
|
|
939
|
-
(validatedExecutionArgs.operation.operation !==
|
|
940
|
-
ast_js_1.OperationTypeNode.SUBSCRIPTION) || (0, invariant_js_1.invariant)(false, '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.');
|
|
941
|
-
}
|
|
942
|
-
return executeSubExecutionPlan(exeContext, returnType, result, groupedFieldSet, newDeferUsages, path, incrementalContext, deferMap);
|
|
943
|
-
}
|
|
944
|
-
function executeSubExecutionPlan(exeContext, returnType, sourceValue, originalGroupedFieldSet, newDeferUsages, path, incrementalContext, deferMap) {
|
|
945
|
-
if (deferMap === undefined && newDeferUsages.length === 0) {
|
|
946
|
-
return executeFields(exeContext, returnType, sourceValue, path, originalGroupedFieldSet, incrementalContext, deferMap);
|
|
947
|
-
}
|
|
948
|
-
const newDeferMap = getNewDeferMap(newDeferUsages, deferMap, path);
|
|
949
|
-
const { groupedFieldSet, newGroupedFieldSets } = buildSubExecutionPlan(originalGroupedFieldSet, incrementalContext?.deferUsageSet);
|
|
950
|
-
const graphqlWrappedResult = executeFields(exeContext, returnType, sourceValue, path, groupedFieldSet, incrementalContext, newDeferMap);
|
|
951
|
-
if (newGroupedFieldSets.size > 0) {
|
|
952
|
-
const newPendingExecutionGroups = collectExecutionGroups(exeContext, returnType, sourceValue, path, incrementalContext?.deferUsageSet, newGroupedFieldSets, newDeferMap);
|
|
953
|
-
return withNewExecutionGroups(graphqlWrappedResult, newPendingExecutionGroups);
|
|
307
|
+
function validateSubscriptionArgs(args) {
|
|
308
|
+
const validatedExecutionArgs = validateExecutionArgs(args);
|
|
309
|
+
if (!('schema' in validatedExecutionArgs)) {
|
|
310
|
+
return validatedExecutionArgs;
|
|
954
311
|
}
|
|
955
|
-
|
|
312
|
+
assertSubscriptionExecutionArgs(validatedExecutionArgs);
|
|
313
|
+
return validatedExecutionArgs;
|
|
956
314
|
}
|
|
957
|
-
function
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
return executionPlan;
|
|
315
|
+
function assertSubscriptionExecutionArgs(validatedExecutionArgs) {
|
|
316
|
+
if (!(0, predicates_js_1.isSubscriptionOperationDefinitionNode)(validatedExecutionArgs.operation)) {
|
|
317
|
+
throw new GraphQLError_js_1.GraphQLError('Expected subscription operation.');
|
|
961
318
|
}
|
|
962
|
-
executionPlan = (0, buildExecutionPlan_js_1.buildExecutionPlan)(originalGroupedFieldSet, deferUsageSet);
|
|
963
|
-
originalGroupedFieldSet._executionPlan = executionPlan;
|
|
964
|
-
return executionPlan;
|
|
965
319
|
}
|
|
966
320
|
/**
|
|
967
321
|
* If a resolveType function is not given, then a default resolve behavior is
|
|
@@ -981,25 +335,34 @@ const defaultTypeResolver = function (value, contextValue, info, abstractType) {
|
|
|
981
335
|
// Otherwise, test each possible type.
|
|
982
336
|
const possibleTypes = info.schema.getPossibleTypes(abstractType);
|
|
983
337
|
const promisedIsTypeOfResults = [];
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
if (
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
}
|
|
338
|
+
try {
|
|
339
|
+
for (let i = 0; i < possibleTypes.length; i++) {
|
|
340
|
+
const type = possibleTypes[i];
|
|
341
|
+
if (type.isTypeOf) {
|
|
342
|
+
const isTypeOfResult = type.isTypeOf(value, contextValue, info);
|
|
343
|
+
if ((0, isPromise_js_1.isPromiseLike)(isTypeOfResult)) {
|
|
344
|
+
promisedIsTypeOfResults[i] = isTypeOfResult;
|
|
345
|
+
}
|
|
346
|
+
else if (isTypeOfResult) {
|
|
347
|
+
if (promisedIsTypeOfResults.length) {
|
|
348
|
+
info.getAsyncHelpers().track(promisedIsTypeOfResults);
|
|
349
|
+
}
|
|
350
|
+
return type.name;
|
|
996
351
|
}
|
|
997
|
-
return type.name;
|
|
998
352
|
}
|
|
999
353
|
}
|
|
1000
354
|
}
|
|
355
|
+
catch (error) {
|
|
356
|
+
if (promisedIsTypeOfResults.length) {
|
|
357
|
+
info.getAsyncHelpers().track(promisedIsTypeOfResults);
|
|
358
|
+
}
|
|
359
|
+
throw error;
|
|
360
|
+
}
|
|
1001
361
|
if (promisedIsTypeOfResults.length) {
|
|
1002
|
-
return
|
|
362
|
+
return info
|
|
363
|
+
.getAsyncHelpers()
|
|
364
|
+
.promiseAll(promisedIsTypeOfResults)
|
|
365
|
+
.then((isTypeOfResults) => {
|
|
1003
366
|
for (let i = 0; i < isTypeOfResults.length; i++) {
|
|
1004
367
|
if (isTypeOfResults[i]) {
|
|
1005
368
|
return possibleTypes[i].name;
|
|
@@ -1015,136 +378,44 @@ exports.defaultTypeResolver = defaultTypeResolver;
|
|
|
1015
378
|
* and returns it as the result, or if it's a function, returns the result
|
|
1016
379
|
* of calling that function while passing along args and context value.
|
|
1017
380
|
*/
|
|
1018
|
-
const defaultFieldResolver = function (source, args, contextValue, info
|
|
381
|
+
const defaultFieldResolver = function (source, args, contextValue, info) {
|
|
1019
382
|
// ensure source is a value for which property access is acceptable.
|
|
1020
383
|
if ((0, isObjectLike_js_1.isObjectLike)(source) || typeof source === 'function') {
|
|
1021
384
|
const property = source[info.fieldName];
|
|
1022
385
|
if (typeof property === 'function') {
|
|
1023
|
-
return source[info.fieldName](args, contextValue, info
|
|
386
|
+
return source[info.fieldName](args, contextValue, info);
|
|
1024
387
|
}
|
|
1025
388
|
return property;
|
|
1026
389
|
}
|
|
1027
390
|
};
|
|
1028
391
|
exports.defaultFieldResolver = defaultFieldResolver;
|
|
1029
|
-
/**
|
|
1030
|
-
* Implements the "Subscribe" algorithm described in the GraphQL specification.
|
|
1031
|
-
*
|
|
1032
|
-
* Returns a Promise which resolves to either an AsyncIterator (if successful)
|
|
1033
|
-
* or an ExecutionResult (error). The promise will be rejected if the schema or
|
|
1034
|
-
* other arguments to this function are invalid, or if the resolved event stream
|
|
1035
|
-
* is not an async iterable.
|
|
1036
|
-
*
|
|
1037
|
-
* If the client-provided arguments to this function do not result in a
|
|
1038
|
-
* compliant subscription, a GraphQL Response (ExecutionResult) with descriptive
|
|
1039
|
-
* errors and no data will be returned.
|
|
1040
|
-
*
|
|
1041
|
-
* If the source stream could not be created due to faulty subscription resolver
|
|
1042
|
-
* logic or underlying systems, the promise will resolve to a single
|
|
1043
|
-
* ExecutionResult containing `errors` and no `data`.
|
|
1044
|
-
*
|
|
1045
|
-
* If the operation succeeded, the promise resolves to an AsyncIterator, which
|
|
1046
|
-
* yields a stream of ExecutionResults representing the response stream.
|
|
1047
|
-
*
|
|
1048
|
-
* This function does not support incremental delivery (`@defer` and `@stream`).
|
|
1049
|
-
* If an operation which would defer or stream data is executed with this
|
|
1050
|
-
* function, a field error will be raised at the location of the `@defer` or
|
|
1051
|
-
* `@stream` directive.
|
|
1052
|
-
*
|
|
1053
|
-
* Accepts an object with named arguments.
|
|
1054
|
-
*/
|
|
1055
|
-
function subscribe(args) {
|
|
1056
|
-
// If a valid execution context cannot be created due to incorrect arguments,
|
|
1057
|
-
// a "Response" with only errors is returned.
|
|
1058
|
-
const validatedExecutionArgs = validateExecutionArgs(args);
|
|
1059
|
-
// Return early errors if execution context failed.
|
|
1060
|
-
if (!('schema' in validatedExecutionArgs)) {
|
|
1061
|
-
return { errors: validatedExecutionArgs };
|
|
1062
|
-
}
|
|
1063
|
-
const resultOrStream = createSourceEventStreamImpl(validatedExecutionArgs);
|
|
1064
|
-
if ((0, isPromise_js_1.isPromise)(resultOrStream)) {
|
|
1065
|
-
return resultOrStream.then((resolvedResultOrStream) => mapSourceToResponse(validatedExecutionArgs, resolvedResultOrStream));
|
|
1066
|
-
}
|
|
1067
|
-
return mapSourceToResponse(validatedExecutionArgs, resultOrStream);
|
|
1068
|
-
}
|
|
1069
392
|
function mapSourceToResponse(validatedExecutionArgs, resultOrStream) {
|
|
1070
393
|
if (!(0, isAsyncIterable_js_1.isAsyncIterable)(resultOrStream)) {
|
|
1071
394
|
return resultOrStream;
|
|
1072
395
|
}
|
|
1073
|
-
const abortSignal = validatedExecutionArgs.abortSignal;
|
|
1074
|
-
const abortSignalListener = abortSignal
|
|
1075
|
-
? new AbortSignalListener_js_1.AbortSignalListener(abortSignal)
|
|
1076
|
-
: undefined;
|
|
1077
396
|
// For each payload yielded from a subscription, map it over the normal
|
|
1078
397
|
// GraphQL `execute` function, with `payload` as the rootValue.
|
|
1079
398
|
// This implements the "MapSourceToResponseEvent" algorithm described in
|
|
1080
399
|
// the GraphQL specification..
|
|
1081
|
-
|
|
1082
|
-
? (0, AbortSignalListener_js_1.cancellableIterable)(resultOrStream, abortSignalListener)
|
|
1083
|
-
: resultOrStream, (payload) => {
|
|
400
|
+
function mapFn(payload) {
|
|
1084
401
|
const perEventExecutionArgs = {
|
|
1085
402
|
...validatedExecutionArgs,
|
|
1086
403
|
rootValue: payload,
|
|
1087
404
|
};
|
|
1088
405
|
return validatedExecutionArgs.perEventExecutor(perEventExecutionArgs);
|
|
1089
|
-
}, () => abortSignalListener?.disconnect());
|
|
1090
|
-
}
|
|
1091
|
-
function executeSubscriptionEvent(validatedExecutionArgs) {
|
|
1092
|
-
return executeQueryOrMutationOrSubscriptionEvent(validatedExecutionArgs);
|
|
1093
|
-
}
|
|
1094
|
-
/**
|
|
1095
|
-
* Implements the "CreateSourceEventStream" algorithm described in the
|
|
1096
|
-
* GraphQL specification, resolving the subscription source event stream.
|
|
1097
|
-
*
|
|
1098
|
-
* Returns a Promise which resolves to either an AsyncIterable (if successful)
|
|
1099
|
-
* or an ExecutionResult (error). The promise will be rejected if the schema or
|
|
1100
|
-
* other arguments to this function are invalid, or if the resolved event stream
|
|
1101
|
-
* is not an async iterable.
|
|
1102
|
-
*
|
|
1103
|
-
* If the client-provided arguments to this function do not result in a
|
|
1104
|
-
* compliant subscription, a GraphQL Response (ExecutionResult) with
|
|
1105
|
-
* descriptive errors and no data will be returned.
|
|
1106
|
-
*
|
|
1107
|
-
* If the the source stream could not be created due to faulty subscription
|
|
1108
|
-
* resolver logic or underlying systems, the promise will resolve to a single
|
|
1109
|
-
* ExecutionResult containing `errors` and no `data`.
|
|
1110
|
-
*
|
|
1111
|
-
* If the operation succeeded, the promise resolves to the AsyncIterable for the
|
|
1112
|
-
* event stream returned by the resolver.
|
|
1113
|
-
*
|
|
1114
|
-
* A Source Event Stream represents a sequence of events, each of which triggers
|
|
1115
|
-
* a GraphQL execution for that event.
|
|
1116
|
-
*
|
|
1117
|
-
* This may be useful when hosting the stateful subscription service in a
|
|
1118
|
-
* different process or machine than the stateless GraphQL execution engine,
|
|
1119
|
-
* or otherwise separating these two steps. For more on this, see the
|
|
1120
|
-
* "Supporting Subscriptions at Scale" information in the GraphQL specification.
|
|
1121
|
-
*/
|
|
1122
|
-
function createSourceEventStream(args) {
|
|
1123
|
-
// If a valid execution context cannot be created due to incorrect arguments,
|
|
1124
|
-
// a "Response" with only errors is returned.
|
|
1125
|
-
const validatedExecutionArgs = validateExecutionArgs(args);
|
|
1126
|
-
// Return early errors if execution context failed.
|
|
1127
|
-
if (!('schema' in validatedExecutionArgs)) {
|
|
1128
|
-
return { errors: validatedExecutionArgs };
|
|
1129
406
|
}
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
errors: [error],
|
|
1138
|
-
}));
|
|
1139
|
-
}
|
|
1140
|
-
return eventStream;
|
|
1141
|
-
}
|
|
1142
|
-
catch (error) {
|
|
1143
|
-
return { errors: [error] };
|
|
407
|
+
const externalAbortSignal = validatedExecutionArgs.externalAbortSignal;
|
|
408
|
+
if (externalAbortSignal) {
|
|
409
|
+
const generator = (0, mapAsyncIterable_js_1.mapAsyncIterable)(resultOrStream, mapFn);
|
|
410
|
+
return {
|
|
411
|
+
...generator,
|
|
412
|
+
next: () => (0, cancellablePromise_js_1.cancellablePromise)(generator.next(), externalAbortSignal),
|
|
413
|
+
};
|
|
1144
414
|
}
|
|
415
|
+
return (0, mapAsyncIterable_js_1.mapAsyncIterable)(resultOrStream, mapFn);
|
|
1145
416
|
}
|
|
1146
417
|
function executeSubscription(validatedExecutionArgs) {
|
|
1147
|
-
const { schema, fragments, rootValue, contextValue, operation, variableValues, hideSuggestions,
|
|
418
|
+
const { schema, fragments, rootValue, contextValue, operation, variableValues, hideSuggestions, externalAbortSignal, } = validatedExecutionArgs;
|
|
1148
419
|
const rootType = schema.getSubscriptionType();
|
|
1149
420
|
if (rootType == null) {
|
|
1150
421
|
throw new GraphQLError_js_1.GraphQLError('Schema is not configured to execute subscription operation.', { nodes: operation });
|
|
@@ -1152,40 +423,39 @@ function executeSubscription(validatedExecutionArgs) {
|
|
|
1152
423
|
const { groupedFieldSet } = (0, collectFields_js_1.collectFields)(schema, fragments, variableValues, rootType, operation.selectionSet, hideSuggestions);
|
|
1153
424
|
const firstRootField = groupedFieldSet.entries().next().value;
|
|
1154
425
|
const [responseName, fieldDetailsList] = firstRootField;
|
|
1155
|
-
const
|
|
426
|
+
const firstFieldDetails = fieldDetailsList[0];
|
|
427
|
+
const firstNode = firstFieldDetails.node;
|
|
428
|
+
const fieldName = firstNode.name.value;
|
|
1156
429
|
const fieldDef = schema.getField(rootType, fieldName);
|
|
1157
430
|
const fieldNodes = fieldDetailsList.map((fieldDetails) => fieldDetails.node);
|
|
1158
431
|
if (!fieldDef) {
|
|
1159
432
|
throw new GraphQLError_js_1.GraphQLError(`The subscription field "${fieldName}" is not defined.`, { nodes: fieldNodes });
|
|
1160
433
|
}
|
|
434
|
+
const sharedExecutionContext = (0, createSharedExecutionContext_js_1.createSharedExecutionContext)(externalAbortSignal);
|
|
1161
435
|
const path = (0, Path_js_1.addPath)(undefined, responseName, rootType.name);
|
|
1162
|
-
const info = buildResolveInfo(validatedExecutionArgs, fieldDef, fieldNodes, rootType, path);
|
|
436
|
+
const info = buildResolveInfo(validatedExecutionArgs, fieldDef, fieldNodes, rootType, path, sharedExecutionContext.getAbortSignal, sharedExecutionContext.getAsyncHelpers);
|
|
1163
437
|
try {
|
|
1164
438
|
// Implements the "ResolveFieldEventStream" algorithm from GraphQL specification.
|
|
1165
439
|
// It differs from "ResolveFieldValue" due to providing a different `resolveFn`.
|
|
1166
440
|
// Build a JS object of arguments from the field.arguments AST, using the
|
|
1167
441
|
// variables scope to fulfill any variable references.
|
|
1168
|
-
const args = (0, values_js_1.getArgumentValues)(fieldDef,
|
|
442
|
+
const args = (0, values_js_1.getArgumentValues)(fieldDef, firstNode, variableValues, firstFieldDetails.fragmentVariableValues, hideSuggestions);
|
|
1169
443
|
// Call the `subscribe()` resolver or the default resolver to produce an
|
|
1170
444
|
// AsyncIterable yielding raw payloads.
|
|
1171
445
|
const resolveFn = fieldDef.subscribe ?? validatedExecutionArgs.subscribeFieldResolver;
|
|
1172
446
|
// The resolve function's optional third argument is a context value that
|
|
1173
447
|
// is provided to every resolve function within an execution. It is commonly
|
|
1174
448
|
// used to represent an authenticated user, or request-specific caches.
|
|
1175
|
-
const result = resolveFn(rootValue, args, contextValue, info
|
|
1176
|
-
if ((0, isPromise_js_1.
|
|
1177
|
-
const
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
return resolved;
|
|
1186
|
-
}, (error) => {
|
|
1187
|
-
abortSignalListener?.disconnect();
|
|
1188
|
-
throw (0, locatedError_js_1.locatedError)(error, fieldNodes, (0, Path_js_1.pathToArray)(path));
|
|
449
|
+
const result = resolveFn(rootValue, args, contextValue, info);
|
|
450
|
+
if ((0, isPromise_js_1.isPromiseLike)(result)) {
|
|
451
|
+
const promisedResult = Promise.resolve(result);
|
|
452
|
+
const promise = externalAbortSignal
|
|
453
|
+
? (0, cancellablePromise_js_1.cancellablePromise)(promisedResult, externalAbortSignal)
|
|
454
|
+
: promisedResult;
|
|
455
|
+
return promise
|
|
456
|
+
.then(assertEventStream)
|
|
457
|
+
.then(undefined, (error) => {
|
|
458
|
+
throw (0, locatedError_js_1.locatedError)(error, toNodes(fieldDetailsList), (0, Path_js_1.pathToArray)(path));
|
|
1189
459
|
});
|
|
1190
460
|
}
|
|
1191
461
|
return assertEventStream(result);
|
|
@@ -1205,204 +475,31 @@ function assertEventStream(result) {
|
|
|
1205
475
|
}
|
|
1206
476
|
return result;
|
|
1207
477
|
}
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
errors: undefined,
|
|
1218
|
-
completed: false,
|
|
1219
|
-
deferUsageSet,
|
|
1220
|
-
}, deferMap);
|
|
1221
|
-
if (exeContext.validatedExecutionArgs.enableEarlyExecution) {
|
|
1222
|
-
pendingExecutionGroup.result = new BoxedPromiseOrValue_js_1.BoxedPromiseOrValue(shouldDefer(parentDeferUsages, deferUsageSet)
|
|
1223
|
-
? Promise.resolve().then(executor)
|
|
1224
|
-
: executor());
|
|
1225
|
-
}
|
|
1226
|
-
else {
|
|
1227
|
-
pendingExecutionGroup.result = () => new BoxedPromiseOrValue_js_1.BoxedPromiseOrValue(executor());
|
|
1228
|
-
}
|
|
1229
|
-
newPendingExecutionGroups.push(pendingExecutionGroup);
|
|
1230
|
-
}
|
|
1231
|
-
return newPendingExecutionGroups;
|
|
1232
|
-
}
|
|
1233
|
-
function shouldDefer(parentDeferUsages, deferUsages) {
|
|
1234
|
-
// If we have a new child defer usage, defer.
|
|
1235
|
-
// Otherwise, this defer usage was already deferred when it was initially
|
|
1236
|
-
// encountered, and is now in the midst of executing early, so the new
|
|
1237
|
-
// deferred grouped fields set can be executed immediately.
|
|
1238
|
-
return (parentDeferUsages === undefined ||
|
|
1239
|
-
!Array.from(deferUsages).every((deferUsage) => parentDeferUsages.has(deferUsage)));
|
|
1240
|
-
}
|
|
1241
|
-
function executeExecutionGroup(pendingExecutionGroup, exeContext, parentType, sourceValue, path, groupedFieldSet, incrementalContext, deferMap) {
|
|
1242
|
-
let result;
|
|
1243
|
-
try {
|
|
1244
|
-
result = executeFields(exeContext, parentType, sourceValue, path, groupedFieldSet, incrementalContext, deferMap);
|
|
1245
|
-
}
|
|
1246
|
-
catch (error) {
|
|
1247
|
-
incrementalContext.completed = true;
|
|
1248
|
-
return {
|
|
1249
|
-
pendingExecutionGroup,
|
|
1250
|
-
path: (0, Path_js_1.pathToArray)(path),
|
|
1251
|
-
errors: withError(incrementalContext.errors, error),
|
|
1252
|
-
};
|
|
1253
|
-
}
|
|
1254
|
-
if ((0, isPromise_js_1.isPromise)(result)) {
|
|
1255
|
-
return result.then((resolved) => {
|
|
1256
|
-
incrementalContext.completed = true;
|
|
1257
|
-
return buildCompletedExecutionGroup(incrementalContext.errors, pendingExecutionGroup, path, resolved);
|
|
1258
|
-
}, (error) => {
|
|
1259
|
-
incrementalContext.completed = true;
|
|
1260
|
-
return {
|
|
1261
|
-
pendingExecutionGroup,
|
|
1262
|
-
path: (0, Path_js_1.pathToArray)(path),
|
|
1263
|
-
errors: withError(incrementalContext.errors, error),
|
|
1264
|
-
};
|
|
1265
|
-
});
|
|
1266
|
-
}
|
|
1267
|
-
incrementalContext.completed = true;
|
|
1268
|
-
return buildCompletedExecutionGroup(incrementalContext.errors, pendingExecutionGroup, path, result);
|
|
1269
|
-
}
|
|
1270
|
-
function buildCompletedExecutionGroup(errors, pendingExecutionGroup, path, result) {
|
|
1271
|
-
const { rawResult: data, incrementalDataRecords } = result;
|
|
478
|
+
/**
|
|
479
|
+
* TODO: consider no longer exporting this function
|
|
480
|
+
* @internal
|
|
481
|
+
*/
|
|
482
|
+
// eslint-disable-next-line max-params
|
|
483
|
+
function buildResolveInfo(validatedExecutionArgs, fieldDef, fieldNodes, parentType, path, getAbortSignal, getAsyncHelpers) {
|
|
484
|
+
const { schema, fragmentDefinitions, rootValue, operation, variableValues } = validatedExecutionArgs;
|
|
485
|
+
// The resolve function's optional fourth argument is a collection of
|
|
486
|
+
// information about the current execution state.
|
|
1272
487
|
return {
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
const firstExecutor = () => {
|
|
1286
|
-
const initialPath = (0, Path_js_1.addPath)(streamPath, initialIndex, undefined);
|
|
1287
|
-
const firstStreamItem = new BoxedPromiseOrValue_js_1.BoxedPromiseOrValue(completeStreamItem(initialPath, initialItem, exeContext, { errors: undefined, completed: false }, fieldDetailsList, info, itemType));
|
|
1288
|
-
let iteration = iterator.next();
|
|
1289
|
-
let currentIndex = initialIndex + 1;
|
|
1290
|
-
let currentStreamItem = firstStreamItem;
|
|
1291
|
-
while (!iteration.done) {
|
|
1292
|
-
// TODO: add test case for early sync termination
|
|
1293
|
-
/* c8 ignore next 6 */
|
|
1294
|
-
if (currentStreamItem instanceof BoxedPromiseOrValue_js_1.BoxedPromiseOrValue) {
|
|
1295
|
-
const result = currentStreamItem.value;
|
|
1296
|
-
if (!(0, isPromise_js_1.isPromise)(result) && result.errors !== undefined) {
|
|
1297
|
-
break;
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
const itemPath = (0, Path_js_1.addPath)(streamPath, currentIndex, undefined);
|
|
1301
|
-
const value = iteration.value;
|
|
1302
|
-
const currentExecutor = () => completeStreamItem(itemPath, value, exeContext, { errors: undefined, completed: false }, fieldDetailsList, info, itemType);
|
|
1303
|
-
currentStreamItem = enableEarlyExecution
|
|
1304
|
-
? new BoxedPromiseOrValue_js_1.BoxedPromiseOrValue(currentExecutor())
|
|
1305
|
-
: () => new BoxedPromiseOrValue_js_1.BoxedPromiseOrValue(currentExecutor());
|
|
1306
|
-
streamItemQueue.push(currentStreamItem);
|
|
1307
|
-
iteration = iterator.next();
|
|
1308
|
-
currentIndex = initialIndex + 1;
|
|
1309
|
-
}
|
|
1310
|
-
streamItemQueue.push(new BoxedPromiseOrValue_js_1.BoxedPromiseOrValue({}));
|
|
1311
|
-
return firstStreamItem.value;
|
|
488
|
+
fieldName: fieldDef.name,
|
|
489
|
+
fieldNodes,
|
|
490
|
+
returnType: fieldDef.type,
|
|
491
|
+
parentType,
|
|
492
|
+
path,
|
|
493
|
+
schema,
|
|
494
|
+
fragments: fragmentDefinitions,
|
|
495
|
+
rootValue,
|
|
496
|
+
operation,
|
|
497
|
+
variableValues,
|
|
498
|
+
getAbortSignal,
|
|
499
|
+
getAsyncHelpers,
|
|
1312
500
|
};
|
|
1313
|
-
streamItemQueue.push(enableEarlyExecution
|
|
1314
|
-
? new BoxedPromiseOrValue_js_1.BoxedPromiseOrValue(Promise.resolve().then(firstExecutor))
|
|
1315
|
-
: () => new BoxedPromiseOrValue_js_1.BoxedPromiseOrValue(firstExecutor()));
|
|
1316
|
-
return streamItemQueue;
|
|
1317
501
|
}
|
|
1318
|
-
function
|
|
1319
|
-
|
|
1320
|
-
const executor = () => getNextAsyncStreamItemResult(streamItemQueue, streamPath, initialIndex, asyncIterator, exeContext, fieldDetailsList, info, itemType);
|
|
1321
|
-
streamItemQueue.push(exeContext.validatedExecutionArgs.enableEarlyExecution
|
|
1322
|
-
? new BoxedPromiseOrValue_js_1.BoxedPromiseOrValue(executor())
|
|
1323
|
-
: () => new BoxedPromiseOrValue_js_1.BoxedPromiseOrValue(executor()));
|
|
1324
|
-
return streamItemQueue;
|
|
1325
|
-
}
|
|
1326
|
-
async function getNextAsyncStreamItemResult(streamItemQueue, streamPath, index, asyncIterator, exeContext, fieldDetailsList, info, itemType) {
|
|
1327
|
-
let iteration;
|
|
1328
|
-
try {
|
|
1329
|
-
iteration = await asyncIterator.next();
|
|
1330
|
-
}
|
|
1331
|
-
catch (error) {
|
|
1332
|
-
return {
|
|
1333
|
-
errors: [
|
|
1334
|
-
(0, locatedError_js_1.locatedError)(error, toNodes(fieldDetailsList), (0, Path_js_1.pathToArray)(streamPath)),
|
|
1335
|
-
],
|
|
1336
|
-
};
|
|
1337
|
-
}
|
|
1338
|
-
if (iteration.done) {
|
|
1339
|
-
return {};
|
|
1340
|
-
}
|
|
1341
|
-
const itemPath = (0, Path_js_1.addPath)(streamPath, index, undefined);
|
|
1342
|
-
const result = completeStreamItem(itemPath, iteration.value, exeContext, { errors: undefined, completed: false }, fieldDetailsList, info, itemType);
|
|
1343
|
-
const executor = () => getNextAsyncStreamItemResult(streamItemQueue, streamPath, index + 1, asyncIterator, exeContext, fieldDetailsList, info, itemType);
|
|
1344
|
-
streamItemQueue.push(exeContext.validatedExecutionArgs.enableEarlyExecution
|
|
1345
|
-
? new BoxedPromiseOrValue_js_1.BoxedPromiseOrValue(executor())
|
|
1346
|
-
: () => new BoxedPromiseOrValue_js_1.BoxedPromiseOrValue(executor()));
|
|
1347
|
-
return result;
|
|
1348
|
-
}
|
|
1349
|
-
function completeStreamItem(itemPath, item, exeContext, incrementalContext, fieldDetailsList, info, itemType) {
|
|
1350
|
-
if ((0, isPromise_js_1.isPromise)(item)) {
|
|
1351
|
-
const abortSignalListener = exeContext.abortSignalListener;
|
|
1352
|
-
const maybeCancellableItem = abortSignalListener
|
|
1353
|
-
? (0, AbortSignalListener_js_1.cancellablePromise)(item, abortSignalListener)
|
|
1354
|
-
: item;
|
|
1355
|
-
return completePromisedValue(exeContext, itemType, fieldDetailsList, info, itemPath, maybeCancellableItem, incrementalContext, new Map()).then((resolvedItem) => {
|
|
1356
|
-
incrementalContext.completed = true;
|
|
1357
|
-
return buildStreamItemResult(incrementalContext.errors, resolvedItem);
|
|
1358
|
-
}, (error) => {
|
|
1359
|
-
incrementalContext.completed = true;
|
|
1360
|
-
return {
|
|
1361
|
-
errors: withError(incrementalContext.errors, error),
|
|
1362
|
-
};
|
|
1363
|
-
});
|
|
1364
|
-
}
|
|
1365
|
-
let result;
|
|
1366
|
-
try {
|
|
1367
|
-
try {
|
|
1368
|
-
result = completeValue(exeContext, itemType, fieldDetailsList, info, itemPath, item, incrementalContext, new Map());
|
|
1369
|
-
}
|
|
1370
|
-
catch (rawError) {
|
|
1371
|
-
handleFieldError(rawError, exeContext, itemType, fieldDetailsList, itemPath, incrementalContext);
|
|
1372
|
-
result = { rawResult: null, incrementalDataRecords: undefined };
|
|
1373
|
-
}
|
|
1374
|
-
}
|
|
1375
|
-
catch (error) {
|
|
1376
|
-
incrementalContext.completed = true;
|
|
1377
|
-
return {
|
|
1378
|
-
errors: withError(incrementalContext.errors, error),
|
|
1379
|
-
};
|
|
1380
|
-
}
|
|
1381
|
-
if ((0, isPromise_js_1.isPromise)(result)) {
|
|
1382
|
-
return result
|
|
1383
|
-
.then(undefined, (rawError) => {
|
|
1384
|
-
handleFieldError(rawError, exeContext, itemType, fieldDetailsList, itemPath, incrementalContext);
|
|
1385
|
-
return { rawResult: null, incrementalDataRecords: undefined };
|
|
1386
|
-
})
|
|
1387
|
-
.then((resolvedItem) => {
|
|
1388
|
-
incrementalContext.completed = true;
|
|
1389
|
-
return buildStreamItemResult(incrementalContext.errors, resolvedItem);
|
|
1390
|
-
}, (error) => {
|
|
1391
|
-
incrementalContext.completed = true;
|
|
1392
|
-
return {
|
|
1393
|
-
errors: withError(incrementalContext.errors, error),
|
|
1394
|
-
};
|
|
1395
|
-
});
|
|
1396
|
-
}
|
|
1397
|
-
incrementalContext.completed = true;
|
|
1398
|
-
return buildStreamItemResult(incrementalContext.errors, result);
|
|
1399
|
-
}
|
|
1400
|
-
function buildStreamItemResult(errors, result) {
|
|
1401
|
-
const { rawResult: item, incrementalDataRecords } = result;
|
|
1402
|
-
return {
|
|
1403
|
-
item,
|
|
1404
|
-
errors,
|
|
1405
|
-
incrementalDataRecords,
|
|
1406
|
-
};
|
|
502
|
+
function toNodes(fieldDetailsList) {
|
|
503
|
+
return fieldDetailsList.map((fieldDetails) => fieldDetails.node);
|
|
1407
504
|
}
|
|
1408
505
|
//# sourceMappingURL=execute.js.map
|