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
|
@@ -17,8 +17,8 @@ const values_js_1 = require("./values.js");
|
|
|
17
17
|
*
|
|
18
18
|
* @internal
|
|
19
19
|
*/
|
|
20
|
-
// eslint-disable-next-line
|
|
21
|
-
function collectFields(schema, fragments, variableValues, runtimeType, selectionSet, hideSuggestions) {
|
|
20
|
+
// eslint-disable-next-line max-params
|
|
21
|
+
function collectFields(schema, fragments, variableValues, runtimeType, selectionSet, hideSuggestions, forbidSkipAndInclude = false) {
|
|
22
22
|
const groupedFieldSet = new AccumulatorMap_js_1.AccumulatorMap();
|
|
23
23
|
const newDeferUsages = [];
|
|
24
24
|
const context = {
|
|
@@ -26,11 +26,17 @@ function collectFields(schema, fragments, variableValues, runtimeType, selection
|
|
|
26
26
|
fragments,
|
|
27
27
|
variableValues,
|
|
28
28
|
runtimeType,
|
|
29
|
-
visitedFragmentNames: new
|
|
29
|
+
visitedFragmentNames: new Map(),
|
|
30
30
|
hideSuggestions,
|
|
31
|
+
forbiddenDirectiveInstances: [],
|
|
32
|
+
forbidSkipAndInclude,
|
|
31
33
|
};
|
|
32
34
|
collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsages);
|
|
33
|
-
return {
|
|
35
|
+
return {
|
|
36
|
+
groupedFieldSet,
|
|
37
|
+
newDeferUsages,
|
|
38
|
+
forbiddenDirectiveInstances: context.forbiddenDirectiveInstances,
|
|
39
|
+
};
|
|
34
40
|
}
|
|
35
41
|
/**
|
|
36
42
|
* Given an array of field nodes, collects all of the subfields of the passed
|
|
@@ -42,15 +48,17 @@ function collectFields(schema, fragments, variableValues, runtimeType, selection
|
|
|
42
48
|
*
|
|
43
49
|
* @internal
|
|
44
50
|
*/
|
|
45
|
-
// eslint-disable-next-line
|
|
51
|
+
// eslint-disable-next-line max-params
|
|
46
52
|
function collectSubfields(schema, fragments, variableValues, returnType, fieldDetailsList, hideSuggestions) {
|
|
47
53
|
const context = {
|
|
48
54
|
schema,
|
|
49
55
|
fragments,
|
|
50
56
|
variableValues,
|
|
51
57
|
runtimeType: returnType,
|
|
52
|
-
visitedFragmentNames: new
|
|
58
|
+
visitedFragmentNames: new Map(),
|
|
53
59
|
hideSuggestions,
|
|
60
|
+
forbiddenDirectiveInstances: [],
|
|
61
|
+
forbidSkipAndInclude: false,
|
|
54
62
|
};
|
|
55
63
|
const subGroupedFieldSet = new AccumulatorMap_js_1.AccumulatorMap();
|
|
56
64
|
const newDeferUsages = [];
|
|
@@ -66,13 +74,13 @@ function collectSubfields(schema, fragments, variableValues, returnType, fieldDe
|
|
|
66
74
|
newDeferUsages,
|
|
67
75
|
};
|
|
68
76
|
}
|
|
69
|
-
// eslint-disable-next-line
|
|
77
|
+
// eslint-disable-next-line max-params
|
|
70
78
|
function collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsages, deferUsage, fragmentVariableValues) {
|
|
71
79
|
const { schema, fragments, variableValues, runtimeType, visitedFragmentNames, hideSuggestions, } = context;
|
|
72
80
|
for (const selection of selectionSet.selections) {
|
|
73
81
|
switch (selection.kind) {
|
|
74
82
|
case kinds_js_1.Kind.FIELD: {
|
|
75
|
-
if (!shouldIncludeNode(selection, variableValues, fragmentVariableValues)) {
|
|
83
|
+
if (!shouldIncludeNode(context, selection, variableValues, fragmentVariableValues)) {
|
|
76
84
|
continue;
|
|
77
85
|
}
|
|
78
86
|
groupedFieldSet.add(getFieldEntryKey(selection), {
|
|
@@ -83,7 +91,7 @@ function collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsage
|
|
|
83
91
|
break;
|
|
84
92
|
}
|
|
85
93
|
case kinds_js_1.Kind.INLINE_FRAGMENT: {
|
|
86
|
-
if (!shouldIncludeNode(selection, variableValues, fragmentVariableValues) ||
|
|
94
|
+
if (!shouldIncludeNode(context, selection, variableValues, fragmentVariableValues) ||
|
|
87
95
|
!doesFragmentConditionMatch(schema, selection, runtimeType)) {
|
|
88
96
|
continue;
|
|
89
97
|
}
|
|
@@ -99,8 +107,7 @@ function collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsage
|
|
|
99
107
|
}
|
|
100
108
|
case kinds_js_1.Kind.FRAGMENT_SPREAD: {
|
|
101
109
|
const fragName = selection.name.value;
|
|
102
|
-
if (
|
|
103
|
-
!shouldIncludeNode(selection, variableValues, fragmentVariableValues)) {
|
|
110
|
+
if (!shouldIncludeNode(context, selection, variableValues, fragmentVariableValues)) {
|
|
104
111
|
continue;
|
|
105
112
|
}
|
|
106
113
|
const fragment = fragments[fragName];
|
|
@@ -109,19 +116,33 @@ function collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsage
|
|
|
109
116
|
continue;
|
|
110
117
|
}
|
|
111
118
|
const newDeferUsage = getDeferUsage(variableValues, fragmentVariableValues, selection, deferUsage);
|
|
112
|
-
const
|
|
113
|
-
let
|
|
114
|
-
if (fragmentVariableSignatures) {
|
|
115
|
-
newFragmentVariableValues = (0, values_js_1.getFragmentVariableValues)(selection, fragmentVariableSignatures, variableValues, fragmentVariableValues, hideSuggestions);
|
|
116
|
-
}
|
|
119
|
+
const visitedAsDeferred = visitedFragmentNames.get(fragName);
|
|
120
|
+
let maybeNewDeferUsage;
|
|
117
121
|
if (!newDeferUsage) {
|
|
118
|
-
|
|
119
|
-
|
|
122
|
+
// If this spread is not deferred, it may be skipped when already visited
|
|
123
|
+
// as a non-deferred spread. If it was previously visited as a deferred spread,
|
|
124
|
+
// it must be revisited.
|
|
125
|
+
if (visitedAsDeferred === false) {
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
visitedFragmentNames.set(fragName, false);
|
|
129
|
+
maybeNewDeferUsage = deferUsage;
|
|
120
130
|
}
|
|
121
131
|
else {
|
|
132
|
+
// If this spread is deferred, it can be skipped if it has already been visited.
|
|
133
|
+
if (visitedAsDeferred !== undefined) {
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
visitedFragmentNames.set(fragName, true);
|
|
122
137
|
newDeferUsages.push(newDeferUsage);
|
|
123
|
-
|
|
138
|
+
maybeNewDeferUsage = newDeferUsage;
|
|
124
139
|
}
|
|
140
|
+
const fragmentVariableSignatures = fragment.variableSignatures;
|
|
141
|
+
let newFragmentVariableValues;
|
|
142
|
+
if (fragmentVariableSignatures) {
|
|
143
|
+
newFragmentVariableValues = (0, values_js_1.getFragmentVariableValues)(selection, fragmentVariableSignatures, variableValues, fragmentVariableValues, hideSuggestions);
|
|
144
|
+
}
|
|
145
|
+
collectFieldsImpl(context, fragment.definition.selectionSet, groupedFieldSet, newDeferUsages, maybeNewDeferUsage, newFragmentVariableValues);
|
|
125
146
|
break;
|
|
126
147
|
}
|
|
127
148
|
}
|
|
@@ -149,12 +170,26 @@ function getDeferUsage(variableValues, fragmentVariableValues, node, parentDefer
|
|
|
149
170
|
* Determines if a field should be included based on the `@include` and `@skip`
|
|
150
171
|
* directives, where `@skip` has higher precedence than `@include`.
|
|
151
172
|
*/
|
|
152
|
-
function shouldIncludeNode(node, variableValues, fragmentVariableValues) {
|
|
153
|
-
const
|
|
173
|
+
function shouldIncludeNode(context, node, variableValues, fragmentVariableValues) {
|
|
174
|
+
const skipDirectiveNode = node.directives?.find((directive) => directive.name.value === directives_js_1.GraphQLSkipDirective.name);
|
|
175
|
+
if (skipDirectiveNode && context.forbidSkipAndInclude) {
|
|
176
|
+
context.forbiddenDirectiveInstances.push(skipDirectiveNode);
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
const skip = skipDirectiveNode
|
|
180
|
+
? (0, values_js_1.getArgumentValues)(directives_js_1.GraphQLSkipDirective, skipDirectiveNode, variableValues, fragmentVariableValues, context.hideSuggestions)
|
|
181
|
+
: undefined;
|
|
154
182
|
if (skip?.if === true) {
|
|
155
183
|
return false;
|
|
156
184
|
}
|
|
157
|
-
const
|
|
185
|
+
const includeDirectiveNode = node.directives?.find((directive) => directive.name.value === directives_js_1.GraphQLIncludeDirective.name);
|
|
186
|
+
if (includeDirectiveNode && context.forbidSkipAndInclude) {
|
|
187
|
+
context.forbiddenDirectiveInstances.push(includeDirectiveNode);
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
const include = includeDirectiveNode
|
|
191
|
+
? (0, values_js_1.getArgumentValues)(directives_js_1.GraphQLIncludeDirective, includeDirectiveNode, variableValues, fragmentVariableValues, context.hideSuggestions)
|
|
192
|
+
: undefined;
|
|
158
193
|
if (include?.if === false) {
|
|
159
194
|
return false;
|
|
160
195
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectFields.js","sourceRoot":"","sources":["../../src/execution/collectFields.ts"],"names":[],"mappings":";;AAkEA,sCAwBC;AAaD,4CAyCC;AAhJD,oEAA8D;AAU9D,mDAA4C;AAG5C,yDAAuD;AACvD,yDAI+B;AAG/B,gEAA0D;AAI1D,2CAA4E;AA+B5E;;;;;;;;GAQG;AACH,yDAAyD;AACzD,SAAgB,aAAa,CAC3B,MAAqB,EACrB,SAAkC,EAClC,cAA8B,EAC9B,WAA8B,EAC9B,YAA8B,EAC9B,eAAwB;IAKxB,MAAM,eAAe,GAAG,IAAI,kCAAc,EAAwB,CAAC;IACnE,MAAM,cAAc,GAAsB,EAAE,CAAC;IAC7C,MAAM,OAAO,GAAyB;QACpC,MAAM;QACN,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AAI,IAAA,8BAAc,EAAC,eAAe,CAAC,EAAE,CAAC;QACpC,OAAO,MAAM,CAAC,SAAS,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB,CAAC,IAAe;IACvC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;AACzD,CAAC","sourcesContent":["import { AccumulatorMap } from '../jsutils/AccumulatorMap.js';\nimport type { ObjMap } from '../jsutils/ObjMap.js';\n\nimport type {\n FieldNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n SelectionSetNode,\n} from '../language/ast.js';\nimport { Kind } from '../language/kinds.js';\n\nimport type { GraphQLObjectType } from '../type/definition.js';\nimport { isAbstractType } from '../type/definition.js';\nimport {\n GraphQLDeferDirective,\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n} from '../type/directives.js';\nimport type { GraphQLSchema } from '../type/schema.js';\n\nimport { typeFromAST } from '../utilities/typeFromAST.js';\n\nimport type { GraphQLVariableSignature } from './getVariableSignature.js';\nimport type { VariableValues } from './values.js';\nimport { getDirectiveValues, getFragmentVariableValues } from './values.js';\n\nexport interface DeferUsage {\n label: string | undefined;\n parentDeferUsage: DeferUsage | undefined;\n}\n\nexport interface FieldDetails {\n node: FieldNode;\n deferUsage?: DeferUsage | undefined;\n fragmentVariableValues?: VariableValues | undefined;\n}\n\nexport type FieldDetailsList = ReadonlyArray<FieldDetails>;\n\nexport type GroupedFieldSet = ReadonlyMap<string, FieldDetailsList>;\n\nexport interface FragmentDetails {\n definition: FragmentDefinitionNode;\n variableSignatures?: ObjMap<GraphQLVariableSignature> | undefined;\n}\n\ninterface CollectFieldsContext {\n schema: GraphQLSchema;\n fragments: ObjMap<FragmentDetails>;\n variableValues: VariableValues;\n runtimeType: GraphQLObjectType;\n visitedFragmentNames: Set<string>;\n hideSuggestions: boolean;\n}\n\n/**\n * Given a selectionSet, collects all of the fields and returns them.\n *\n * CollectFields requires the \"runtime type\" of an object. For a field that\n * returns an Interface or Union type, the \"runtime type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/max-params\nexport function collectFields(\n schema: GraphQLSchema,\n fragments: ObjMap<FragmentDetails>,\n variableValues: VariableValues,\n runtimeType: GraphQLObjectType,\n selectionSet: SelectionSetNode,\n hideSuggestions: boolean,\n): {\n groupedFieldSet: GroupedFieldSet;\n newDeferUsages: ReadonlyArray<DeferUsage>;\n} {\n const groupedFieldSet = new AccumulatorMap<string, FieldDetails>();\n const newDeferUsages: Array<DeferUsage> = [];\n const context: CollectFieldsContext = {\n schema,\n fragments,\n variableValues,\n runtimeType,\n visitedFragmentNames: new Set(),\n hideSuggestions,\n };\n\n collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsages);\n return { groupedFieldSet, newDeferUsages };\n}\n\n/**\n * Given an array of field nodes, collects all of the subfields of the passed\n * in fields, and returns them at the end.\n *\n * CollectSubFields requires the \"return type\" of an object. For a field that\n * returns an Interface or Union type, the \"return type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/max-params\nexport function collectSubfields(\n schema: GraphQLSchema,\n fragments: ObjMap<FragmentDetails>,\n variableValues: VariableValues,\n returnType: GraphQLObjectType,\n fieldDetailsList: FieldDetailsList,\n hideSuggestions: boolean,\n): {\n groupedFieldSet: GroupedFieldSet;\n newDeferUsages: ReadonlyArray<DeferUsage>;\n} {\n const context: CollectFieldsContext = {\n schema,\n fragments,\n variableValues,\n runtimeType: returnType,\n visitedFragmentNames: new Set(),\n hideSuggestions,\n };\n const subGroupedFieldSet = new AccumulatorMap<string, FieldDetails>();\n const newDeferUsages: Array<DeferUsage> = [];\n\n for (const fieldDetail of fieldDetailsList) {\n const selectionSet = fieldDetail.node.selectionSet;\n if (selectionSet) {\n const { deferUsage, fragmentVariableValues } = fieldDetail;\n collectFieldsImpl(\n context,\n selectionSet,\n subGroupedFieldSet,\n newDeferUsages,\n deferUsage,\n fragmentVariableValues,\n );\n }\n }\n\n return {\n groupedFieldSet: subGroupedFieldSet,\n newDeferUsages,\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/max-params\nfunction collectFieldsImpl(\n context: CollectFieldsContext,\n selectionSet: SelectionSetNode,\n groupedFieldSet: AccumulatorMap<string, FieldDetails>,\n newDeferUsages: Array<DeferUsage>,\n deferUsage?: DeferUsage,\n fragmentVariableValues?: VariableValues,\n): void {\n const {\n schema,\n fragments,\n variableValues,\n runtimeType,\n visitedFragmentNames,\n hideSuggestions,\n } = context;\n\n for (const selection of selectionSet.selections) {\n switch (selection.kind) {\n case Kind.FIELD: {\n if (\n !shouldIncludeNode(selection, variableValues, fragmentVariableValues)\n ) {\n continue;\n }\n groupedFieldSet.add(getFieldEntryKey(selection), {\n node: selection,\n deferUsage,\n fragmentVariableValues,\n });\n break;\n }\n case Kind.INLINE_FRAGMENT: {\n if (\n !shouldIncludeNode(\n selection,\n variableValues,\n fragmentVariableValues,\n ) ||\n !doesFragmentConditionMatch(schema, selection, runtimeType)\n ) {\n continue;\n }\n\n const newDeferUsage = getDeferUsage(\n variableValues,\n fragmentVariableValues,\n selection,\n deferUsage,\n );\n\n if (!newDeferUsage) {\n collectFieldsImpl(\n context,\n selection.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n deferUsage,\n fragmentVariableValues,\n );\n } else {\n newDeferUsages.push(newDeferUsage);\n collectFieldsImpl(\n context,\n selection.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n newDeferUsage,\n fragmentVariableValues,\n );\n }\n\n break;\n }\n case Kind.FRAGMENT_SPREAD: {\n const fragName = selection.name.value;\n\n if (\n visitedFragmentNames.has(fragName) ||\n !shouldIncludeNode(selection, variableValues, fragmentVariableValues)\n ) {\n continue;\n }\n\n const fragment = fragments[fragName];\n if (\n fragment == null ||\n !doesFragmentConditionMatch(schema, fragment.definition, runtimeType)\n ) {\n continue;\n }\n\n const newDeferUsage = getDeferUsage(\n variableValues,\n fragmentVariableValues,\n selection,\n deferUsage,\n );\n\n const fragmentVariableSignatures = fragment.variableSignatures;\n let newFragmentVariableValues: VariableValues | undefined;\n if (fragmentVariableSignatures) {\n newFragmentVariableValues = getFragmentVariableValues(\n selection,\n fragmentVariableSignatures,\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n }\n\n if (!newDeferUsage) {\n visitedFragmentNames.add(fragName);\n collectFieldsImpl(\n context,\n fragment.definition.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n deferUsage,\n newFragmentVariableValues,\n );\n } else {\n newDeferUsages.push(newDeferUsage);\n collectFieldsImpl(\n context,\n fragment.definition.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n newDeferUsage,\n newFragmentVariableValues,\n );\n }\n break;\n }\n }\n }\n}\n\n/**\n * Returns an object containing the `@defer` arguments if a field should be\n * deferred based on the experimental flag, defer directive present and\n * not disabled by the \"if\" argument.\n */\nfunction getDeferUsage(\n variableValues: VariableValues,\n fragmentVariableValues: VariableValues | undefined,\n node: FragmentSpreadNode | InlineFragmentNode,\n parentDeferUsage: DeferUsage | undefined,\n): DeferUsage | undefined {\n const defer = getDirectiveValues(\n GraphQLDeferDirective,\n node,\n variableValues,\n fragmentVariableValues,\n );\n\n if (!defer) {\n return;\n }\n\n if (defer.if === false) {\n return;\n }\n\n return {\n label: typeof defer.label === 'string' ? defer.label : undefined,\n parentDeferUsage,\n };\n}\n\n/**\n * Determines if a field should be included based on the `@include` and `@skip`\n * directives, where `@skip` has higher precedence than `@include`.\n */\nfunction shouldIncludeNode(\n node: FragmentSpreadNode | FieldNode | InlineFragmentNode,\n variableValues: VariableValues,\n fragmentVariableValues: VariableValues | undefined,\n): boolean {\n const skip = getDirectiveValues(\n GraphQLSkipDirective,\n node,\n variableValues,\n fragmentVariableValues,\n );\n if (skip?.if === true) {\n return false;\n }\n\n const include = getDirectiveValues(\n GraphQLIncludeDirective,\n node,\n variableValues,\n fragmentVariableValues,\n );\n if (include?.if === false) {\n return false;\n }\n return true;\n}\n\n/**\n * Determines if a fragment is applicable to the given type.\n */\nfunction doesFragmentConditionMatch(\n schema: GraphQLSchema,\n fragment: FragmentDefinitionNode | InlineFragmentNode,\n type: GraphQLObjectType,\n): boolean {\n const typeConditionNode = fragment.typeCondition;\n if (!typeConditionNode) {\n return true;\n }\n const conditionalType = typeFromAST(schema, typeConditionNode);\n if (conditionalType === type) {\n return true;\n }\n if (isAbstractType(conditionalType)) {\n return schema.isSubType(conditionalType, type);\n }\n return false;\n}\n\n/**\n * Implements the logic to compute the key of a given field's entry\n */\nfunction getFieldEntryKey(node: FieldNode): string {\n return node.alias ? node.alias.value : node.name.value;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"collectFields.js","sourceRoot":"","sources":["../../src/execution/collectFields.ts"],"names":[],"mappings":";;AAqFA,sCAgCC;AAaD,4CA2CC;AA7KD,oEAA8D;AAY9D,mDAA4C;AAG5C,yDAAuD;AACvD,yDAI+B;AAG/B,gEAA0D;AAI1D,2CAIqB;AA4CrB;;;;;;;;GAQG;AACH,sCAAsC;AACtC,SAAgB,aAAa,CAC3B,MAAqB,EACrB,SAAkC,EAClC,cAA8B,EAC9B,WAA8B,EAC9B,YAA8B,EAC9B,eAAwB,EACxB,oBAAoB,GAAG,KAAK;IAM5B,MAAM,eAAe,GAAG,IAAI,kCAAc,EAAwB,CAAC;IACnE,MAAM,cAAc,GAAsB,EAAE,CAAC;IAC7C,MAAM,OAAO,GAAyB;QACpC,MAAM;QACN,SAAS;QACT,cAAc;QACd,WAAW;QACX,oBAAoB,EAAE,IAAI,GAAG,EAAE;QAC/B,eAAe;QACf,2BAA2B,EAAE,EAAE;QAC/B,oBAAoB;KACrB,CAAC;IAEF,iBAAiB,CAAC,OAAO,EAAE,YAAY,EAAE,eAAe,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EG;AACH,SAAS,gBAAgB,CAAC,IAAe;IACvC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;AACzD,CAAC","sourcesContent":["import { AccumulatorMap } from '../jsutils/AccumulatorMap.js';\nimport type { ObjMap, ReadOnlyObjMap } from '../jsutils/ObjMap.js';\n\nimport type {\n ConstValueNode,\n DirectiveNode,\n FieldNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n SelectionSetNode,\n} from '../language/ast.js';\nimport { Kind } from '../language/kinds.js';\n\nimport type { GraphQLObjectType } from '../type/definition.js';\nimport { isAbstractType } from '../type/definition.js';\nimport {\n GraphQLDeferDirective,\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n} from '../type/directives.js';\nimport type { GraphQLSchema } from '../type/schema.js';\n\nimport { typeFromAST } from '../utilities/typeFromAST.js';\n\nimport type { GraphQLVariableSignature } from './getVariableSignature.js';\nimport type { VariableValues } from './values.js';\nimport {\n getArgumentValues,\n getDirectiveValues,\n getFragmentVariableValues,\n} from './values.js';\n\nexport interface DeferUsage {\n label: string | undefined;\n parentDeferUsage: DeferUsage | undefined;\n}\n\nexport interface FragmentVariableValues {\n readonly sources: ReadOnlyObjMap<FragmentVariableValueSource>;\n readonly coerced: ReadOnlyObjMap<unknown>;\n}\n\ninterface FragmentVariableValueSource {\n readonly signature: GraphQLVariableSignature;\n readonly value?: ConstValueNode;\n readonly fragmentVariableValues?: FragmentVariableValues;\n}\n\nexport interface FieldDetails {\n node: FieldNode;\n deferUsage?: DeferUsage | undefined;\n fragmentVariableValues?: FragmentVariableValues | undefined;\n}\n\nexport type FieldDetailsList = ReadonlyArray<FieldDetails>;\n\nexport type GroupedFieldSet = ReadonlyMap<string, FieldDetailsList>;\n\nexport interface FragmentDetails {\n definition: FragmentDefinitionNode;\n variableSignatures?: ObjMap<GraphQLVariableSignature> | undefined;\n}\n\ninterface CollectFieldsContext {\n schema: GraphQLSchema;\n fragments: ObjMap<FragmentDetails>;\n variableValues: VariableValues;\n runtimeType: GraphQLObjectType;\n visitedFragmentNames: Map<string, boolean>;\n hideSuggestions: boolean;\n forbiddenDirectiveInstances: Array<DirectiveNode>;\n forbidSkipAndInclude: boolean;\n}\n\n/**\n * Given a selectionSet, collects all of the fields and returns them.\n *\n * CollectFields requires the \"runtime type\" of an object. For a field that\n * returns an Interface or Union type, the \"runtime type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n// eslint-disable-next-line max-params\nexport function collectFields(\n schema: GraphQLSchema,\n fragments: ObjMap<FragmentDetails>,\n variableValues: VariableValues,\n runtimeType: GraphQLObjectType,\n selectionSet: SelectionSetNode,\n hideSuggestions: boolean,\n forbidSkipAndInclude = false,\n): {\n groupedFieldSet: GroupedFieldSet;\n newDeferUsages: ReadonlyArray<DeferUsage>;\n forbiddenDirectiveInstances: ReadonlyArray<DirectiveNode>;\n} {\n const groupedFieldSet = new AccumulatorMap<string, FieldDetails>();\n const newDeferUsages: Array<DeferUsage> = [];\n const context: CollectFieldsContext = {\n schema,\n fragments,\n variableValues,\n runtimeType,\n visitedFragmentNames: new Map(),\n hideSuggestions,\n forbiddenDirectiveInstances: [],\n forbidSkipAndInclude,\n };\n\n collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsages);\n return {\n groupedFieldSet,\n newDeferUsages,\n forbiddenDirectiveInstances: context.forbiddenDirectiveInstances,\n };\n}\n\n/**\n * Given an array of field nodes, collects all of the subfields of the passed\n * in fields, and returns them at the end.\n *\n * CollectSubFields requires the \"return type\" of an object. For a field that\n * returns an Interface or Union type, the \"return type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n// eslint-disable-next-line max-params\nexport function collectSubfields(\n schema: GraphQLSchema,\n fragments: ObjMap<FragmentDetails>,\n variableValues: VariableValues,\n returnType: GraphQLObjectType,\n fieldDetailsList: FieldDetailsList,\n hideSuggestions: boolean,\n): {\n groupedFieldSet: GroupedFieldSet;\n newDeferUsages: ReadonlyArray<DeferUsage>;\n} {\n const context: CollectFieldsContext = {\n schema,\n fragments,\n variableValues,\n runtimeType: returnType,\n visitedFragmentNames: new Map(),\n hideSuggestions,\n forbiddenDirectiveInstances: [],\n forbidSkipAndInclude: false,\n };\n const subGroupedFieldSet = new AccumulatorMap<string, FieldDetails>();\n const newDeferUsages: Array<DeferUsage> = [];\n\n for (const fieldDetail of fieldDetailsList) {\n const selectionSet = fieldDetail.node.selectionSet;\n if (selectionSet) {\n const { deferUsage, fragmentVariableValues } = fieldDetail;\n collectFieldsImpl(\n context,\n selectionSet,\n subGroupedFieldSet,\n newDeferUsages,\n deferUsage,\n fragmentVariableValues,\n );\n }\n }\n\n return {\n groupedFieldSet: subGroupedFieldSet,\n newDeferUsages,\n };\n}\n\n// eslint-disable-next-line max-params\nfunction collectFieldsImpl(\n context: CollectFieldsContext,\n selectionSet: SelectionSetNode,\n groupedFieldSet: AccumulatorMap<string, FieldDetails>,\n newDeferUsages: Array<DeferUsage>,\n deferUsage?: DeferUsage,\n fragmentVariableValues?: FragmentVariableValues,\n): void {\n const {\n schema,\n fragments,\n variableValues,\n runtimeType,\n visitedFragmentNames,\n hideSuggestions,\n } = context;\n\n for (const selection of selectionSet.selections) {\n switch (selection.kind) {\n case Kind.FIELD: {\n if (\n !shouldIncludeNode(\n context,\n selection,\n variableValues,\n fragmentVariableValues,\n )\n ) {\n continue;\n }\n groupedFieldSet.add(getFieldEntryKey(selection), {\n node: selection,\n deferUsage,\n fragmentVariableValues,\n });\n break;\n }\n case Kind.INLINE_FRAGMENT: {\n if (\n !shouldIncludeNode(\n context,\n selection,\n variableValues,\n fragmentVariableValues,\n ) ||\n !doesFragmentConditionMatch(schema, selection, runtimeType)\n ) {\n continue;\n }\n\n const newDeferUsage = getDeferUsage(\n variableValues,\n fragmentVariableValues,\n selection,\n deferUsage,\n );\n\n if (!newDeferUsage) {\n collectFieldsImpl(\n context,\n selection.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n deferUsage,\n fragmentVariableValues,\n );\n } else {\n newDeferUsages.push(newDeferUsage);\n collectFieldsImpl(\n context,\n selection.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n newDeferUsage,\n fragmentVariableValues,\n );\n }\n\n break;\n }\n case Kind.FRAGMENT_SPREAD: {\n const fragName = selection.name.value;\n\n if (\n !shouldIncludeNode(\n context,\n selection,\n variableValues,\n fragmentVariableValues,\n )\n ) {\n continue;\n }\n\n const fragment = fragments[fragName];\n if (\n fragment == null ||\n !doesFragmentConditionMatch(schema, fragment.definition, runtimeType)\n ) {\n continue;\n }\n\n const newDeferUsage = getDeferUsage(\n variableValues,\n fragmentVariableValues,\n selection,\n deferUsage,\n );\n\n const visitedAsDeferred = visitedFragmentNames.get(fragName);\n\n let maybeNewDeferUsage: DeferUsage | undefined;\n if (!newDeferUsage) {\n // If this spread is not deferred, it may be skipped when already visited\n // as a non-deferred spread. If it was previously visited as a deferred spread,\n // it must be revisited.\n if (visitedAsDeferred === false) {\n continue;\n }\n visitedFragmentNames.set(fragName, false);\n maybeNewDeferUsage = deferUsage;\n } else {\n // If this spread is deferred, it can be skipped if it has already been visited.\n if (visitedAsDeferred !== undefined) {\n continue;\n }\n visitedFragmentNames.set(fragName, true);\n newDeferUsages.push(newDeferUsage);\n maybeNewDeferUsage = newDeferUsage;\n }\n\n const fragmentVariableSignatures = fragment.variableSignatures;\n let newFragmentVariableValues: FragmentVariableValues | undefined;\n if (fragmentVariableSignatures) {\n newFragmentVariableValues = getFragmentVariableValues(\n selection,\n fragmentVariableSignatures,\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n }\n\n collectFieldsImpl(\n context,\n fragment.definition.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n maybeNewDeferUsage,\n newFragmentVariableValues,\n );\n break;\n }\n }\n }\n}\n\n/**\n * Returns an object containing the `@defer` arguments if a field should be\n * deferred based on the experimental flag, defer directive present and\n * not disabled by the \"if\" argument.\n */\nfunction getDeferUsage(\n variableValues: VariableValues,\n fragmentVariableValues: FragmentVariableValues | undefined,\n node: FragmentSpreadNode | InlineFragmentNode,\n parentDeferUsage: DeferUsage | undefined,\n): DeferUsage | undefined {\n const defer = getDirectiveValues(\n GraphQLDeferDirective,\n node,\n variableValues,\n fragmentVariableValues,\n );\n\n if (!defer) {\n return;\n }\n\n if (defer.if === false) {\n return;\n }\n\n return {\n label: typeof defer.label === 'string' ? defer.label : undefined,\n parentDeferUsage,\n };\n}\n\n/**\n * Determines if a field should be included based on the `@include` and `@skip`\n * directives, where `@skip` has higher precedence than `@include`.\n */\nfunction shouldIncludeNode(\n context: CollectFieldsContext,\n node: FragmentSpreadNode | FieldNode | InlineFragmentNode,\n variableValues: VariableValues,\n fragmentVariableValues: FragmentVariableValues | undefined,\n): boolean {\n const skipDirectiveNode = node.directives?.find(\n (directive) => directive.name.value === GraphQLSkipDirective.name,\n );\n if (skipDirectiveNode && context.forbidSkipAndInclude) {\n context.forbiddenDirectiveInstances.push(skipDirectiveNode);\n return false;\n }\n const skip = skipDirectiveNode\n ? getArgumentValues(\n GraphQLSkipDirective,\n skipDirectiveNode,\n variableValues,\n fragmentVariableValues,\n context.hideSuggestions,\n )\n : undefined;\n if (skip?.if === true) {\n return false;\n }\n\n const includeDirectiveNode = node.directives?.find(\n (directive) => directive.name.value === GraphQLIncludeDirective.name,\n );\n if (includeDirectiveNode && context.forbidSkipAndInclude) {\n context.forbiddenDirectiveInstances.push(includeDirectiveNode);\n return false;\n }\n const include = includeDirectiveNode\n ? getArgumentValues(\n GraphQLIncludeDirective,\n includeDirectiveNode,\n variableValues,\n fragmentVariableValues,\n context.hideSuggestions,\n )\n : undefined;\n if (include?.if === false) {\n return false;\n }\n return true;\n}\n\n/**\n * Determines if a fragment is applicable to the given type.\n */\nfunction doesFragmentConditionMatch(\n schema: GraphQLSchema,\n fragment: FragmentDefinitionNode | InlineFragmentNode,\n type: GraphQLObjectType,\n): boolean {\n const typeConditionNode = fragment.typeCondition;\n if (!typeConditionNode) {\n return true;\n }\n const conditionalType = typeFromAST(schema, typeConditionNode);\n if (conditionalType === type) {\n return true;\n }\n if (isAbstractType(conditionalType)) {\n return schema.isSubType(conditionalType, type);\n }\n return false;\n}\n\n/**\n * Implements the logic to compute the key of a given field's entry\n */\nfunction getFieldEntryKey(node: FieldNode): string {\n return node.alias ? node.alias.value : node.name.value;\n}\n"]}
|
|
@@ -3,7 +3,7 @@ import { Kind } from "../language/kinds.mjs";
|
|
|
3
3
|
import { isAbstractType } from "../type/definition.mjs";
|
|
4
4
|
import { GraphQLDeferDirective, GraphQLIncludeDirective, GraphQLSkipDirective, } from "../type/directives.mjs";
|
|
5
5
|
import { typeFromAST } from "../utilities/typeFromAST.mjs";
|
|
6
|
-
import { getDirectiveValues, getFragmentVariableValues } from "./values.mjs";
|
|
6
|
+
import { getArgumentValues, getDirectiveValues, getFragmentVariableValues, } from "./values.mjs";
|
|
7
7
|
/**
|
|
8
8
|
* Given a selectionSet, collects all of the fields and returns them.
|
|
9
9
|
*
|
|
@@ -13,8 +13,8 @@ import { getDirectiveValues, getFragmentVariableValues } from "./values.mjs";
|
|
|
13
13
|
*
|
|
14
14
|
* @internal
|
|
15
15
|
*/
|
|
16
|
-
// eslint-disable-next-line
|
|
17
|
-
export function collectFields(schema, fragments, variableValues, runtimeType, selectionSet, hideSuggestions) {
|
|
16
|
+
// eslint-disable-next-line max-params
|
|
17
|
+
export function collectFields(schema, fragments, variableValues, runtimeType, selectionSet, hideSuggestions, forbidSkipAndInclude = false) {
|
|
18
18
|
const groupedFieldSet = new AccumulatorMap();
|
|
19
19
|
const newDeferUsages = [];
|
|
20
20
|
const context = {
|
|
@@ -22,11 +22,17 @@ export function collectFields(schema, fragments, variableValues, runtimeType, se
|
|
|
22
22
|
fragments,
|
|
23
23
|
variableValues,
|
|
24
24
|
runtimeType,
|
|
25
|
-
visitedFragmentNames: new
|
|
25
|
+
visitedFragmentNames: new Map(),
|
|
26
26
|
hideSuggestions,
|
|
27
|
+
forbiddenDirectiveInstances: [],
|
|
28
|
+
forbidSkipAndInclude,
|
|
27
29
|
};
|
|
28
30
|
collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsages);
|
|
29
|
-
return {
|
|
31
|
+
return {
|
|
32
|
+
groupedFieldSet,
|
|
33
|
+
newDeferUsages,
|
|
34
|
+
forbiddenDirectiveInstances: context.forbiddenDirectiveInstances,
|
|
35
|
+
};
|
|
30
36
|
}
|
|
31
37
|
/**
|
|
32
38
|
* Given an array of field nodes, collects all of the subfields of the passed
|
|
@@ -38,15 +44,17 @@ export function collectFields(schema, fragments, variableValues, runtimeType, se
|
|
|
38
44
|
*
|
|
39
45
|
* @internal
|
|
40
46
|
*/
|
|
41
|
-
// eslint-disable-next-line
|
|
47
|
+
// eslint-disable-next-line max-params
|
|
42
48
|
export function collectSubfields(schema, fragments, variableValues, returnType, fieldDetailsList, hideSuggestions) {
|
|
43
49
|
const context = {
|
|
44
50
|
schema,
|
|
45
51
|
fragments,
|
|
46
52
|
variableValues,
|
|
47
53
|
runtimeType: returnType,
|
|
48
|
-
visitedFragmentNames: new
|
|
54
|
+
visitedFragmentNames: new Map(),
|
|
49
55
|
hideSuggestions,
|
|
56
|
+
forbiddenDirectiveInstances: [],
|
|
57
|
+
forbidSkipAndInclude: false,
|
|
50
58
|
};
|
|
51
59
|
const subGroupedFieldSet = new AccumulatorMap();
|
|
52
60
|
const newDeferUsages = [];
|
|
@@ -62,13 +70,13 @@ export function collectSubfields(schema, fragments, variableValues, returnType,
|
|
|
62
70
|
newDeferUsages,
|
|
63
71
|
};
|
|
64
72
|
}
|
|
65
|
-
// eslint-disable-next-line
|
|
73
|
+
// eslint-disable-next-line max-params
|
|
66
74
|
function collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsages, deferUsage, fragmentVariableValues) {
|
|
67
75
|
const { schema, fragments, variableValues, runtimeType, visitedFragmentNames, hideSuggestions, } = context;
|
|
68
76
|
for (const selection of selectionSet.selections) {
|
|
69
77
|
switch (selection.kind) {
|
|
70
78
|
case Kind.FIELD: {
|
|
71
|
-
if (!shouldIncludeNode(selection, variableValues, fragmentVariableValues)) {
|
|
79
|
+
if (!shouldIncludeNode(context, selection, variableValues, fragmentVariableValues)) {
|
|
72
80
|
continue;
|
|
73
81
|
}
|
|
74
82
|
groupedFieldSet.add(getFieldEntryKey(selection), {
|
|
@@ -79,7 +87,7 @@ function collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsage
|
|
|
79
87
|
break;
|
|
80
88
|
}
|
|
81
89
|
case Kind.INLINE_FRAGMENT: {
|
|
82
|
-
if (!shouldIncludeNode(selection, variableValues, fragmentVariableValues) ||
|
|
90
|
+
if (!shouldIncludeNode(context, selection, variableValues, fragmentVariableValues) ||
|
|
83
91
|
!doesFragmentConditionMatch(schema, selection, runtimeType)) {
|
|
84
92
|
continue;
|
|
85
93
|
}
|
|
@@ -95,8 +103,7 @@ function collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsage
|
|
|
95
103
|
}
|
|
96
104
|
case Kind.FRAGMENT_SPREAD: {
|
|
97
105
|
const fragName = selection.name.value;
|
|
98
|
-
if (
|
|
99
|
-
!shouldIncludeNode(selection, variableValues, fragmentVariableValues)) {
|
|
106
|
+
if (!shouldIncludeNode(context, selection, variableValues, fragmentVariableValues)) {
|
|
100
107
|
continue;
|
|
101
108
|
}
|
|
102
109
|
const fragment = fragments[fragName];
|
|
@@ -105,19 +112,33 @@ function collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsage
|
|
|
105
112
|
continue;
|
|
106
113
|
}
|
|
107
114
|
const newDeferUsage = getDeferUsage(variableValues, fragmentVariableValues, selection, deferUsage);
|
|
108
|
-
const
|
|
109
|
-
let
|
|
110
|
-
if (fragmentVariableSignatures) {
|
|
111
|
-
newFragmentVariableValues = getFragmentVariableValues(selection, fragmentVariableSignatures, variableValues, fragmentVariableValues, hideSuggestions);
|
|
112
|
-
}
|
|
115
|
+
const visitedAsDeferred = visitedFragmentNames.get(fragName);
|
|
116
|
+
let maybeNewDeferUsage;
|
|
113
117
|
if (!newDeferUsage) {
|
|
114
|
-
|
|
115
|
-
|
|
118
|
+
// If this spread is not deferred, it may be skipped when already visited
|
|
119
|
+
// as a non-deferred spread. If it was previously visited as a deferred spread,
|
|
120
|
+
// it must be revisited.
|
|
121
|
+
if (visitedAsDeferred === false) {
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
visitedFragmentNames.set(fragName, false);
|
|
125
|
+
maybeNewDeferUsage = deferUsage;
|
|
116
126
|
}
|
|
117
127
|
else {
|
|
128
|
+
// If this spread is deferred, it can be skipped if it has already been visited.
|
|
129
|
+
if (visitedAsDeferred !== undefined) {
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
visitedFragmentNames.set(fragName, true);
|
|
118
133
|
newDeferUsages.push(newDeferUsage);
|
|
119
|
-
|
|
134
|
+
maybeNewDeferUsage = newDeferUsage;
|
|
120
135
|
}
|
|
136
|
+
const fragmentVariableSignatures = fragment.variableSignatures;
|
|
137
|
+
let newFragmentVariableValues;
|
|
138
|
+
if (fragmentVariableSignatures) {
|
|
139
|
+
newFragmentVariableValues = getFragmentVariableValues(selection, fragmentVariableSignatures, variableValues, fragmentVariableValues, hideSuggestions);
|
|
140
|
+
}
|
|
141
|
+
collectFieldsImpl(context, fragment.definition.selectionSet, groupedFieldSet, newDeferUsages, maybeNewDeferUsage, newFragmentVariableValues);
|
|
121
142
|
break;
|
|
122
143
|
}
|
|
123
144
|
}
|
|
@@ -145,12 +166,26 @@ function getDeferUsage(variableValues, fragmentVariableValues, node, parentDefer
|
|
|
145
166
|
* Determines if a field should be included based on the `@include` and `@skip`
|
|
146
167
|
* directives, where `@skip` has higher precedence than `@include`.
|
|
147
168
|
*/
|
|
148
|
-
function shouldIncludeNode(node, variableValues, fragmentVariableValues) {
|
|
149
|
-
const
|
|
169
|
+
function shouldIncludeNode(context, node, variableValues, fragmentVariableValues) {
|
|
170
|
+
const skipDirectiveNode = node.directives?.find((directive) => directive.name.value === GraphQLSkipDirective.name);
|
|
171
|
+
if (skipDirectiveNode && context.forbidSkipAndInclude) {
|
|
172
|
+
context.forbiddenDirectiveInstances.push(skipDirectiveNode);
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
const skip = skipDirectiveNode
|
|
176
|
+
? getArgumentValues(GraphQLSkipDirective, skipDirectiveNode, variableValues, fragmentVariableValues, context.hideSuggestions)
|
|
177
|
+
: undefined;
|
|
150
178
|
if (skip?.if === true) {
|
|
151
179
|
return false;
|
|
152
180
|
}
|
|
153
|
-
const
|
|
181
|
+
const includeDirectiveNode = node.directives?.find((directive) => directive.name.value === GraphQLIncludeDirective.name);
|
|
182
|
+
if (includeDirectiveNode && context.forbidSkipAndInclude) {
|
|
183
|
+
context.forbiddenDirectiveInstances.push(includeDirectiveNode);
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
const include = includeDirectiveNode
|
|
187
|
+
? getArgumentValues(GraphQLIncludeDirective, includeDirectiveNode, variableValues, fragmentVariableValues, context.hideSuggestions)
|
|
188
|
+
: undefined;
|
|
154
189
|
if (include?.if === false) {
|
|
155
190
|
return false;
|
|
156
191
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectFields.js","sourceRoot":"","sources":["../../src/execution/collectFields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,sCAAqC;AAU9D,OAAO,EAAE,IAAI,EAAE,8BAA6B;AAG5C,OAAO,EAAE,cAAc,EAAE,+BAA8B;AACvD,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,GACrB,+BAA8B;AAG/B,OAAO,EAAE,WAAW,EAAE,qCAAoC;AAI1D,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,qBAAoB;AA+B5E;;;;;;;;GAQG;AACH,yDAAyD;AACzD,MAAM,UAAU,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CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,eAAe,GAAG,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC/D,IAAI,eAAe,KAAK,IAAI,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,cAAc,CAAC,eAAe,CAAC,EAAE,CAAC;QACpC,OAAO,MAAM,CAAC,SAAS,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB,CAAC,IAAe;IACvC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;AACzD,CAAC","sourcesContent":["import { AccumulatorMap } from '../jsutils/AccumulatorMap.js';\nimport type { ObjMap } from '../jsutils/ObjMap.js';\n\nimport type {\n FieldNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n SelectionSetNode,\n} from '../language/ast.js';\nimport { Kind } from '../language/kinds.js';\n\nimport type { GraphQLObjectType } from '../type/definition.js';\nimport { isAbstractType } from '../type/definition.js';\nimport {\n GraphQLDeferDirective,\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n} from '../type/directives.js';\nimport type { GraphQLSchema } from '../type/schema.js';\n\nimport { typeFromAST } from '../utilities/typeFromAST.js';\n\nimport type { GraphQLVariableSignature } from './getVariableSignature.js';\nimport type { VariableValues } from './values.js';\nimport { getDirectiveValues, getFragmentVariableValues } from './values.js';\n\nexport interface DeferUsage {\n label: string | undefined;\n parentDeferUsage: DeferUsage | undefined;\n}\n\nexport interface FieldDetails {\n node: FieldNode;\n deferUsage?: DeferUsage | undefined;\n fragmentVariableValues?: VariableValues | undefined;\n}\n\nexport type FieldDetailsList = ReadonlyArray<FieldDetails>;\n\nexport type GroupedFieldSet = ReadonlyMap<string, FieldDetailsList>;\n\nexport interface FragmentDetails {\n definition: FragmentDefinitionNode;\n variableSignatures?: ObjMap<GraphQLVariableSignature> | undefined;\n}\n\ninterface CollectFieldsContext {\n schema: GraphQLSchema;\n fragments: ObjMap<FragmentDetails>;\n variableValues: VariableValues;\n runtimeType: GraphQLObjectType;\n visitedFragmentNames: Set<string>;\n hideSuggestions: boolean;\n}\n\n/**\n * Given a selectionSet, collects all of the fields and returns them.\n *\n * CollectFields requires the \"runtime type\" of an object. For a field that\n * returns an Interface or Union type, the \"runtime type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/max-params\nexport function collectFields(\n schema: GraphQLSchema,\n fragments: ObjMap<FragmentDetails>,\n variableValues: VariableValues,\n runtimeType: GraphQLObjectType,\n selectionSet: SelectionSetNode,\n hideSuggestions: boolean,\n): {\n groupedFieldSet: GroupedFieldSet;\n newDeferUsages: ReadonlyArray<DeferUsage>;\n} {\n const groupedFieldSet = new AccumulatorMap<string, FieldDetails>();\n const newDeferUsages: Array<DeferUsage> = [];\n const context: CollectFieldsContext = {\n schema,\n fragments,\n variableValues,\n runtimeType,\n visitedFragmentNames: new Set(),\n hideSuggestions,\n };\n\n collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsages);\n return { groupedFieldSet, newDeferUsages };\n}\n\n/**\n * Given an array of field nodes, collects all of the subfields of the passed\n * in fields, and returns them at the end.\n *\n * CollectSubFields requires the \"return type\" of an object. For a field that\n * returns an Interface or Union type, the \"return type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/max-params\nexport function collectSubfields(\n schema: GraphQLSchema,\n fragments: ObjMap<FragmentDetails>,\n variableValues: VariableValues,\n returnType: GraphQLObjectType,\n fieldDetailsList: FieldDetailsList,\n hideSuggestions: boolean,\n): {\n groupedFieldSet: GroupedFieldSet;\n newDeferUsages: ReadonlyArray<DeferUsage>;\n} {\n const context: CollectFieldsContext = {\n schema,\n fragments,\n variableValues,\n runtimeType: returnType,\n visitedFragmentNames: new Set(),\n hideSuggestions,\n };\n const subGroupedFieldSet = new AccumulatorMap<string, FieldDetails>();\n const newDeferUsages: Array<DeferUsage> = [];\n\n for (const fieldDetail of fieldDetailsList) {\n const selectionSet = fieldDetail.node.selectionSet;\n if (selectionSet) {\n const { deferUsage, fragmentVariableValues } = fieldDetail;\n collectFieldsImpl(\n context,\n selectionSet,\n subGroupedFieldSet,\n newDeferUsages,\n deferUsage,\n fragmentVariableValues,\n );\n }\n }\n\n return {\n groupedFieldSet: subGroupedFieldSet,\n newDeferUsages,\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/max-params\nfunction collectFieldsImpl(\n context: CollectFieldsContext,\n selectionSet: SelectionSetNode,\n groupedFieldSet: AccumulatorMap<string, FieldDetails>,\n newDeferUsages: Array<DeferUsage>,\n deferUsage?: DeferUsage,\n fragmentVariableValues?: VariableValues,\n): void {\n const {\n schema,\n fragments,\n variableValues,\n runtimeType,\n visitedFragmentNames,\n hideSuggestions,\n } = context;\n\n for (const selection of selectionSet.selections) {\n switch (selection.kind) {\n case Kind.FIELD: {\n if (\n !shouldIncludeNode(selection, variableValues, fragmentVariableValues)\n ) {\n continue;\n }\n groupedFieldSet.add(getFieldEntryKey(selection), {\n node: selection,\n deferUsage,\n fragmentVariableValues,\n });\n break;\n }\n case Kind.INLINE_FRAGMENT: {\n if (\n !shouldIncludeNode(\n selection,\n variableValues,\n fragmentVariableValues,\n ) ||\n !doesFragmentConditionMatch(schema, selection, runtimeType)\n ) {\n continue;\n }\n\n const newDeferUsage = getDeferUsage(\n variableValues,\n fragmentVariableValues,\n selection,\n deferUsage,\n );\n\n if (!newDeferUsage) {\n collectFieldsImpl(\n context,\n selection.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n deferUsage,\n fragmentVariableValues,\n );\n } else {\n newDeferUsages.push(newDeferUsage);\n collectFieldsImpl(\n context,\n selection.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n newDeferUsage,\n fragmentVariableValues,\n );\n }\n\n break;\n }\n case Kind.FRAGMENT_SPREAD: {\n const fragName = selection.name.value;\n\n if (\n visitedFragmentNames.has(fragName) ||\n !shouldIncludeNode(selection, variableValues, fragmentVariableValues)\n ) {\n continue;\n }\n\n const fragment = fragments[fragName];\n if (\n fragment == null ||\n !doesFragmentConditionMatch(schema, fragment.definition, runtimeType)\n ) {\n continue;\n }\n\n const newDeferUsage = getDeferUsage(\n variableValues,\n fragmentVariableValues,\n selection,\n deferUsage,\n );\n\n const fragmentVariableSignatures = fragment.variableSignatures;\n let newFragmentVariableValues: VariableValues | undefined;\n if (fragmentVariableSignatures) {\n newFragmentVariableValues = getFragmentVariableValues(\n selection,\n fragmentVariableSignatures,\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n }\n\n if (!newDeferUsage) {\n visitedFragmentNames.add(fragName);\n collectFieldsImpl(\n context,\n fragment.definition.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n deferUsage,\n newFragmentVariableValues,\n );\n } else {\n newDeferUsages.push(newDeferUsage);\n collectFieldsImpl(\n context,\n fragment.definition.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n newDeferUsage,\n newFragmentVariableValues,\n );\n }\n break;\n }\n }\n }\n}\n\n/**\n * Returns an object containing the `@defer` arguments if a field should be\n * deferred based on the experimental flag, defer directive present and\n * not disabled by the \"if\" argument.\n */\nfunction getDeferUsage(\n variableValues: VariableValues,\n fragmentVariableValues: VariableValues | undefined,\n node: FragmentSpreadNode | InlineFragmentNode,\n parentDeferUsage: DeferUsage | undefined,\n): DeferUsage | undefined {\n const defer = getDirectiveValues(\n GraphQLDeferDirective,\n node,\n variableValues,\n fragmentVariableValues,\n );\n\n if (!defer) {\n return;\n }\n\n if (defer.if === false) {\n return;\n }\n\n return {\n label: typeof defer.label === 'string' ? defer.label : undefined,\n parentDeferUsage,\n };\n}\n\n/**\n * Determines if a field should be included based on the `@include` and `@skip`\n * directives, where `@skip` has higher precedence than `@include`.\n */\nfunction shouldIncludeNode(\n node: FragmentSpreadNode | FieldNode | InlineFragmentNode,\n variableValues: VariableValues,\n fragmentVariableValues: VariableValues | undefined,\n): boolean {\n const skip = getDirectiveValues(\n GraphQLSkipDirective,\n node,\n variableValues,\n fragmentVariableValues,\n );\n if (skip?.if === true) {\n return false;\n }\n\n const include = getDirectiveValues(\n GraphQLIncludeDirective,\n node,\n variableValues,\n fragmentVariableValues,\n );\n if (include?.if === false) {\n return false;\n }\n return true;\n}\n\n/**\n * Determines if a fragment is applicable to the given type.\n */\nfunction doesFragmentConditionMatch(\n schema: GraphQLSchema,\n fragment: FragmentDefinitionNode | InlineFragmentNode,\n type: GraphQLObjectType,\n): boolean {\n const typeConditionNode = fragment.typeCondition;\n if (!typeConditionNode) {\n return true;\n }\n const conditionalType = typeFromAST(schema, typeConditionNode);\n if (conditionalType === type) {\n return true;\n }\n if (isAbstractType(conditionalType)) {\n return schema.isSubType(conditionalType, type);\n }\n return false;\n}\n\n/**\n * Implements the logic to compute the key of a given field's entry\n */\nfunction getFieldEntryKey(node: FieldNode): string {\n return node.alias ? node.alias.value : node.name.value;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"collectFields.js","sourceRoot":"","sources":["../../src/execution/collectFields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,sCAAqC;AAY9D,OAAO,EAAE,IAAI,EAAE,8BAA6B;AAG5C,OAAO,EAAE,cAAc,EAAE,+BAA8B;AACvD,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,GACrB,+BAA8B;AAG/B,OAAO,EAAE,WAAW,EAAE,qCAAoC;AAI1D,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,GAC1B,qBAAoB;AA4CrB;;;;;;;;GAQG;AACH,sCAAsC;AACtC,MAAM,UAAU,aAAa,CAC3B,MAAqB,EACrB,SAAkC,EAClC,cAA8B,EAC9B,WAA8B,EAC9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AC;IACd,CAAC;IACD,MAAM,eAAe,GAAG,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC/D,IAAI,eAAe,KAAK,IAAI,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,cAAc,CAAC,eAAe,CAAC,EAAE,CAAC;QACpC,OAAO,MAAM,CAAC,SAAS,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB,CAAC,IAAe;IACvC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;AACzD,CAAC","sourcesContent":["import { AccumulatorMap } from '../jsutils/AccumulatorMap.js';\nimport type { ObjMap, ReadOnlyObjMap } from '../jsutils/ObjMap.js';\n\nimport type {\n ConstValueNode,\n DirectiveNode,\n FieldNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n SelectionSetNode,\n} from '../language/ast.js';\nimport { Kind } from '../language/kinds.js';\n\nimport type { GraphQLObjectType } from '../type/definition.js';\nimport { isAbstractType } from '../type/definition.js';\nimport {\n GraphQLDeferDirective,\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n} from '../type/directives.js';\nimport type { GraphQLSchema } from '../type/schema.js';\n\nimport { typeFromAST } from '../utilities/typeFromAST.js';\n\nimport type { GraphQLVariableSignature } from './getVariableSignature.js';\nimport type { VariableValues } from './values.js';\nimport {\n getArgumentValues,\n getDirectiveValues,\n getFragmentVariableValues,\n} from './values.js';\n\nexport interface DeferUsage {\n label: string | undefined;\n parentDeferUsage: DeferUsage | undefined;\n}\n\nexport interface FragmentVariableValues {\n readonly sources: ReadOnlyObjMap<FragmentVariableValueSource>;\n readonly coerced: ReadOnlyObjMap<unknown>;\n}\n\ninterface FragmentVariableValueSource {\n readonly signature: GraphQLVariableSignature;\n readonly value?: ConstValueNode;\n readonly fragmentVariableValues?: FragmentVariableValues;\n}\n\nexport interface FieldDetails {\n node: FieldNode;\n deferUsage?: DeferUsage | undefined;\n fragmentVariableValues?: FragmentVariableValues | undefined;\n}\n\nexport type FieldDetailsList = ReadonlyArray<FieldDetails>;\n\nexport type GroupedFieldSet = ReadonlyMap<string, FieldDetailsList>;\n\nexport interface FragmentDetails {\n definition: FragmentDefinitionNode;\n variableSignatures?: ObjMap<GraphQLVariableSignature> | undefined;\n}\n\ninterface CollectFieldsContext {\n schema: GraphQLSchema;\n fragments: ObjMap<FragmentDetails>;\n variableValues: VariableValues;\n runtimeType: GraphQLObjectType;\n visitedFragmentNames: Map<string, boolean>;\n hideSuggestions: boolean;\n forbiddenDirectiveInstances: Array<DirectiveNode>;\n forbidSkipAndInclude: boolean;\n}\n\n/**\n * Given a selectionSet, collects all of the fields and returns them.\n *\n * CollectFields requires the \"runtime type\" of an object. For a field that\n * returns an Interface or Union type, the \"runtime type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n// eslint-disable-next-line max-params\nexport function collectFields(\n schema: GraphQLSchema,\n fragments: ObjMap<FragmentDetails>,\n variableValues: VariableValues,\n runtimeType: GraphQLObjectType,\n selectionSet: SelectionSetNode,\n hideSuggestions: boolean,\n forbidSkipAndInclude = false,\n): {\n groupedFieldSet: GroupedFieldSet;\n newDeferUsages: ReadonlyArray<DeferUsage>;\n forbiddenDirectiveInstances: ReadonlyArray<DirectiveNode>;\n} {\n const groupedFieldSet = new AccumulatorMap<string, FieldDetails>();\n const newDeferUsages: Array<DeferUsage> = [];\n const context: CollectFieldsContext = {\n schema,\n fragments,\n variableValues,\n runtimeType,\n visitedFragmentNames: new Map(),\n hideSuggestions,\n forbiddenDirectiveInstances: [],\n forbidSkipAndInclude,\n };\n\n collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsages);\n return {\n groupedFieldSet,\n newDeferUsages,\n forbiddenDirectiveInstances: context.forbiddenDirectiveInstances,\n };\n}\n\n/**\n * Given an array of field nodes, collects all of the subfields of the passed\n * in fields, and returns them at the end.\n *\n * CollectSubFields requires the \"return type\" of an object. For a field that\n * returns an Interface or Union type, the \"return type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n// eslint-disable-next-line max-params\nexport function collectSubfields(\n schema: GraphQLSchema,\n fragments: ObjMap<FragmentDetails>,\n variableValues: VariableValues,\n returnType: GraphQLObjectType,\n fieldDetailsList: FieldDetailsList,\n hideSuggestions: boolean,\n): {\n groupedFieldSet: GroupedFieldSet;\n newDeferUsages: ReadonlyArray<DeferUsage>;\n} {\n const context: CollectFieldsContext = {\n schema,\n fragments,\n variableValues,\n runtimeType: returnType,\n visitedFragmentNames: new Map(),\n hideSuggestions,\n forbiddenDirectiveInstances: [],\n forbidSkipAndInclude: false,\n };\n const subGroupedFieldSet = new AccumulatorMap<string, FieldDetails>();\n const newDeferUsages: Array<DeferUsage> = [];\n\n for (const fieldDetail of fieldDetailsList) {\n const selectionSet = fieldDetail.node.selectionSet;\n if (selectionSet) {\n const { deferUsage, fragmentVariableValues } = fieldDetail;\n collectFieldsImpl(\n context,\n selectionSet,\n subGroupedFieldSet,\n newDeferUsages,\n deferUsage,\n fragmentVariableValues,\n );\n }\n }\n\n return {\n groupedFieldSet: subGroupedFieldSet,\n newDeferUsages,\n };\n}\n\n// eslint-disable-next-line max-params\nfunction collectFieldsImpl(\n context: CollectFieldsContext,\n selectionSet: SelectionSetNode,\n groupedFieldSet: AccumulatorMap<string, FieldDetails>,\n newDeferUsages: Array<DeferUsage>,\n deferUsage?: DeferUsage,\n fragmentVariableValues?: FragmentVariableValues,\n): void {\n const {\n schema,\n fragments,\n variableValues,\n runtimeType,\n visitedFragmentNames,\n hideSuggestions,\n } = context;\n\n for (const selection of selectionSet.selections) {\n switch (selection.kind) {\n case Kind.FIELD: {\n if (\n !shouldIncludeNode(\n context,\n selection,\n variableValues,\n fragmentVariableValues,\n )\n ) {\n continue;\n }\n groupedFieldSet.add(getFieldEntryKey(selection), {\n node: selection,\n deferUsage,\n fragmentVariableValues,\n });\n break;\n }\n case Kind.INLINE_FRAGMENT: {\n if (\n !shouldIncludeNode(\n context,\n selection,\n variableValues,\n fragmentVariableValues,\n ) ||\n !doesFragmentConditionMatch(schema, selection, runtimeType)\n ) {\n continue;\n }\n\n const newDeferUsage = getDeferUsage(\n variableValues,\n fragmentVariableValues,\n selection,\n deferUsage,\n );\n\n if (!newDeferUsage) {\n collectFieldsImpl(\n context,\n selection.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n deferUsage,\n fragmentVariableValues,\n );\n } else {\n newDeferUsages.push(newDeferUsage);\n collectFieldsImpl(\n context,\n selection.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n newDeferUsage,\n fragmentVariableValues,\n );\n }\n\n break;\n }\n case Kind.FRAGMENT_SPREAD: {\n const fragName = selection.name.value;\n\n if (\n !shouldIncludeNode(\n context,\n selection,\n variableValues,\n fragmentVariableValues,\n )\n ) {\n continue;\n }\n\n const fragment = fragments[fragName];\n if (\n fragment == null ||\n !doesFragmentConditionMatch(schema, fragment.definition, runtimeType)\n ) {\n continue;\n }\n\n const newDeferUsage = getDeferUsage(\n variableValues,\n fragmentVariableValues,\n selection,\n deferUsage,\n );\n\n const visitedAsDeferred = visitedFragmentNames.get(fragName);\n\n let maybeNewDeferUsage: DeferUsage | undefined;\n if (!newDeferUsage) {\n // If this spread is not deferred, it may be skipped when already visited\n // as a non-deferred spread. If it was previously visited as a deferred spread,\n // it must be revisited.\n if (visitedAsDeferred === false) {\n continue;\n }\n visitedFragmentNames.set(fragName, false);\n maybeNewDeferUsage = deferUsage;\n } else {\n // If this spread is deferred, it can be skipped if it has already been visited.\n if (visitedAsDeferred !== undefined) {\n continue;\n }\n visitedFragmentNames.set(fragName, true);\n newDeferUsages.push(newDeferUsage);\n maybeNewDeferUsage = newDeferUsage;\n }\n\n const fragmentVariableSignatures = fragment.variableSignatures;\n let newFragmentVariableValues: FragmentVariableValues | undefined;\n if (fragmentVariableSignatures) {\n newFragmentVariableValues = getFragmentVariableValues(\n selection,\n fragmentVariableSignatures,\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n }\n\n collectFieldsImpl(\n context,\n fragment.definition.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n maybeNewDeferUsage,\n newFragmentVariableValues,\n );\n break;\n }\n }\n }\n}\n\n/**\n * Returns an object containing the `@defer` arguments if a field should be\n * deferred based on the experimental flag, defer directive present and\n * not disabled by the \"if\" argument.\n */\nfunction getDeferUsage(\n variableValues: VariableValues,\n fragmentVariableValues: FragmentVariableValues | undefined,\n node: FragmentSpreadNode | InlineFragmentNode,\n parentDeferUsage: DeferUsage | undefined,\n): DeferUsage | undefined {\n const defer = getDirectiveValues(\n GraphQLDeferDirective,\n node,\n variableValues,\n fragmentVariableValues,\n );\n\n if (!defer) {\n return;\n }\n\n if (defer.if === false) {\n return;\n }\n\n return {\n label: typeof defer.label === 'string' ? defer.label : undefined,\n parentDeferUsage,\n };\n}\n\n/**\n * Determines if a field should be included based on the `@include` and `@skip`\n * directives, where `@skip` has higher precedence than `@include`.\n */\nfunction shouldIncludeNode(\n context: CollectFieldsContext,\n node: FragmentSpreadNode | FieldNode | InlineFragmentNode,\n variableValues: VariableValues,\n fragmentVariableValues: FragmentVariableValues | undefined,\n): boolean {\n const skipDirectiveNode = node.directives?.find(\n (directive) => directive.name.value === GraphQLSkipDirective.name,\n );\n if (skipDirectiveNode && context.forbidSkipAndInclude) {\n context.forbiddenDirectiveInstances.push(skipDirectiveNode);\n return false;\n }\n const skip = skipDirectiveNode\n ? getArgumentValues(\n GraphQLSkipDirective,\n skipDirectiveNode,\n variableValues,\n fragmentVariableValues,\n context.hideSuggestions,\n )\n : undefined;\n if (skip?.if === true) {\n return false;\n }\n\n const includeDirectiveNode = node.directives?.find(\n (directive) => directive.name.value === GraphQLIncludeDirective.name,\n );\n if (includeDirectiveNode && context.forbidSkipAndInclude) {\n context.forbiddenDirectiveInstances.push(includeDirectiveNode);\n return false;\n }\n const include = includeDirectiveNode\n ? getArgumentValues(\n GraphQLIncludeDirective,\n includeDirectiveNode,\n variableValues,\n fragmentVariableValues,\n context.hideSuggestions,\n )\n : undefined;\n if (include?.if === false) {\n return false;\n }\n return true;\n}\n\n/**\n * Determines if a fragment is applicable to the given type.\n */\nfunction doesFragmentConditionMatch(\n schema: GraphQLSchema,\n fragment: FragmentDefinitionNode | InlineFragmentNode,\n type: GraphQLObjectType,\n): boolean {\n const typeConditionNode = fragment.typeCondition;\n if (!typeConditionNode) {\n return true;\n }\n const conditionalType = typeFromAST(schema, typeConditionNode);\n if (conditionalType === type) {\n return true;\n }\n if (isAbstractType(conditionalType)) {\n return schema.isSubType(conditionalType, type);\n }\n return false;\n}\n\n/**\n * Implements the logic to compute the key of a given field's entry\n */\nfunction getFieldEntryKey(node: FieldNode): string {\n return node.alias ? node.alias.value : node.name.value;\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.collectIteratorPromises = collectIteratorPromises;
|
|
4
|
+
const isPromise_js_1 = require("../jsutils/isPromise.js");
|
|
5
|
+
/**
|
|
6
|
+
* Drain a sync iterator after abrupt completion so later promise rejections
|
|
7
|
+
* can be observed before they become unhandled.
|
|
8
|
+
*/
|
|
9
|
+
function collectIteratorPromises(iterator) {
|
|
10
|
+
const promises = [];
|
|
11
|
+
try {
|
|
12
|
+
while (true) {
|
|
13
|
+
const iteration = iterator.next();
|
|
14
|
+
if (iteration.done) {
|
|
15
|
+
return promises;
|
|
16
|
+
}
|
|
17
|
+
if ((0, isPromise_js_1.isPromiseLike)(iteration.value)) {
|
|
18
|
+
promises.push(iteration.value);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
// Ignore errors while draining the remaining items.
|
|
24
|
+
return promises;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=collectIteratorPromises.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectIteratorPromises.js","sourceRoot":"","sources":["../../src/execution/collectIteratorPromises.ts"],"names":[],"mappings":";;AAMA,0DAkBC;AAxBD,0DAAwD;AAExD;;;GAGG;AACH,SAAgB,uBAAuB,CACrC,QAA2B;IAE3B,MAAM,QAAQ,GAAG,EAAE,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,IAAI,EAAE,CAAC;YACZ,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;YAClC,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;gBACnB,OAAO,QAAQ,CAAC;YAClB,CAAC;YACD,IAAI,IAAA,4BAAa,EAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;gBACnC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,oDAAoD;QACpD,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC","sourcesContent":["import { isPromiseLike } from '../jsutils/isPromise.js';\n\n/**\n * Drain a sync iterator after abrupt completion so later promise rejections\n * can be observed before they become unhandled.\n */\nexport function collectIteratorPromises(\n iterator: Iterator<unknown>,\n): Array<unknown> {\n const promises = [];\n try {\n while (true) {\n const iteration = iterator.next();\n if (iteration.done) {\n return promises;\n }\n if (isPromiseLike(iteration.value)) {\n promises.push(iteration.value);\n }\n }\n } catch {\n // Ignore errors while draining the remaining items.\n return promises;\n }\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { isPromiseLike } from "../jsutils/isPromise.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Drain a sync iterator after abrupt completion so later promise rejections
|
|
4
|
+
* can be observed before they become unhandled.
|
|
5
|
+
*/
|
|
6
|
+
export function collectIteratorPromises(iterator) {
|
|
7
|
+
const promises = [];
|
|
8
|
+
try {
|
|
9
|
+
while (true) {
|
|
10
|
+
const iteration = iterator.next();
|
|
11
|
+
if (iteration.done) {
|
|
12
|
+
return promises;
|
|
13
|
+
}
|
|
14
|
+
if (isPromiseLike(iteration.value)) {
|
|
15
|
+
promises.push(iteration.value);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
// Ignore errors while draining the remaining items.
|
|
21
|
+
return promises;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=collectIteratorPromises.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectIteratorPromises.js","sourceRoot":"","sources":["../../src/execution/collectIteratorPromises.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iCAAgC;AAExD;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CACrC,QAA2B;IAE3B,MAAM,QAAQ,GAAG,EAAE,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,IAAI,EAAE,CAAC;YACZ,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;YAClC,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;gBACnB,OAAO,QAAQ,CAAC;YAClB,CAAC;YACD,IAAI,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;gBACnC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,oDAAoD;QACpD,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC","sourcesContent":["import { isPromiseLike } from '../jsutils/isPromise.js';\n\n/**\n * Drain a sync iterator after abrupt completion so later promise rejections\n * can be observed before they become unhandled.\n */\nexport function collectIteratorPromises(\n iterator: Iterator<unknown>,\n): Array<unknown> {\n const promises = [];\n try {\n while (true) {\n const iteration = iterator.next();\n if (iteration.done) {\n return promises;\n }\n if (isPromiseLike(iteration.value)) {\n promises.push(iteration.value);\n }\n }\n } catch {\n // Ignore errors while draining the remaining items.\n return promises;\n }\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GraphQLResolveInfoHelpers } from '../type/index.js';
|
|
2
|
+
import { AsyncWorkTracker } from './AsyncWorkTracker.js';
|
|
3
|
+
/** @internal */
|
|
4
|
+
export interface SharedExecutionContext {
|
|
5
|
+
asyncWorkTracker: AsyncWorkTracker;
|
|
6
|
+
getAbortSignal: () => AbortSignal | undefined;
|
|
7
|
+
getAsyncHelpers: () => GraphQLResolveInfoHelpers;
|
|
8
|
+
promiseAll: <T>(values: ReadonlyArray<PromiseLike<T> | T>) => Promise<Array<T>>;
|
|
9
|
+
}
|
|
10
|
+
export declare function createSharedExecutionContext(abortSignal: AbortSignal | undefined): SharedExecutionContext;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GraphQLResolveInfoHelpers } from '../type/index.js';
|
|
2
|
+
import { AsyncWorkTracker } from './AsyncWorkTracker.js';
|
|
3
|
+
/** @internal */
|
|
4
|
+
export interface SharedExecutionContext {
|
|
5
|
+
asyncWorkTracker: AsyncWorkTracker;
|
|
6
|
+
getAbortSignal: () => AbortSignal | undefined;
|
|
7
|
+
getAsyncHelpers: () => GraphQLResolveInfoHelpers;
|
|
8
|
+
promiseAll: <T>(values: ReadonlyArray<PromiseLike<T> | T>) => Promise<Array<T>>;
|
|
9
|
+
}
|
|
10
|
+
export declare function createSharedExecutionContext(abortSignal: AbortSignal | undefined): SharedExecutionContext;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSharedExecutionContext = createSharedExecutionContext;
|
|
4
|
+
const AsyncWorkTracker_js_1 = require("./AsyncWorkTracker.js");
|
|
5
|
+
function createSharedExecutionContext(abortSignal) {
|
|
6
|
+
const asyncWorkTracker = new AsyncWorkTracker_js_1.AsyncWorkTracker();
|
|
7
|
+
let resolveInfoHelpers;
|
|
8
|
+
const promiseAll = (values) => asyncWorkTracker.promiseAllTrackOnReject(values);
|
|
9
|
+
const getAsyncHelpers = () => (resolveInfoHelpers ??= {
|
|
10
|
+
promiseAll,
|
|
11
|
+
track: (maybePromises) => asyncWorkTracker.addValues(maybePromises),
|
|
12
|
+
});
|
|
13
|
+
return {
|
|
14
|
+
asyncWorkTracker,
|
|
15
|
+
getAbortSignal: () => abortSignal,
|
|
16
|
+
getAsyncHelpers,
|
|
17
|
+
promiseAll,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=createSharedExecutionContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSharedExecutionContext.js","sourceRoot":"","sources":["../../src/execution/createSharedExecutionContext.ts"],"names":[],"mappings":";;AAcA,oEAsBC;AAlCD,+DAAyD;AAYzD,SAAgB,4BAA4B,CAC1C,WAAoC;IAEpC,MAAM,gBAAgB,GAAG,IAAI,sCAAgB,EAAE,CAAC;IAChD,IAAI,kBAAyD,CAAC;IAE9D,MAAM,UAAU,GAAG,CACjB,MAAyC,EACtB,EAAE,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAEzE,MAAM,eAAe,GAAG,GAA8B,EAAE,CACtD,CAAC,kBAAkB,KAAK;QACtB,UAAU;QACV,KAAK,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,gBAAgB,CAAC,SAAS,CAAC,aAAa,CAAC;KACpE,CAAC,CAAC;IAEL,OAAO;QACL,gBAAgB;QAChB,cAAc,EAAE,GAAG,EAAE,CAAC,WAAW;QACjC,eAAe;QACf,UAAU;KACX,CAAC;AACJ,CAAC","sourcesContent":["import type { GraphQLResolveInfoHelpers } from '../type/index.js';\n\nimport { AsyncWorkTracker } from './AsyncWorkTracker.js';\n\n/** @internal */\nexport interface SharedExecutionContext {\n asyncWorkTracker: AsyncWorkTracker;\n getAbortSignal: () => AbortSignal | undefined;\n getAsyncHelpers: () => GraphQLResolveInfoHelpers;\n promiseAll: <T>(\n values: ReadonlyArray<PromiseLike<T> | T>,\n ) => Promise<Array<T>>;\n}\n\nexport function createSharedExecutionContext(\n abortSignal: AbortSignal | undefined,\n): SharedExecutionContext {\n const asyncWorkTracker = new AsyncWorkTracker();\n let resolveInfoHelpers: GraphQLResolveInfoHelpers | undefined;\n\n const promiseAll = <T>(\n values: ReadonlyArray<PromiseLike<T> | T>,\n ): Promise<Array<T>> => asyncWorkTracker.promiseAllTrackOnReject(values);\n\n const getAsyncHelpers = (): GraphQLResolveInfoHelpers =>\n (resolveInfoHelpers ??= {\n promiseAll,\n track: (maybePromises) => asyncWorkTracker.addValues(maybePromises),\n });\n\n return {\n asyncWorkTracker,\n getAbortSignal: () => abortSignal,\n getAsyncHelpers,\n promiseAll,\n };\n}\n"]}
|