graphql 17.0.0-alpha.8 → 17.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -10
- package/__dev__/devMode.d.mts +1 -0
- package/__dev__/devMode.d.ts +1 -0
- package/__dev__/devMode.js +3 -0
- package/__dev__/devMode.mjs +3 -0
- package/__dev__/error/GraphQLError.d.mts +1 -0
- package/__dev__/error/GraphQLError.d.ts +1 -0
- package/__dev__/error/GraphQLError.js +3 -0
- package/__dev__/error/GraphQLError.mjs +3 -0
- package/__dev__/error/ensureGraphQLError.d.mts +1 -0
- package/__dev__/error/ensureGraphQLError.d.ts +1 -0
- package/__dev__/error/ensureGraphQLError.js +3 -0
- package/__dev__/error/ensureGraphQLError.mjs +3 -0
- package/__dev__/error/index.d.mts +1 -0
- package/__dev__/error/index.d.ts +1 -0
- package/__dev__/error/index.js +3 -0
- package/__dev__/error/index.mjs +3 -0
- package/__dev__/error/locatedError.d.mts +1 -0
- package/__dev__/error/locatedError.d.ts +1 -0
- package/__dev__/error/locatedError.js +3 -0
- package/__dev__/error/locatedError.mjs +3 -0
- package/__dev__/error/syntaxError.d.mts +1 -0
- package/__dev__/error/syntaxError.d.ts +1 -0
- package/__dev__/error/syntaxError.js +3 -0
- package/__dev__/error/syntaxError.mjs +3 -0
- package/__dev__/execution/AbortedGraphQLExecutionError.d.mts +1 -0
- package/__dev__/execution/AbortedGraphQLExecutionError.d.ts +1 -0
- package/__dev__/execution/AbortedGraphQLExecutionError.js +3 -0
- package/__dev__/execution/AbortedGraphQLExecutionError.mjs +3 -0
- package/__dev__/execution/AsyncWorkTracker.d.mts +1 -0
- package/__dev__/execution/AsyncWorkTracker.d.ts +1 -0
- package/__dev__/execution/AsyncWorkTracker.js +3 -0
- package/__dev__/execution/AsyncWorkTracker.mjs +3 -0
- package/__dev__/execution/Executor.d.mts +1 -0
- package/__dev__/execution/Executor.d.ts +1 -0
- package/__dev__/execution/Executor.js +3 -0
- package/__dev__/execution/Executor.mjs +3 -0
- package/__dev__/execution/ExecutorThrowingOnIncremental.d.mts +1 -0
- package/__dev__/execution/ExecutorThrowingOnIncremental.d.ts +1 -0
- package/__dev__/execution/ExecutorThrowingOnIncremental.js +3 -0
- package/__dev__/execution/ExecutorThrowingOnIncremental.mjs +3 -0
- package/__dev__/execution/cancellablePromise.d.mts +1 -0
- package/__dev__/execution/cancellablePromise.d.ts +1 -0
- package/__dev__/execution/cancellablePromise.js +3 -0
- package/__dev__/execution/cancellablePromise.mjs +3 -0
- package/__dev__/execution/collectFields.d.mts +1 -0
- package/__dev__/execution/collectFields.d.ts +1 -0
- package/__dev__/execution/collectFields.js +3 -0
- package/__dev__/execution/collectFields.mjs +3 -0
- package/__dev__/execution/collectIteratorPromises.d.mts +1 -0
- package/__dev__/execution/collectIteratorPromises.d.ts +1 -0
- package/__dev__/execution/collectIteratorPromises.js +3 -0
- package/__dev__/execution/collectIteratorPromises.mjs +3 -0
- package/__dev__/execution/createSharedExecutionContext.d.mts +1 -0
- package/__dev__/execution/createSharedExecutionContext.d.ts +1 -0
- package/__dev__/execution/createSharedExecutionContext.js +3 -0
- package/__dev__/execution/createSharedExecutionContext.mjs +3 -0
- package/__dev__/execution/execute.d.mts +1 -0
- package/__dev__/execution/execute.d.ts +1 -0
- package/__dev__/execution/execute.js +3 -0
- package/__dev__/execution/execute.mjs +3 -0
- package/__dev__/execution/getStreamUsage.d.mts +1 -0
- package/__dev__/execution/getStreamUsage.d.ts +1 -0
- package/__dev__/execution/getStreamUsage.js +3 -0
- package/__dev__/execution/getStreamUsage.mjs +3 -0
- package/__dev__/execution/getVariableSignature.d.mts +1 -0
- package/__dev__/execution/getVariableSignature.d.ts +1 -0
- package/__dev__/execution/getVariableSignature.js +3 -0
- package/__dev__/execution/getVariableSignature.mjs +3 -0
- package/__dev__/execution/hooks.d.mts +1 -0
- package/__dev__/execution/hooks.d.ts +1 -0
- package/__dev__/execution/hooks.js +3 -0
- package/__dev__/execution/hooks.mjs +3 -0
- package/__dev__/execution/incremental/Computation.d.mts +1 -0
- package/__dev__/execution/incremental/Computation.d.ts +1 -0
- package/__dev__/execution/incremental/Computation.js +3 -0
- package/__dev__/execution/incremental/Computation.mjs +3 -0
- package/__dev__/execution/incremental/IncrementalExecutor.d.mts +1 -0
- package/__dev__/execution/incremental/IncrementalExecutor.d.ts +1 -0
- package/__dev__/execution/incremental/IncrementalExecutor.js +3 -0
- package/__dev__/execution/incremental/IncrementalExecutor.mjs +3 -0
- package/__dev__/execution/incremental/IncrementalPublisher.d.mts +1 -0
- package/__dev__/execution/incremental/IncrementalPublisher.d.ts +1 -0
- package/__dev__/execution/incremental/IncrementalPublisher.js +3 -0
- package/__dev__/execution/incremental/IncrementalPublisher.mjs +3 -0
- package/__dev__/execution/incremental/Queue.d.mts +1 -0
- package/__dev__/execution/incremental/Queue.d.ts +1 -0
- package/__dev__/execution/incremental/Queue.js +3 -0
- package/__dev__/execution/incremental/Queue.mjs +3 -0
- package/__dev__/execution/incremental/WorkQueue.d.mts +1 -0
- package/__dev__/execution/incremental/WorkQueue.d.ts +1 -0
- package/__dev__/execution/incremental/WorkQueue.js +3 -0
- package/__dev__/execution/incremental/WorkQueue.mjs +3 -0
- package/__dev__/execution/incremental/buildExecutionPlan.d.mts +1 -0
- package/__dev__/execution/incremental/buildExecutionPlan.d.ts +1 -0
- package/__dev__/execution/incremental/buildExecutionPlan.js +3 -0
- package/__dev__/execution/incremental/buildExecutionPlan.mjs +3 -0
- package/__dev__/execution/index.d.mts +1 -0
- package/__dev__/execution/index.d.ts +1 -0
- package/__dev__/execution/index.js +3 -0
- package/__dev__/execution/index.mjs +3 -0
- package/__dev__/execution/mapAsyncIterable.d.mts +1 -0
- package/__dev__/execution/mapAsyncIterable.d.ts +1 -0
- package/__dev__/execution/mapAsyncIterable.js +3 -0
- package/__dev__/execution/mapAsyncIterable.mjs +3 -0
- package/__dev__/execution/returnIteratorCatchingErrors.d.mts +1 -0
- package/__dev__/execution/returnIteratorCatchingErrors.d.ts +1 -0
- package/__dev__/execution/returnIteratorCatchingErrors.js +3 -0
- package/__dev__/execution/returnIteratorCatchingErrors.mjs +3 -0
- package/__dev__/execution/values.d.mts +1 -0
- package/__dev__/execution/values.d.ts +1 -0
- package/__dev__/execution/values.js +3 -0
- package/__dev__/execution/values.mjs +3 -0
- package/__dev__/execution/withConcurrentAbruptClose.d.mts +1 -0
- package/__dev__/execution/withConcurrentAbruptClose.d.ts +1 -0
- package/__dev__/execution/withConcurrentAbruptClose.js +3 -0
- package/__dev__/execution/withConcurrentAbruptClose.mjs +3 -0
- package/__dev__/graphql.d.mts +1 -0
- package/__dev__/graphql.d.ts +1 -0
- package/__dev__/graphql.js +3 -0
- package/__dev__/graphql.mjs +3 -0
- package/__dev__/harness.d.mts +1 -0
- package/__dev__/harness.d.ts +1 -0
- package/__dev__/harness.js +3 -0
- package/__dev__/harness.mjs +3 -0
- package/__dev__/index.d.mts +1 -0
- package/__dev__/index.d.ts +1 -0
- package/__dev__/index.js +3 -0
- package/__dev__/index.mjs +3 -0
- package/__dev__/jsutils/AccumulatorMap.d.mts +1 -0
- package/__dev__/jsutils/AccumulatorMap.d.ts +1 -0
- package/__dev__/jsutils/AccumulatorMap.js +3 -0
- package/__dev__/jsutils/AccumulatorMap.mjs +3 -0
- package/__dev__/jsutils/Maybe.d.mts +1 -0
- package/__dev__/jsutils/Maybe.d.ts +1 -0
- package/__dev__/jsutils/Maybe.js +3 -0
- package/__dev__/jsutils/Maybe.mjs +3 -0
- package/__dev__/jsutils/ObjMap.d.mts +1 -0
- package/__dev__/jsutils/ObjMap.d.ts +1 -0
- package/__dev__/jsutils/ObjMap.js +3 -0
- package/__dev__/jsutils/ObjMap.mjs +3 -0
- package/__dev__/jsutils/Path.d.mts +1 -0
- package/__dev__/jsutils/Path.d.ts +1 -0
- package/__dev__/jsutils/Path.js +3 -0
- package/__dev__/jsutils/Path.mjs +3 -0
- package/__dev__/jsutils/PromiseOrValue.d.mts +1 -0
- package/__dev__/jsutils/PromiseOrValue.d.ts +1 -0
- package/__dev__/jsutils/PromiseOrValue.js +3 -0
- package/__dev__/jsutils/PromiseOrValue.mjs +3 -0
- package/__dev__/jsutils/capitalize.d.mts +1 -0
- package/__dev__/jsutils/capitalize.d.ts +1 -0
- package/__dev__/jsutils/capitalize.js +3 -0
- package/__dev__/jsutils/capitalize.mjs +3 -0
- package/__dev__/jsutils/devAssert.d.mts +1 -0
- package/__dev__/jsutils/devAssert.d.ts +1 -0
- package/__dev__/jsutils/devAssert.js +3 -0
- package/__dev__/jsutils/devAssert.mjs +3 -0
- package/__dev__/jsutils/didYouMean.d.mts +1 -0
- package/__dev__/jsutils/didYouMean.d.ts +1 -0
- package/__dev__/jsutils/didYouMean.js +3 -0
- package/__dev__/jsutils/didYouMean.mjs +3 -0
- package/__dev__/jsutils/formatList.d.mts +1 -0
- package/__dev__/jsutils/formatList.d.ts +1 -0
- package/__dev__/jsutils/formatList.js +3 -0
- package/__dev__/jsutils/formatList.mjs +3 -0
- package/__dev__/jsutils/getBySet.d.mts +1 -0
- package/__dev__/jsutils/getBySet.d.ts +1 -0
- package/__dev__/jsutils/getBySet.js +3 -0
- package/__dev__/jsutils/getBySet.mjs +3 -0
- package/__dev__/jsutils/groupBy.d.mts +1 -0
- package/__dev__/jsutils/groupBy.d.ts +1 -0
- package/__dev__/jsutils/groupBy.js +3 -0
- package/__dev__/jsutils/groupBy.mjs +3 -0
- package/__dev__/jsutils/identityFunc.d.mts +1 -0
- package/__dev__/jsutils/identityFunc.d.ts +1 -0
- package/__dev__/jsutils/identityFunc.js +3 -0
- package/__dev__/jsutils/identityFunc.mjs +3 -0
- package/__dev__/jsutils/inspect.d.mts +1 -0
- package/__dev__/jsutils/inspect.d.ts +1 -0
- package/__dev__/jsutils/inspect.js +3 -0
- package/__dev__/jsutils/inspect.mjs +3 -0
- package/__dev__/jsutils/instanceOf.d.mts +1 -0
- package/__dev__/jsutils/instanceOf.d.ts +1 -0
- package/__dev__/jsutils/instanceOf.js +3 -0
- package/__dev__/jsutils/instanceOf.mjs +3 -0
- package/__dev__/jsutils/invariant.d.mts +1 -0
- package/__dev__/jsutils/invariant.d.ts +1 -0
- package/__dev__/jsutils/invariant.js +3 -0
- package/__dev__/jsutils/invariant.mjs +3 -0
- package/__dev__/jsutils/isAsyncIterable.d.mts +1 -0
- package/__dev__/jsutils/isAsyncIterable.d.ts +1 -0
- package/__dev__/jsutils/isAsyncIterable.js +3 -0
- package/__dev__/jsutils/isAsyncIterable.mjs +3 -0
- package/__dev__/jsutils/isIterableObject.d.mts +1 -0
- package/__dev__/jsutils/isIterableObject.d.ts +1 -0
- package/__dev__/jsutils/isIterableObject.js +3 -0
- package/__dev__/jsutils/isIterableObject.mjs +3 -0
- package/__dev__/jsutils/isObjectLike.d.mts +1 -0
- package/__dev__/jsutils/isObjectLike.d.ts +1 -0
- package/__dev__/jsutils/isObjectLike.js +3 -0
- package/__dev__/jsutils/isObjectLike.mjs +3 -0
- package/__dev__/jsutils/isPromise.d.mts +1 -0
- package/__dev__/jsutils/isPromise.d.ts +1 -0
- package/__dev__/jsutils/isPromise.js +3 -0
- package/__dev__/jsutils/isPromise.mjs +3 -0
- package/__dev__/jsutils/isSameSet.d.mts +1 -0
- package/__dev__/jsutils/isSameSet.d.ts +1 -0
- package/__dev__/jsutils/isSameSet.js +3 -0
- package/__dev__/jsutils/isSameSet.mjs +3 -0
- package/__dev__/jsutils/keyMap.d.mts +1 -0
- package/__dev__/jsutils/keyMap.d.ts +1 -0
- package/__dev__/jsutils/keyMap.js +3 -0
- package/__dev__/jsutils/keyMap.mjs +3 -0
- package/__dev__/jsutils/keyValMap.d.mts +1 -0
- package/__dev__/jsutils/keyValMap.d.ts +1 -0
- package/__dev__/jsutils/keyValMap.js +3 -0
- package/__dev__/jsutils/keyValMap.mjs +3 -0
- package/__dev__/jsutils/mapValue.d.mts +1 -0
- package/__dev__/jsutils/mapValue.d.ts +1 -0
- package/__dev__/jsutils/mapValue.js +3 -0
- package/__dev__/jsutils/mapValue.mjs +3 -0
- package/__dev__/jsutils/memoize1.d.mts +1 -0
- package/__dev__/jsutils/memoize1.d.ts +1 -0
- package/__dev__/jsutils/memoize1.js +3 -0
- package/__dev__/jsutils/memoize1.mjs +3 -0
- package/__dev__/jsutils/memoize2.d.mts +1 -0
- package/__dev__/jsutils/memoize2.d.ts +1 -0
- package/__dev__/jsutils/memoize2.js +3 -0
- package/__dev__/jsutils/memoize2.mjs +3 -0
- package/__dev__/jsutils/memoize3.d.mts +1 -0
- package/__dev__/jsutils/memoize3.d.ts +1 -0
- package/__dev__/jsutils/memoize3.js +3 -0
- package/__dev__/jsutils/memoize3.mjs +3 -0
- package/__dev__/jsutils/naturalCompare.d.mts +1 -0
- package/__dev__/jsutils/naturalCompare.d.ts +1 -0
- package/__dev__/jsutils/naturalCompare.js +3 -0
- package/__dev__/jsutils/naturalCompare.mjs +3 -0
- package/__dev__/jsutils/printPathArray.d.mts +1 -0
- package/__dev__/jsutils/printPathArray.d.ts +1 -0
- package/__dev__/jsutils/printPathArray.js +3 -0
- package/__dev__/jsutils/printPathArray.mjs +3 -0
- package/__dev__/jsutils/promiseForObject.d.mts +1 -0
- package/__dev__/jsutils/promiseForObject.d.ts +1 -0
- package/__dev__/jsutils/promiseForObject.js +3 -0
- package/__dev__/jsutils/promiseForObject.mjs +3 -0
- package/__dev__/jsutils/promiseReduce.d.mts +1 -0
- package/__dev__/jsutils/promiseReduce.d.ts +1 -0
- package/__dev__/jsutils/promiseReduce.js +3 -0
- package/__dev__/jsutils/promiseReduce.mjs +3 -0
- package/__dev__/jsutils/promiseWithResolvers.d.mts +1 -0
- package/__dev__/jsutils/promiseWithResolvers.d.ts +1 -0
- package/__dev__/jsutils/promiseWithResolvers.js +3 -0
- package/__dev__/jsutils/promiseWithResolvers.mjs +3 -0
- package/__dev__/jsutils/suggestionList.d.mts +1 -0
- package/__dev__/jsutils/suggestionList.d.ts +1 -0
- package/__dev__/jsutils/suggestionList.js +3 -0
- package/__dev__/jsutils/suggestionList.mjs +3 -0
- package/__dev__/jsutils/toError.d.mts +1 -0
- package/__dev__/jsutils/toError.d.ts +1 -0
- package/__dev__/jsutils/toError.js +3 -0
- package/__dev__/jsutils/toError.mjs +3 -0
- package/__dev__/jsutils/toObjMap.d.mts +1 -0
- package/__dev__/jsutils/toObjMap.d.ts +1 -0
- package/__dev__/jsutils/toObjMap.js +3 -0
- package/__dev__/jsutils/toObjMap.mjs +3 -0
- package/__dev__/language/KindTypeMap.d.mts +1 -0
- package/__dev__/language/KindTypeMap.d.ts +1 -0
- package/__dev__/language/KindTypeMap.js +3 -0
- package/__dev__/language/KindTypeMap.mjs +3 -0
- package/__dev__/language/ast.d.mts +1 -0
- package/__dev__/language/ast.d.ts +1 -0
- package/__dev__/language/ast.js +3 -0
- package/__dev__/language/ast.mjs +3 -0
- package/__dev__/language/blockString.d.mts +1 -0
- package/__dev__/language/blockString.d.ts +1 -0
- package/__dev__/language/blockString.js +3 -0
- package/__dev__/language/blockString.mjs +3 -0
- package/__dev__/language/characterClasses.d.mts +1 -0
- package/__dev__/language/characterClasses.d.ts +1 -0
- package/__dev__/language/characterClasses.js +3 -0
- package/__dev__/language/characterClasses.mjs +3 -0
- package/__dev__/language/directiveLocation.d.mts +1 -0
- package/__dev__/language/directiveLocation.d.ts +1 -0
- package/__dev__/language/directiveLocation.js +3 -0
- package/__dev__/language/directiveLocation.mjs +3 -0
- package/__dev__/language/index.d.mts +1 -0
- package/__dev__/language/index.d.ts +1 -0
- package/__dev__/language/index.js +3 -0
- package/__dev__/language/index.mjs +3 -0
- package/__dev__/language/kinds.d.mts +1 -0
- package/__dev__/language/kinds.d.ts +1 -0
- package/__dev__/language/kinds.js +3 -0
- package/__dev__/language/kinds.mjs +3 -0
- package/__dev__/language/kinds_.d.mts +1 -0
- package/__dev__/language/kinds_.d.ts +1 -0
- package/__dev__/language/kinds_.js +3 -0
- package/__dev__/language/kinds_.mjs +3 -0
- package/__dev__/language/lexer.d.mts +1 -0
- package/__dev__/language/lexer.d.ts +1 -0
- package/__dev__/language/lexer.js +3 -0
- package/__dev__/language/lexer.mjs +3 -0
- package/__dev__/language/location.d.mts +1 -0
- package/__dev__/language/location.d.ts +1 -0
- package/__dev__/language/location.js +3 -0
- package/__dev__/language/location.mjs +3 -0
- package/__dev__/language/parser.d.mts +1 -0
- package/__dev__/language/parser.d.ts +1 -0
- package/__dev__/language/parser.js +3 -0
- package/__dev__/language/parser.mjs +3 -0
- package/__dev__/language/predicates.d.mts +1 -0
- package/__dev__/language/predicates.d.ts +1 -0
- package/__dev__/language/predicates.js +3 -0
- package/__dev__/language/predicates.mjs +3 -0
- package/__dev__/language/printLocation.d.mts +1 -0
- package/__dev__/language/printLocation.d.ts +1 -0
- package/__dev__/language/printLocation.js +3 -0
- package/__dev__/language/printLocation.mjs +3 -0
- package/__dev__/language/printString.d.mts +1 -0
- package/__dev__/language/printString.d.ts +1 -0
- package/__dev__/language/printString.js +3 -0
- package/__dev__/language/printString.mjs +3 -0
- package/__dev__/language/printer.d.mts +1 -0
- package/__dev__/language/printer.d.ts +1 -0
- package/__dev__/language/printer.js +3 -0
- package/__dev__/language/printer.mjs +3 -0
- package/__dev__/language/schemaCoordinateLexer.d.mts +1 -0
- package/__dev__/language/schemaCoordinateLexer.d.ts +1 -0
- package/__dev__/language/schemaCoordinateLexer.js +3 -0
- package/__dev__/language/schemaCoordinateLexer.mjs +3 -0
- package/__dev__/language/source.d.mts +1 -0
- package/__dev__/language/source.d.ts +1 -0
- package/__dev__/language/source.js +3 -0
- package/__dev__/language/source.mjs +3 -0
- package/__dev__/language/tokenKind.d.mts +1 -0
- package/__dev__/language/tokenKind.d.ts +1 -0
- package/__dev__/language/tokenKind.js +3 -0
- package/__dev__/language/tokenKind.mjs +3 -0
- package/__dev__/language/visitor.d.mts +1 -0
- package/__dev__/language/visitor.d.ts +1 -0
- package/__dev__/language/visitor.js +3 -0
- package/__dev__/language/visitor.mjs +3 -0
- package/__dev__/type/assertName.d.mts +1 -0
- package/__dev__/type/assertName.d.ts +1 -0
- package/__dev__/type/assertName.js +3 -0
- package/__dev__/type/assertName.mjs +3 -0
- package/__dev__/type/definition.d.mts +1 -0
- package/__dev__/type/definition.d.ts +1 -0
- package/__dev__/type/definition.js +3 -0
- package/__dev__/type/definition.mjs +3 -0
- package/__dev__/type/directives.d.mts +1 -0
- package/__dev__/type/directives.d.ts +1 -0
- package/__dev__/type/directives.js +3 -0
- package/__dev__/type/directives.mjs +3 -0
- package/__dev__/type/index.d.mts +1 -0
- package/__dev__/type/index.d.ts +1 -0
- package/__dev__/type/index.js +3 -0
- package/__dev__/type/index.mjs +3 -0
- package/__dev__/type/introspection.d.mts +1 -0
- package/__dev__/type/introspection.d.ts +1 -0
- package/__dev__/type/introspection.js +3 -0
- package/__dev__/type/introspection.mjs +3 -0
- package/__dev__/type/scalars.d.mts +1 -0
- package/__dev__/type/scalars.d.ts +1 -0
- package/__dev__/type/scalars.js +3 -0
- package/__dev__/type/scalars.mjs +3 -0
- package/__dev__/type/schema.d.mts +1 -0
- package/__dev__/type/schema.d.ts +1 -0
- package/__dev__/type/schema.js +3 -0
- package/__dev__/type/schema.mjs +3 -0
- package/__dev__/type/validate.d.mts +1 -0
- package/__dev__/type/validate.d.ts +1 -0
- package/__dev__/type/validate.js +3 -0
- package/__dev__/type/validate.mjs +3 -0
- package/__dev__/utilities/TypeInfo.d.mts +1 -0
- package/__dev__/utilities/TypeInfo.d.ts +1 -0
- package/__dev__/utilities/TypeInfo.js +3 -0
- package/__dev__/utilities/TypeInfo.mjs +3 -0
- package/__dev__/utilities/astFromValue.d.mts +1 -0
- package/__dev__/utilities/astFromValue.d.ts +1 -0
- package/__dev__/utilities/astFromValue.js +3 -0
- package/__dev__/utilities/astFromValue.mjs +3 -0
- package/__dev__/utilities/buildASTSchema.d.mts +1 -0
- package/__dev__/utilities/buildASTSchema.d.ts +1 -0
- package/__dev__/utilities/buildASTSchema.js +3 -0
- package/__dev__/utilities/buildASTSchema.mjs +3 -0
- package/__dev__/utilities/buildClientSchema.d.mts +1 -0
- package/__dev__/utilities/buildClientSchema.d.ts +1 -0
- package/__dev__/utilities/buildClientSchema.js +3 -0
- package/__dev__/utilities/buildClientSchema.mjs +3 -0
- package/__dev__/utilities/coerceInputValue.d.mts +1 -0
- package/__dev__/utilities/coerceInputValue.d.ts +1 -0
- package/__dev__/utilities/coerceInputValue.js +3 -0
- package/__dev__/utilities/coerceInputValue.mjs +3 -0
- package/__dev__/utilities/concatAST.d.mts +1 -0
- package/__dev__/utilities/concatAST.d.ts +1 -0
- package/__dev__/utilities/concatAST.js +3 -0
- package/__dev__/utilities/concatAST.mjs +3 -0
- package/__dev__/utilities/extendSchema.d.mts +1 -0
- package/__dev__/utilities/extendSchema.d.ts +1 -0
- package/__dev__/utilities/extendSchema.js +3 -0
- package/__dev__/utilities/extendSchema.mjs +3 -0
- package/__dev__/utilities/findSchemaChanges.d.mts +1 -0
- package/__dev__/utilities/findSchemaChanges.d.ts +1 -0
- package/__dev__/utilities/findSchemaChanges.js +3 -0
- package/__dev__/utilities/findSchemaChanges.mjs +3 -0
- package/__dev__/utilities/getDefaultValueAST.d.mts +1 -0
- package/__dev__/utilities/getDefaultValueAST.d.ts +1 -0
- package/__dev__/utilities/getDefaultValueAST.js +3 -0
- package/__dev__/utilities/getDefaultValueAST.mjs +3 -0
- package/__dev__/utilities/getIntrospectionQuery.d.mts +1 -0
- package/__dev__/utilities/getIntrospectionQuery.d.ts +1 -0
- package/__dev__/utilities/getIntrospectionQuery.js +3 -0
- package/__dev__/utilities/getIntrospectionQuery.mjs +3 -0
- package/__dev__/utilities/getOperationAST.d.mts +1 -0
- package/__dev__/utilities/getOperationAST.d.ts +1 -0
- package/__dev__/utilities/getOperationAST.js +3 -0
- package/__dev__/utilities/getOperationAST.mjs +3 -0
- package/__dev__/utilities/index.d.mts +1 -0
- package/__dev__/utilities/index.d.ts +1 -0
- package/__dev__/utilities/index.js +3 -0
- package/__dev__/utilities/index.mjs +3 -0
- package/__dev__/utilities/introspectionFromSchema.d.mts +1 -0
- package/__dev__/utilities/introspectionFromSchema.d.ts +1 -0
- package/__dev__/utilities/introspectionFromSchema.js +3 -0
- package/__dev__/utilities/introspectionFromSchema.mjs +3 -0
- package/__dev__/utilities/lexicographicSortSchema.d.mts +1 -0
- package/__dev__/utilities/lexicographicSortSchema.d.ts +1 -0
- package/__dev__/utilities/lexicographicSortSchema.js +3 -0
- package/__dev__/utilities/lexicographicSortSchema.mjs +3 -0
- package/__dev__/utilities/mapSchemaConfig.d.mts +1 -0
- package/__dev__/utilities/mapSchemaConfig.d.ts +1 -0
- package/__dev__/utilities/mapSchemaConfig.js +3 -0
- package/__dev__/utilities/mapSchemaConfig.mjs +3 -0
- package/__dev__/utilities/printSchema.d.mts +1 -0
- package/__dev__/utilities/printSchema.d.ts +1 -0
- package/__dev__/utilities/printSchema.js +3 -0
- package/__dev__/utilities/printSchema.mjs +3 -0
- package/__dev__/utilities/replaceVariables.d.mts +1 -0
- package/__dev__/utilities/replaceVariables.d.ts +1 -0
- package/__dev__/utilities/replaceVariables.js +3 -0
- package/__dev__/utilities/replaceVariables.mjs +3 -0
- package/__dev__/utilities/resolveSchemaCoordinate.d.mts +1 -0
- package/__dev__/utilities/resolveSchemaCoordinate.d.ts +1 -0
- package/__dev__/utilities/resolveSchemaCoordinate.js +3 -0
- package/__dev__/utilities/resolveSchemaCoordinate.mjs +3 -0
- package/__dev__/utilities/separateOperations.d.mts +1 -0
- package/__dev__/utilities/separateOperations.d.ts +1 -0
- package/__dev__/utilities/separateOperations.js +3 -0
- package/__dev__/utilities/separateOperations.mjs +3 -0
- package/__dev__/utilities/sortValueNode.d.mts +1 -0
- package/__dev__/utilities/sortValueNode.d.ts +1 -0
- package/__dev__/utilities/sortValueNode.js +3 -0
- package/__dev__/utilities/sortValueNode.mjs +3 -0
- package/__dev__/utilities/stripIgnoredCharacters.d.mts +1 -0
- package/__dev__/utilities/stripIgnoredCharacters.d.ts +1 -0
- package/__dev__/utilities/stripIgnoredCharacters.js +3 -0
- package/__dev__/utilities/stripIgnoredCharacters.mjs +3 -0
- package/__dev__/utilities/typeComparators.d.mts +1 -0
- package/__dev__/utilities/typeComparators.d.ts +1 -0
- package/__dev__/utilities/typeComparators.js +3 -0
- package/__dev__/utilities/typeComparators.mjs +3 -0
- package/__dev__/utilities/typeFromAST.d.mts +1 -0
- package/__dev__/utilities/typeFromAST.d.ts +1 -0
- package/__dev__/utilities/typeFromAST.js +3 -0
- package/__dev__/utilities/typeFromAST.mjs +3 -0
- package/__dev__/utilities/typedQueryDocumentNode.d.mts +1 -0
- package/__dev__/utilities/typedQueryDocumentNode.d.ts +1 -0
- package/__dev__/utilities/typedQueryDocumentNode.js +3 -0
- package/__dev__/utilities/typedQueryDocumentNode.mjs +3 -0
- package/__dev__/utilities/validateInputValue.d.mts +1 -0
- package/__dev__/utilities/validateInputValue.d.ts +1 -0
- package/__dev__/utilities/validateInputValue.js +3 -0
- package/__dev__/utilities/validateInputValue.mjs +3 -0
- package/__dev__/utilities/valueFromAST.d.mts +1 -0
- package/__dev__/utilities/valueFromAST.d.ts +1 -0
- package/__dev__/utilities/valueFromAST.js +3 -0
- package/__dev__/utilities/valueFromAST.mjs +3 -0
- package/__dev__/utilities/valueFromASTUntyped.d.mts +1 -0
- package/__dev__/utilities/valueFromASTUntyped.d.ts +1 -0
- package/__dev__/utilities/valueFromASTUntyped.js +3 -0
- package/__dev__/utilities/valueFromASTUntyped.mjs +3 -0
- package/__dev__/utilities/valueToLiteral.d.mts +1 -0
- package/__dev__/utilities/valueToLiteral.d.ts +1 -0
- package/__dev__/utilities/valueToLiteral.js +3 -0
- package/__dev__/utilities/valueToLiteral.mjs +3 -0
- package/__dev__/validation/ValidationContext.d.mts +1 -0
- package/__dev__/validation/ValidationContext.d.ts +1 -0
- package/__dev__/validation/ValidationContext.js +3 -0
- package/__dev__/validation/ValidationContext.mjs +3 -0
- package/__dev__/validation/index.d.mts +1 -0
- package/__dev__/validation/index.d.ts +1 -0
- package/__dev__/validation/index.js +3 -0
- package/__dev__/validation/index.mjs +3 -0
- package/__dev__/validation/rules/DeferStreamDirectiveLabelRule.d.mts +1 -0
- package/__dev__/validation/rules/DeferStreamDirectiveLabelRule.d.ts +1 -0
- package/__dev__/validation/rules/DeferStreamDirectiveLabelRule.js +3 -0
- package/__dev__/validation/rules/DeferStreamDirectiveLabelRule.mjs +3 -0
- package/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.mts +1 -0
- package/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.ts +1 -0
- package/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.js +3 -0
- package/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs +3 -0
- package/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.mts +1 -0
- package/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.ts +1 -0
- package/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.js +3 -0
- package/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs +3 -0
- package/__dev__/validation/rules/ExecutableDefinitionsRule.d.mts +1 -0
- package/__dev__/validation/rules/ExecutableDefinitionsRule.d.ts +1 -0
- package/__dev__/validation/rules/ExecutableDefinitionsRule.js +3 -0
- package/__dev__/validation/rules/ExecutableDefinitionsRule.mjs +3 -0
- package/__dev__/validation/rules/FieldsOnCorrectTypeRule.d.mts +1 -0
- package/__dev__/validation/rules/FieldsOnCorrectTypeRule.d.ts +1 -0
- package/__dev__/validation/rules/FieldsOnCorrectTypeRule.js +3 -0
- package/__dev__/validation/rules/FieldsOnCorrectTypeRule.mjs +3 -0
- package/__dev__/validation/rules/FragmentsOnCompositeTypesRule.d.mts +1 -0
- package/__dev__/validation/rules/FragmentsOnCompositeTypesRule.d.ts +1 -0
- package/__dev__/validation/rules/FragmentsOnCompositeTypesRule.js +3 -0
- package/__dev__/validation/rules/FragmentsOnCompositeTypesRule.mjs +3 -0
- package/__dev__/validation/rules/KnownArgumentNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/KnownArgumentNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/KnownArgumentNamesRule.js +3 -0
- package/__dev__/validation/rules/KnownArgumentNamesRule.mjs +3 -0
- package/__dev__/validation/rules/KnownDirectivesRule.d.mts +1 -0
- package/__dev__/validation/rules/KnownDirectivesRule.d.ts +1 -0
- package/__dev__/validation/rules/KnownDirectivesRule.js +3 -0
- package/__dev__/validation/rules/KnownDirectivesRule.mjs +3 -0
- package/__dev__/validation/rules/KnownFragmentNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/KnownFragmentNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/KnownFragmentNamesRule.js +3 -0
- package/__dev__/validation/rules/KnownFragmentNamesRule.mjs +3 -0
- package/__dev__/validation/rules/KnownOperationTypesRule.d.mts +1 -0
- package/__dev__/validation/rules/KnownOperationTypesRule.d.ts +1 -0
- package/__dev__/validation/rules/KnownOperationTypesRule.js +3 -0
- package/__dev__/validation/rules/KnownOperationTypesRule.mjs +3 -0
- package/__dev__/validation/rules/KnownTypeNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/KnownTypeNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/KnownTypeNamesRule.js +3 -0
- package/__dev__/validation/rules/KnownTypeNamesRule.mjs +3 -0
- package/__dev__/validation/rules/LoneAnonymousOperationRule.d.mts +1 -0
- package/__dev__/validation/rules/LoneAnonymousOperationRule.d.ts +1 -0
- package/__dev__/validation/rules/LoneAnonymousOperationRule.js +3 -0
- package/__dev__/validation/rules/LoneAnonymousOperationRule.mjs +3 -0
- package/__dev__/validation/rules/LoneSchemaDefinitionRule.d.mts +1 -0
- package/__dev__/validation/rules/LoneSchemaDefinitionRule.d.ts +1 -0
- package/__dev__/validation/rules/LoneSchemaDefinitionRule.js +3 -0
- package/__dev__/validation/rules/LoneSchemaDefinitionRule.mjs +3 -0
- package/__dev__/validation/rules/MaxIntrospectionDepthRule.d.mts +1 -0
- package/__dev__/validation/rules/MaxIntrospectionDepthRule.d.ts +1 -0
- package/__dev__/validation/rules/MaxIntrospectionDepthRule.js +3 -0
- package/__dev__/validation/rules/MaxIntrospectionDepthRule.mjs +3 -0
- package/__dev__/validation/rules/NoFragmentCyclesRule.d.mts +1 -0
- package/__dev__/validation/rules/NoFragmentCyclesRule.d.ts +1 -0
- package/__dev__/validation/rules/NoFragmentCyclesRule.js +3 -0
- package/__dev__/validation/rules/NoFragmentCyclesRule.mjs +3 -0
- package/__dev__/validation/rules/NoUndefinedVariablesRule.d.mts +1 -0
- package/__dev__/validation/rules/NoUndefinedVariablesRule.d.ts +1 -0
- package/__dev__/validation/rules/NoUndefinedVariablesRule.js +3 -0
- package/__dev__/validation/rules/NoUndefinedVariablesRule.mjs +3 -0
- package/__dev__/validation/rules/NoUnusedFragmentsRule.d.mts +1 -0
- package/__dev__/validation/rules/NoUnusedFragmentsRule.d.ts +1 -0
- package/__dev__/validation/rules/NoUnusedFragmentsRule.js +3 -0
- package/__dev__/validation/rules/NoUnusedFragmentsRule.mjs +3 -0
- package/__dev__/validation/rules/NoUnusedVariablesRule.d.mts +1 -0
- package/__dev__/validation/rules/NoUnusedVariablesRule.d.ts +1 -0
- package/__dev__/validation/rules/NoUnusedVariablesRule.js +3 -0
- package/__dev__/validation/rules/NoUnusedVariablesRule.mjs +3 -0
- package/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.d.mts +1 -0
- package/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts +1 -0
- package/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.js +3 -0
- package/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +3 -0
- package/__dev__/validation/rules/PossibleFragmentSpreadsRule.d.mts +1 -0
- package/__dev__/validation/rules/PossibleFragmentSpreadsRule.d.ts +1 -0
- package/__dev__/validation/rules/PossibleFragmentSpreadsRule.js +3 -0
- package/__dev__/validation/rules/PossibleFragmentSpreadsRule.mjs +3 -0
- package/__dev__/validation/rules/PossibleTypeExtensionsRule.d.mts +1 -0
- package/__dev__/validation/rules/PossibleTypeExtensionsRule.d.ts +1 -0
- package/__dev__/validation/rules/PossibleTypeExtensionsRule.js +3 -0
- package/__dev__/validation/rules/PossibleTypeExtensionsRule.mjs +3 -0
- package/__dev__/validation/rules/ProvidedRequiredArgumentsRule.d.mts +1 -0
- package/__dev__/validation/rules/ProvidedRequiredArgumentsRule.d.ts +1 -0
- package/__dev__/validation/rules/ProvidedRequiredArgumentsRule.js +3 -0
- package/__dev__/validation/rules/ProvidedRequiredArgumentsRule.mjs +3 -0
- package/__dev__/validation/rules/ScalarLeafsRule.d.mts +1 -0
- package/__dev__/validation/rules/ScalarLeafsRule.d.ts +1 -0
- package/__dev__/validation/rules/ScalarLeafsRule.js +3 -0
- package/__dev__/validation/rules/ScalarLeafsRule.mjs +3 -0
- package/__dev__/validation/rules/SingleFieldSubscriptionsRule.d.mts +1 -0
- package/__dev__/validation/rules/SingleFieldSubscriptionsRule.d.ts +1 -0
- package/__dev__/validation/rules/SingleFieldSubscriptionsRule.js +3 -0
- package/__dev__/validation/rules/SingleFieldSubscriptionsRule.mjs +3 -0
- package/__dev__/validation/rules/StreamDirectiveOnListFieldRule.d.mts +1 -0
- package/__dev__/validation/rules/StreamDirectiveOnListFieldRule.d.ts +1 -0
- package/__dev__/validation/rules/StreamDirectiveOnListFieldRule.js +3 -0
- package/__dev__/validation/rules/StreamDirectiveOnListFieldRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueArgumentNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueArgumentNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueArgumentNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueArgumentNamesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueDirectiveNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueDirectiveNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueDirectiveNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueDirectiveNamesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueDirectivesPerLocationRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueDirectivesPerLocationRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueDirectivesPerLocationRule.js +3 -0
- package/__dev__/validation/rules/UniqueDirectivesPerLocationRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueEnumValueNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueEnumValueNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueEnumValueNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueEnumValueNamesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueFragmentNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueFragmentNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueFragmentNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueFragmentNamesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueInputFieldNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueInputFieldNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueInputFieldNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueInputFieldNamesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueOperationNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueOperationNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueOperationNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueOperationNamesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueOperationTypesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueOperationTypesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueOperationTypesRule.js +3 -0
- package/__dev__/validation/rules/UniqueOperationTypesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueTypeNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueTypeNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueTypeNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueTypeNamesRule.mjs +3 -0
- package/__dev__/validation/rules/UniqueVariableNamesRule.d.mts +1 -0
- package/__dev__/validation/rules/UniqueVariableNamesRule.d.ts +1 -0
- package/__dev__/validation/rules/UniqueVariableNamesRule.js +3 -0
- package/__dev__/validation/rules/UniqueVariableNamesRule.mjs +3 -0
- package/__dev__/validation/rules/ValuesOfCorrectTypeRule.d.mts +1 -0
- package/__dev__/validation/rules/ValuesOfCorrectTypeRule.d.ts +1 -0
- package/__dev__/validation/rules/ValuesOfCorrectTypeRule.js +3 -0
- package/__dev__/validation/rules/ValuesOfCorrectTypeRule.mjs +3 -0
- package/__dev__/validation/rules/VariablesAreInputTypesRule.d.mts +1 -0
- package/__dev__/validation/rules/VariablesAreInputTypesRule.d.ts +1 -0
- package/__dev__/validation/rules/VariablesAreInputTypesRule.js +3 -0
- package/__dev__/validation/rules/VariablesAreInputTypesRule.mjs +3 -0
- package/__dev__/validation/rules/VariablesInAllowedPositionRule.d.mts +1 -0
- package/__dev__/validation/rules/VariablesInAllowedPositionRule.d.ts +1 -0
- package/__dev__/validation/rules/VariablesInAllowedPositionRule.js +3 -0
- package/__dev__/validation/rules/VariablesInAllowedPositionRule.mjs +3 -0
- package/__dev__/validation/rules/custom/NoDeprecatedCustomRule.d.mts +1 -0
- package/__dev__/validation/rules/custom/NoDeprecatedCustomRule.d.ts +1 -0
- package/__dev__/validation/rules/custom/NoDeprecatedCustomRule.js +3 -0
- package/__dev__/validation/rules/custom/NoDeprecatedCustomRule.mjs +3 -0
- package/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.mts +1 -0
- package/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts +1 -0
- package/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.js +3 -0
- package/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs +3 -0
- package/__dev__/validation/specifiedRules.d.mts +1 -0
- package/__dev__/validation/specifiedRules.d.ts +1 -0
- package/__dev__/validation/specifiedRules.js +3 -0
- package/__dev__/validation/specifiedRules.mjs +3 -0
- package/__dev__/validation/validate.d.mts +1 -0
- package/__dev__/validation/validate.d.ts +1 -0
- package/__dev__/validation/validate.js +3 -0
- package/__dev__/validation/validate.mjs +3 -0
- package/__dev__/version.d.mts +1 -0
- package/__dev__/version.d.ts +1 -0
- package/__dev__/version.js +3 -0
- package/__dev__/version.mjs +3 -0
- package/devMode.d.mts +2 -0
- package/devMode.d.ts +2 -0
- package/devMode.js +14 -0
- package/devMode.js.map +1 -0
- package/devMode.mjs +10 -0
- package/devMode.mjs.map +1 -0
- package/error/GraphQLError.d.mts +120 -0
- package/error/ensureGraphQLError.d.mts +5 -0
- package/error/ensureGraphQLError.d.ts +5 -0
- package/error/ensureGraphQLError.js +16 -0
- package/error/ensureGraphQLError.js.map +1 -0
- package/error/ensureGraphQLError.mjs +13 -0
- package/error/ensureGraphQLError.mjs.map +1 -0
- package/error/index.d.mts +4 -0
- package/error/locatedError.d.mts +9 -0
- package/error/syntaxError.d.mts +7 -0
- package/execution/AbortedGraphQLExecutionError.d.mts +6 -0
- package/execution/AbortedGraphQLExecutionError.d.ts +6 -0
- package/execution/AbortedGraphQLExecutionError.js +27 -0
- package/execution/AbortedGraphQLExecutionError.js.map +1 -0
- package/execution/AbortedGraphQLExecutionError.mjs +23 -0
- package/execution/AbortedGraphQLExecutionError.mjs.map +1 -0
- package/execution/AsyncWorkTracker.d.mts +10 -0
- package/execution/AsyncWorkTracker.d.ts +10 -0
- package/execution/AsyncWorkTracker.js +49 -0
- package/execution/AsyncWorkTracker.js.map +1 -0
- package/execution/AsyncWorkTracker.mjs +45 -0
- package/execution/AsyncWorkTracker.mjs.map +1 -0
- package/execution/Executor.d.mts +212 -0
- package/execution/Executor.d.ts +212 -0
- package/execution/Executor.js +655 -0
- package/execution/Executor.js.map +1 -0
- package/execution/Executor.mjs +651 -0
- package/execution/Executor.mjs.map +1 -0
- package/execution/ExecutorThrowingOnIncremental.d.mts +12 -0
- package/execution/ExecutorThrowingOnIncremental.d.ts +12 -0
- package/execution/ExecutorThrowingOnIncremental.js +47 -0
- package/execution/ExecutorThrowingOnIncremental.js.map +1 -0
- package/execution/ExecutorThrowingOnIncremental.mjs +43 -0
- package/execution/ExecutorThrowingOnIncremental.mjs.map +1 -0
- package/execution/cancellablePromise.d.mts +6 -0
- package/execution/cancellablePromise.d.ts +6 -0
- package/execution/cancellablePromise.js +49 -0
- package/execution/cancellablePromise.js.map +1 -0
- package/execution/cancellablePromise.mjs +45 -0
- package/execution/cancellablePromise.mjs.map +1 -0
- package/execution/collectFields.d.mts +59 -0
- package/execution/collectFields.d.ts +15 -4
- package/execution/collectFields.js +57 -22
- package/execution/collectFields.js.map +1 -1
- package/execution/collectFields.mjs +58 -23
- package/execution/collectFields.mjs.map +1 -1
- package/execution/collectIteratorPromises.d.mts +5 -0
- package/execution/collectIteratorPromises.d.ts +5 -0
- package/execution/collectIteratorPromises.js +27 -0
- package/execution/collectIteratorPromises.js.map +1 -0
- package/execution/collectIteratorPromises.mjs +24 -0
- package/execution/collectIteratorPromises.mjs.map +1 -0
- package/execution/createSharedExecutionContext.d.mts +10 -0
- package/execution/createSharedExecutionContext.d.ts +10 -0
- package/execution/createSharedExecutionContext.js +20 -0
- package/execution/createSharedExecutionContext.js.map +1 -0
- package/execution/createSharedExecutionContext.mjs +17 -0
- package/execution/createSharedExecutionContext.mjs.map +1 -0
- package/execution/execute.d.mts +180 -0
- package/execution/execute.d.ts +73 -118
- package/execution/execute.js +218 -1121
- package/execution/execute.js.map +1 -1
- package/execution/execute.mjs +213 -1119
- package/execution/execute.mjs.map +1 -1
- package/execution/getStreamUsage.d.mts +13 -0
- package/execution/getStreamUsage.d.ts +13 -0
- package/execution/getStreamUsage.js +41 -0
- package/execution/getStreamUsage.js.map +1 -0
- package/execution/getStreamUsage.mjs +38 -0
- package/execution/getStreamUsage.mjs.map +1 -0
- package/execution/getVariableSignature.d.mts +18 -0
- package/execution/hooks.d.mts +9 -0
- package/execution/hooks.d.ts +9 -0
- package/execution/hooks.js +24 -0
- package/execution/hooks.js.map +1 -0
- package/execution/hooks.mjs +21 -0
- package/execution/hooks.mjs.map +1 -0
- package/execution/incremental/Computation.d.mts +22 -0
- package/execution/incremental/Computation.d.ts +22 -0
- package/execution/incremental/Computation.js +68 -0
- package/execution/incremental/Computation.js.map +1 -0
- package/execution/incremental/Computation.mjs +64 -0
- package/execution/incremental/Computation.mjs.map +1 -0
- package/execution/incremental/IncrementalExecutor.d.mts +182 -0
- package/execution/incremental/IncrementalExecutor.d.ts +182 -0
- package/execution/incremental/IncrementalExecutor.js +390 -0
- package/execution/incremental/IncrementalExecutor.js.map +1 -0
- package/execution/incremental/IncrementalExecutor.mjs +386 -0
- package/execution/incremental/IncrementalExecutor.mjs.map +1 -0
- package/execution/incremental/IncrementalPublisher.d.mts +17 -0
- package/execution/incremental/IncrementalPublisher.d.ts +17 -0
- package/execution/incremental/IncrementalPublisher.js +201 -0
- package/execution/incremental/IncrementalPublisher.js.map +1 -0
- package/execution/incremental/IncrementalPublisher.mjs +197 -0
- package/execution/incremental/IncrementalPublisher.mjs.map +1 -0
- package/execution/incremental/Queue.d.mts +86 -0
- package/execution/incremental/Queue.d.ts +86 -0
- package/execution/incremental/Queue.js +330 -0
- package/execution/incremental/Queue.js.map +1 -0
- package/execution/incremental/Queue.mjs +325 -0
- package/execution/incremental/Queue.mjs.map +1 -0
- package/execution/incremental/WorkQueue.d.mts +67 -0
- package/execution/incremental/WorkQueue.d.ts +67 -0
- package/execution/incremental/WorkQueue.js +396 -0
- package/execution/incremental/WorkQueue.js.map +1 -0
- package/execution/incremental/WorkQueue.mjs +393 -0
- package/execution/incremental/WorkQueue.mjs.map +1 -0
- package/execution/incremental/buildExecutionPlan.d.mts +7 -0
- package/execution/{buildExecutionPlan.d.ts → incremental/buildExecutionPlan.d.ts} +1 -1
- package/execution/{buildExecutionPlan.js → incremental/buildExecutionPlan.js} +2 -2
- package/execution/incremental/buildExecutionPlan.js.map +1 -0
- package/execution/{buildExecutionPlan.mjs → incremental/buildExecutionPlan.mjs} +2 -2
- package/execution/incremental/buildExecutionPlan.mjs.map +1 -0
- package/execution/index.d.mts +8 -0
- package/execution/index.d.ts +6 -3
- package/execution/index.js +8 -4
- package/execution/index.js.map +1 -1
- package/execution/index.mjs +2 -1
- package/execution/index.mjs.map +1 -1
- package/execution/mapAsyncIterable.d.mts +6 -0
- package/execution/mapAsyncIterable.d.ts +1 -1
- package/execution/mapAsyncIterable.js +28 -51
- package/execution/mapAsyncIterable.js.map +1 -1
- package/execution/mapAsyncIterable.mjs +28 -51
- package/execution/mapAsyncIterable.mjs.map +1 -1
- package/execution/returnIteratorCatchingErrors.d.mts +1 -0
- package/execution/returnIteratorCatchingErrors.d.ts +1 -0
- package/execution/returnIteratorCatchingErrors.js +12 -0
- package/execution/returnIteratorCatchingErrors.js.map +1 -0
- package/execution/returnIteratorCatchingErrors.mjs +9 -0
- package/execution/returnIteratorCatchingErrors.mjs.map +1 -0
- package/execution/values.d.mts +61 -0
- package/execution/values.d.ts +12 -21
- package/execution/values.js +111 -74
- package/execution/values.js.map +1 -1
- package/execution/values.mjs +111 -73
- package/execution/values.mjs.map +1 -1
- package/execution/withConcurrentAbruptClose.d.mts +13 -0
- package/execution/withConcurrentAbruptClose.d.ts +13 -0
- package/execution/withConcurrentAbruptClose.js +72 -0
- package/execution/withConcurrentAbruptClose.js.map +1 -0
- package/execution/withConcurrentAbruptClose.mjs +69 -0
- package/execution/withConcurrentAbruptClose.mjs.map +1 -0
- package/graphql.d.mts +61 -0
- package/graphql.d.ts +9 -16
- package/graphql.js +22 -22
- package/graphql.js.map +1 -1
- package/graphql.mjs +22 -22
- package/graphql.mjs.map +1 -1
- package/harness.d.mts +15 -0
- package/harness.d.ts +15 -0
- package/harness.js +13 -0
- package/harness.js.map +1 -0
- package/harness.mjs +10 -0
- package/harness.mjs.map +1 -0
- package/index.d.mts +51 -0
- package/index.d.ts +10 -7
- package/index.js +25 -8
- package/index.js.map +1 -1
- package/index.mjs +11 -5
- package/index.mjs.map +1 -1
- package/jsutils/AccumulatorMap.d.mts +7 -0
- package/jsutils/AccumulatorMap.js +1 -0
- package/jsutils/AccumulatorMap.js.map +1 -1
- package/jsutils/AccumulatorMap.mjs +1 -0
- package/jsutils/AccumulatorMap.mjs.map +1 -1
- package/jsutils/Maybe.d.mts +2 -0
- package/jsutils/ObjMap.d.mts +18 -0
- package/jsutils/Path.d.mts +14 -0
- package/jsutils/PromiseOrValue.d.mts +1 -0
- package/jsutils/capitalize.d.mts +4 -0
- package/jsutils/devAssert.d.mts +1 -0
- package/jsutils/didYouMean.d.mts +5 -0
- package/jsutils/formatList.d.mts +8 -0
- package/jsutils/formatList.js +2 -1
- package/jsutils/formatList.js.map +1 -1
- package/jsutils/formatList.mjs +2 -1
- package/jsutils/formatList.mjs.map +1 -1
- package/jsutils/getBySet.d.mts +1 -0
- package/jsutils/groupBy.d.mts +4 -0
- package/jsutils/identityFunc.d.mts +4 -0
- package/jsutils/inspect.d.mts +4 -0
- package/jsutils/instanceOf.d.mts +15 -0
- package/jsutils/instanceOf.d.ts +8 -7
- package/jsutils/instanceOf.js +29 -30
- package/jsutils/instanceOf.js.map +1 -1
- package/jsutils/instanceOf.mjs +28 -30
- package/jsutils/instanceOf.mjs.map +1 -1
- package/jsutils/invariant.d.mts +1 -0
- package/jsutils/isAsyncIterable.d.mts +5 -0
- package/jsutils/isIterableObject.d.mts +18 -0
- package/jsutils/isObjectLike.d.mts +7 -0
- package/jsutils/isPromise.d.mts +6 -0
- package/jsutils/isPromise.d.ts +2 -1
- package/jsutils/isPromise.js +5 -1
- package/jsutils/isPromise.js.map +1 -1
- package/jsutils/isPromise.mjs +4 -1
- package/jsutils/isPromise.mjs.map +1 -1
- package/jsutils/isSameSet.d.mts +1 -0
- package/jsutils/keyMap.d.mts +29 -0
- package/jsutils/keyValMap.d.mts +19 -0
- package/jsutils/mapValue.d.mts +6 -0
- package/jsutils/memoize1.d.mts +4 -0
- package/jsutils/memoize1.d.ts +4 -0
- package/jsutils/memoize1.js +19 -0
- package/jsutils/memoize1.js.map +1 -0
- package/jsutils/memoize1.mjs +16 -0
- package/jsutils/memoize1.mjs.map +1 -0
- package/jsutils/memoize2.d.mts +4 -0
- package/jsutils/memoize2.d.ts +4 -0
- package/jsutils/memoize2.js +24 -0
- package/jsutils/memoize2.js.map +1 -0
- package/jsutils/memoize2.mjs +21 -0
- package/jsutils/memoize2.mjs.map +1 -0
- package/jsutils/memoize3.d.mts +4 -0
- package/jsutils/memoize3.js +1 -3
- package/jsutils/memoize3.js.map +1 -1
- package/jsutils/memoize3.mjs +1 -3
- package/jsutils/memoize3.mjs.map +1 -1
- package/jsutils/naturalCompare.d.mts +8 -0
- package/jsutils/printPathArray.d.mts +4 -0
- package/jsutils/promiseForObject.d.mts +10 -0
- package/jsutils/promiseForObject.d.ts +2 -1
- package/jsutils/promiseForObject.js +8 -7
- package/jsutils/promiseForObject.js.map +1 -1
- package/jsutils/promiseForObject.mjs +8 -7
- package/jsutils/promiseForObject.mjs.map +1 -1
- package/jsutils/promiseReduce.d.mts +9 -0
- package/jsutils/promiseWithResolvers.d.mts +10 -0
- package/jsutils/suggestionList.d.mts +5 -0
- package/jsutils/toError.d.mts +4 -0
- package/jsutils/toObjMap.d.mts +4 -0
- package/language/KindTypeMap.d.mts +2 -0
- package/language/KindTypeMap.d.ts +2 -0
- package/language/KindTypeMap.js +3 -0
- package/language/KindTypeMap.js.map +1 -0
- package/language/KindTypeMap.mjs +2 -0
- package/language/KindTypeMap.mjs.map +1 -0
- package/language/ast.d.mts +495 -0
- package/language/ast.d.ts +94 -51
- package/language/ast.js +15 -2
- package/language/ast.js.map +1 -1
- package/language/ast.mjs +15 -2
- package/language/ast.mjs.map +1 -1
- package/language/blockString.d.mts +23 -0
- package/language/characterClasses.d.mts +47 -0
- package/language/directiveLocation.d.mts +28 -0
- package/language/index.d.mts +16 -0
- package/language/index.d.ts +3 -3
- package/language/index.js +7 -2
- package/language/index.js.map +1 -1
- package/language/index.mjs +5 -3
- package/language/index.mjs.map +1 -1
- package/language/kinds.d.mts +3 -0
- package/language/kinds.js +34 -1
- package/language/kinds.js.map +1 -1
- package/language/kinds_.d.mts +109 -0
- package/language/kinds_.d.ts +11 -0
- package/language/kinds_.js +7 -1
- package/language/kinds_.js.map +1 -1
- package/language/kinds_.mjs +6 -0
- package/language/kinds_.mjs.map +1 -1
- package/language/lexer.d.mts +87 -0
- package/language/lexer.d.ts +43 -1
- package/language/lexer.js +10 -0
- package/language/lexer.js.map +1 -1
- package/language/lexer.mjs +10 -3
- package/language/lexer.mjs.map +1 -1
- package/language/location.d.mts +13 -0
- package/language/location.js +2 -1
- package/language/location.js.map +1 -1
- package/language/location.mjs +2 -1
- package/language/location.mjs.map +1 -1
- package/language/parser.d.mts +522 -0
- package/language/parser.d.ts +28 -4
- package/language/parser.js +101 -6
- package/language/parser.js.map +1 -1
- package/language/parser.mjs +100 -6
- package/language/parser.mjs.map +1 -1
- package/language/predicates.d.mts +19 -0
- package/language/predicates.d.ts +9 -1
- package/language/predicates.js +19 -0
- package/language/predicates.js.map +1 -1
- package/language/predicates.mjs +17 -0
- package/language/predicates.mjs.map +1 -1
- package/language/printLocation.d.mts +11 -0
- package/language/printString.d.mts +5 -0
- package/language/printer.d.mts +6 -0
- package/language/printer.js +28 -12
- package/language/printer.js.map +1 -1
- package/language/printer.mjs +28 -12
- package/language/printer.mjs.map +1 -1
- package/language/schemaCoordinateLexer.d.mts +43 -0
- package/language/schemaCoordinateLexer.d.ts +43 -0
- package/language/schemaCoordinateLexer.js +93 -0
- package/language/schemaCoordinateLexer.js.map +1 -0
- package/language/schemaCoordinateLexer.mjs +89 -0
- package/language/schemaCoordinateLexer.mjs.map +1 -0
- package/language/source.d.mts +26 -0
- package/language/source.d.ts +1 -0
- package/language/source.js +7 -3
- package/language/source.js.map +1 -1
- package/language/source.mjs +7 -3
- package/language/source.mjs.map +1 -1
- package/language/tokenKind.d.mts +30 -0
- package/language/tokenKind.d.ts +1 -0
- package/language/tokenKind.js +1 -0
- package/language/tokenKind.js.map +1 -1
- package/language/tokenKind.mjs +1 -0
- package/language/tokenKind.mjs.map +1 -1
- package/language/visitor.d.mts +160 -0
- package/language/visitor.js +3 -2
- package/language/visitor.js.map +1 -1
- package/language/visitor.mjs +3 -2
- package/language/visitor.mjs.map +1 -1
- package/package.json +174 -7
- package/type/assertName.d.mts +10 -0
- package/type/definition.d.mts +933 -0
- package/type/definition.d.ts +58 -16
- package/type/definition.js +53 -28
- package/type/definition.js.map +1 -1
- package/type/definition.mjs +53 -28
- package/type/definition.mjs.map +1 -1
- package/type/directives.d.mts +97 -0
- package/type/directives.d.ts +5 -0
- package/type/directives.js +20 -4
- package/type/directives.js.map +1 -1
- package/type/directives.mjs +19 -3
- package/type/directives.mjs.map +1 -1
- package/type/index.d.mts +12 -0
- package/type/index.d.ts +1 -1
- package/type/index.js.map +1 -1
- package/type/index.mjs.map +1 -1
- package/type/introspection.d.mts +26 -0
- package/type/introspection.d.ts +3 -3
- package/type/introspection.js +9 -7
- package/type/introspection.js.map +1 -1
- package/type/introspection.mjs +9 -7
- package/type/introspection.mjs.map +1 -1
- package/type/scalars.d.mts +19 -0
- package/type/scalars.d.ts +5 -5
- package/type/scalars.js +130 -38
- package/type/scalars.js.map +1 -1
- package/type/scalars.mjs +130 -38
- package/type/scalars.mjs.map +1 -1
- package/type/schema.d.mts +172 -0
- package/type/schema.d.ts +2 -0
- package/type/schema.js +11 -13
- package/type/schema.js.map +1 -1
- package/type/schema.mjs +11 -13
- package/type/schema.mjs.map +1 -1
- package/type/validate.d.mts +21 -0
- package/type/validate.d.ts +6 -0
- package/type/validate.js +48 -30
- package/type/validate.js.map +1 -1
- package/type/validate.mjs +47 -30
- package/type/validate.mjs.map +1 -1
- package/utilities/TypeInfo.d.mts +55 -0
- package/utilities/TypeInfo.js +3 -1
- package/utilities/TypeInfo.js.map +1 -1
- package/utilities/TypeInfo.mjs +3 -1
- package/utilities/TypeInfo.mjs.map +1 -1
- package/utilities/astFromValue.d.mts +27 -0
- package/utilities/astFromValue.d.ts +1 -0
- package/utilities/astFromValue.js +8 -2
- package/utilities/astFromValue.js.map +1 -1
- package/utilities/astFromValue.mjs +8 -2
- package/utilities/astFromValue.mjs.map +1 -1
- package/utilities/buildASTSchema.d.mts +29 -0
- package/utilities/buildClientSchema.d.mts +16 -0
- package/utilities/buildClientSchema.js +10 -6
- package/utilities/buildClientSchema.js.map +1 -1
- package/utilities/buildClientSchema.mjs +9 -6
- package/utilities/buildClientSchema.mjs.map +1 -1
- package/utilities/coerceInputValue.d.mts +34 -0
- package/utilities/coerceInputValue.d.ts +7 -1
- package/utilities/coerceInputValue.js +36 -13
- package/utilities/coerceInputValue.js.map +1 -1
- package/utilities/coerceInputValue.mjs +36 -13
- package/utilities/coerceInputValue.mjs.map +1 -1
- package/utilities/concatAST.d.mts +7 -0
- package/utilities/extendSchema.d.mts +29 -0
- package/utilities/extendSchema.js +2 -1
- package/utilities/extendSchema.js.map +1 -1
- package/utilities/extendSchema.mjs +2 -1
- package/utilities/extendSchema.mjs.map +1 -1
- package/utilities/findSchemaChanges.d.mts +72 -0
- package/utilities/findSchemaChanges.d.ts +18 -18
- package/utilities/findSchemaChanges.js +4 -2
- package/utilities/findSchemaChanges.js.map +1 -1
- package/utilities/findSchemaChanges.mjs +4 -2
- package/utilities/findSchemaChanges.mjs.map +1 -1
- package/utilities/getDefaultValueAST.d.mts +3 -0
- package/utilities/getDefaultValueAST.js +4 -2
- package/utilities/getDefaultValueAST.js.map +1 -1
- package/utilities/getDefaultValueAST.mjs +4 -2
- package/utilities/getDefaultValueAST.mjs.map +1 -1
- package/utilities/getIntrospectionQuery.d.mts +138 -0
- package/utilities/getOperationAST.d.mts +8 -0
- package/utilities/index.d.mts +32 -0
- package/utilities/index.d.ts +2 -0
- package/utilities/index.js +5 -1
- package/utilities/index.js.map +1 -1
- package/utilities/index.mjs +2 -0
- package/utilities/index.mjs.map +1 -1
- package/utilities/introspectionFromSchema.d.mts +12 -0
- package/utilities/introspectionFromSchema.js +2 -1
- package/utilities/introspectionFromSchema.js.map +1 -1
- package/utilities/introspectionFromSchema.mjs +2 -1
- package/utilities/introspectionFromSchema.mjs.map +1 -1
- package/utilities/lexicographicSortSchema.d.mts +7 -0
- package/utilities/mapSchemaConfig.d.mts +66 -0
- package/utilities/mapSchemaConfig.d.ts +1 -1
- package/utilities/mapSchemaConfig.js +6 -3
- package/utilities/mapSchemaConfig.js.map +1 -1
- package/utilities/mapSchemaConfig.mjs +6 -3
- package/utilities/mapSchemaConfig.mjs.map +1 -1
- package/utilities/printSchema.d.mts +7 -0
- package/utilities/printSchema.js +4 -2
- package/utilities/printSchema.js.map +1 -1
- package/utilities/printSchema.mjs +4 -2
- package/utilities/printSchema.mjs.map +1 -1
- package/utilities/replaceVariables.d.mts +13 -0
- package/utilities/replaceVariables.d.ts +2 -1
- package/utilities/replaceVariables.js +17 -8
- package/utilities/replaceVariables.js.map +1 -1
- package/utilities/replaceVariables.mjs +17 -8
- package/utilities/replaceVariables.mjs.map +1 -1
- package/utilities/resolveSchemaCoordinate.d.mts +57 -0
- package/utilities/resolveSchemaCoordinate.d.ts +57 -0
- package/utilities/resolveSchemaCoordinate.js +167 -0
- package/utilities/resolveSchemaCoordinate.js.map +1 -0
- package/utilities/resolveSchemaCoordinate.mjs +163 -0
- package/utilities/resolveSchemaCoordinate.mjs.map +1 -0
- package/utilities/separateOperations.d.mts +9 -0
- package/utilities/sortValueNode.d.mts +9 -0
- package/utilities/stripIgnoredCharacters.d.mts +62 -0
- package/utilities/typeComparators.d.mts +21 -0
- package/utilities/typeFromAST.d.mts +15 -0
- package/utilities/typedQueryDocumentNode.d.mts +17 -0
- package/utilities/validateInputValue.d.mts +19 -0
- package/utilities/validateInputValue.d.ts +2 -1
- package/utilities/validateInputValue.js +42 -17
- package/utilities/validateInputValue.js.map +1 -1
- package/utilities/validateInputValue.mjs +42 -17
- package/utilities/validateInputValue.mjs.map +1 -1
- package/utilities/valueFromAST.d.mts +26 -0
- package/utilities/valueFromAST.js +24 -9
- package/utilities/valueFromAST.js.map +1 -1
- package/utilities/valueFromAST.mjs +24 -9
- package/utilities/valueFromAST.mjs.map +1 -1
- package/utilities/valueFromASTUntyped.d.mts +20 -0
- package/utilities/valueToLiteral.d.mts +31 -0
- package/utilities/valueToLiteral.d.ts +1 -0
- package/utilities/valueToLiteral.js +4 -1
- package/utilities/valueToLiteral.js.map +1 -1
- package/utilities/valueToLiteral.mjs +4 -1
- package/utilities/valueToLiteral.mjs.map +1 -1
- package/validation/ValidationContext.d.mts +70 -0
- package/validation/ValidationContext.js +2 -0
- package/validation/ValidationContext.js.map +1 -1
- package/validation/ValidationContext.mjs +2 -0
- package/validation/ValidationContext.mjs.map +1 -1
- package/validation/index.d.mts +46 -0
- package/validation/rules/DeferStreamDirectiveLabelRule.d.mts +8 -0
- package/validation/rules/DeferStreamDirectiveLabelRule.js +1 -1
- package/validation/rules/DeferStreamDirectiveLabelRule.js.map +1 -1
- package/validation/rules/DeferStreamDirectiveLabelRule.mjs +1 -1
- package/validation/rules/DeferStreamDirectiveLabelRule.mjs.map +1 -1
- package/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.mts +8 -0
- package/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.mts +8 -0
- package/validation/rules/ExecutableDefinitionsRule.d.mts +11 -0
- package/validation/rules/FieldsOnCorrectTypeRule.d.mts +11 -0
- package/validation/rules/FragmentsOnCompositeTypesRule.d.mts +12 -0
- package/validation/rules/KnownArgumentNamesRule.d.mts +16 -0
- package/validation/rules/KnownDirectivesRule.d.mts +11 -0
- package/validation/rules/KnownDirectivesRule.js +7 -4
- package/validation/rules/KnownDirectivesRule.js.map +1 -1
- package/validation/rules/KnownDirectivesRule.mjs +7 -4
- package/validation/rules/KnownDirectivesRule.mjs.map +1 -1
- package/validation/rules/KnownFragmentNamesRule.d.mts +11 -0
- package/validation/rules/KnownOperationTypesRule.d.mts +11 -0
- package/validation/rules/KnownTypeNamesRule.d.mts +11 -0
- package/validation/rules/LoneAnonymousOperationRule.d.mts +11 -0
- package/validation/rules/LoneSchemaDefinitionRule.d.mts +8 -0
- package/validation/rules/MaxIntrospectionDepthRule.d.mts +3 -0
- package/validation/rules/MaxIntrospectionDepthRule.d.ts +2 -2
- package/validation/rules/MaxIntrospectionDepthRule.js +1 -2
- package/validation/rules/MaxIntrospectionDepthRule.js.map +1 -1
- package/validation/rules/MaxIntrospectionDepthRule.mjs +1 -2
- package/validation/rules/MaxIntrospectionDepthRule.mjs.map +1 -1
- package/validation/rules/NoFragmentCyclesRule.d.mts +11 -0
- package/validation/rules/NoUndefinedVariablesRule.d.mts +11 -0
- package/validation/rules/NoUnusedFragmentsRule.d.mts +11 -0
- package/validation/rules/NoUnusedVariablesRule.d.mts +11 -0
- package/validation/rules/OverlappingFieldsCanBeMergedRule.d.mts +12 -0
- package/validation/rules/OverlappingFieldsCanBeMergedRule.js +15 -14
- package/validation/rules/OverlappingFieldsCanBeMergedRule.js.map +1 -1
- package/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +15 -14
- package/validation/rules/OverlappingFieldsCanBeMergedRule.mjs.map +1 -1
- package/validation/rules/PossibleFragmentSpreadsRule.d.mts +10 -0
- package/validation/rules/PossibleTypeExtensionsRule.d.mts +8 -0
- package/validation/rules/PossibleTypeExtensionsRule.js +5 -3
- package/validation/rules/PossibleTypeExtensionsRule.js.map +1 -1
- package/validation/rules/PossibleTypeExtensionsRule.mjs +5 -3
- package/validation/rules/PossibleTypeExtensionsRule.mjs.map +1 -1
- package/validation/rules/ProvidedRequiredArgumentsRule.d.mts +13 -0
- package/validation/rules/ScalarLeafsRule.d.mts +9 -0
- package/validation/rules/SingleFieldSubscriptionsRule.d.mts +12 -0
- package/validation/rules/SingleFieldSubscriptionsRule.d.ts +2 -1
- package/validation/rules/SingleFieldSubscriptionsRule.js +9 -2
- package/validation/rules/SingleFieldSubscriptionsRule.js.map +1 -1
- package/validation/rules/SingleFieldSubscriptionsRule.mjs +9 -2
- package/validation/rules/SingleFieldSubscriptionsRule.mjs.map +1 -1
- package/validation/rules/StreamDirectiveOnListFieldRule.d.mts +8 -0
- package/validation/rules/UniqueArgumentDefinitionNamesRule.d.mts +9 -0
- package/validation/rules/UniqueArgumentNamesRule.d.mts +11 -0
- package/validation/rules/UniqueDirectiveNamesRule.d.mts +8 -0
- package/validation/rules/UniqueDirectivesPerLocationRule.d.mts +11 -0
- package/validation/rules/UniqueEnumValueNamesRule.d.mts +8 -0
- package/validation/rules/UniqueFieldDefinitionNamesRule.d.mts +8 -0
- package/validation/rules/UniqueFragmentNamesRule.d.mts +10 -0
- package/validation/rules/UniqueInputFieldNamesRule.d.mts +11 -0
- package/validation/rules/UniqueInputFieldNamesRule.js +2 -1
- package/validation/rules/UniqueInputFieldNamesRule.js.map +1 -1
- package/validation/rules/UniqueInputFieldNamesRule.mjs +2 -1
- package/validation/rules/UniqueInputFieldNamesRule.mjs.map +1 -1
- package/validation/rules/UniqueOperationNamesRule.d.mts +10 -0
- package/validation/rules/UniqueOperationTypesRule.d.mts +8 -0
- package/validation/rules/UniqueTypeNamesRule.d.mts +8 -0
- package/validation/rules/UniqueVariableNamesRule.d.mts +8 -0
- package/validation/rules/ValuesOfCorrectTypeRule.d.mts +11 -0
- package/validation/rules/ValuesOfCorrectTypeRule.js +5 -0
- package/validation/rules/ValuesOfCorrectTypeRule.js.map +1 -1
- package/validation/rules/ValuesOfCorrectTypeRule.mjs +5 -0
- package/validation/rules/ValuesOfCorrectTypeRule.mjs.map +1 -1
- package/validation/rules/VariablesAreInputTypesRule.d.mts +11 -0
- package/validation/rules/VariablesInAllowedPositionRule.d.mts +10 -0
- package/validation/rules/VariablesInAllowedPositionRule.js +1 -3
- package/validation/rules/VariablesInAllowedPositionRule.js.map +1 -1
- package/validation/rules/VariablesInAllowedPositionRule.mjs +1 -3
- package/validation/rules/VariablesInAllowedPositionRule.mjs.map +1 -1
- package/validation/rules/custom/NoDeprecatedCustomRule.d.mts +13 -0
- package/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.mts +13 -0
- package/validation/specifiedRules.d.mts +17 -0
- package/validation/specifiedRules.d.ts +1 -2
- package/validation/specifiedRules.js +3 -1
- package/validation/specifiedRules.js.map +1 -1
- package/validation/specifiedRules.mjs +3 -1
- package/validation/specifiedRules.mjs.map +1 -1
- package/validation/validate.d.mts +48 -0
- package/validation/validate.d.ts +5 -4
- package/validation/validate.js +10 -5
- package/validation/validate.js.map +1 -1
- package/validation/validate.mjs +10 -5
- package/validation/validate.mjs.map +1 -1
- package/version.d.mts +13 -0
- package/version.js +2 -2
- package/version.js.map +1 -1
- package/version.mjs +2 -2
- package/version.mjs.map +1 -1
- package/execution/AbortSignalListener.d.ts +0 -17
- package/execution/AbortSignalListener.js +0 -71
- package/execution/AbortSignalListener.js.map +0 -1
- package/execution/AbortSignalListener.mjs +0 -65
- package/execution/AbortSignalListener.mjs.map +0 -1
- package/execution/IncrementalGraph.d.ts +0 -29
- package/execution/IncrementalGraph.js +0 -232
- package/execution/IncrementalGraph.js.map +0 -1
- package/execution/IncrementalGraph.mjs +0 -228
- package/execution/IncrementalGraph.mjs.map +0 -1
- package/execution/IncrementalPublisher.d.ts +0 -10
- package/execution/IncrementalPublisher.js +0 -259
- package/execution/IncrementalPublisher.js.map +0 -1
- package/execution/IncrementalPublisher.mjs +0 -256
- package/execution/IncrementalPublisher.mjs.map +0 -1
- package/execution/buildExecutionPlan.js.map +0 -1
- package/execution/buildExecutionPlan.mjs.map +0 -1
- package/execution/types.d.ts +0 -161
- package/execution/types.js +0 -36
- package/execution/types.js.map +0 -1
- package/execution/types.mjs +0 -27
- package/execution/types.mjs.map +0 -1
- package/jsutils/BoxedPromiseOrValue.d.ts +0 -15
- package/jsutils/BoxedPromiseOrValue.js +0 -27
- package/jsutils/BoxedPromiseOrValue.js.map +0 -1
- package/jsutils/BoxedPromiseOrValue.mjs +0 -23
- package/jsutils/BoxedPromiseOrValue.mjs.map +0 -1
package/execution/values.js
CHANGED
|
@@ -3,13 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getVariableValues = getVariableValues;
|
|
4
4
|
exports.getFragmentVariableValues = getFragmentVariableValues;
|
|
5
5
|
exports.getArgumentValues = getArgumentValues;
|
|
6
|
-
exports.experimentalGetArgumentValues = experimentalGetArgumentValues;
|
|
7
6
|
exports.getDirectiveValues = getDirectiveValues;
|
|
8
7
|
const invariant_js_1 = require("../jsutils/invariant.js");
|
|
9
8
|
const printPathArray_js_1 = require("../jsutils/printPathArray.js");
|
|
9
|
+
const ensureGraphQLError_js_1 = require("../error/ensureGraphQLError.js");
|
|
10
10
|
const GraphQLError_js_1 = require("../error/GraphQLError.js");
|
|
11
11
|
const kinds_js_1 = require("../language/kinds.js");
|
|
12
12
|
const definition_js_1 = require("../type/definition.js");
|
|
13
|
+
const validate_js_1 = require("../type/validate.js");
|
|
13
14
|
const coerceInputValue_js_1 = require("../utilities/coerceInputValue.js");
|
|
14
15
|
const validateInputValue_js_1 = require("../utilities/validateInputValue.js");
|
|
15
16
|
const getVariableSignature_js_1 = require("./getVariableSignature.js");
|
|
@@ -18,9 +19,8 @@ const getVariableSignature_js_1 = require("./getVariableSignature.js");
|
|
|
18
19
|
* provided variable definitions and arbitrary input. If the input cannot be
|
|
19
20
|
* parsed to match the variable definitions, a GraphQLError will be thrown.
|
|
20
21
|
*
|
|
21
|
-
* Note: The
|
|
22
|
-
*
|
|
23
|
-
* Object prototype.
|
|
22
|
+
* Note: The `coerced` and `sources` properties of VariableValues use null
|
|
23
|
+
* prototype to avoid collisions with JavaScript's own property names.
|
|
24
24
|
*/
|
|
25
25
|
function getVariableValues(schema, varDefNodes, inputs, options) {
|
|
26
26
|
const errors = [];
|
|
@@ -37,7 +37,7 @@ function getVariableValues(schema, varDefNodes, inputs, options) {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
catch (error) {
|
|
40
|
-
errors.push(error);
|
|
40
|
+
errors.push((0, ensureGraphQLError_js_1.ensureGraphQLError)(error));
|
|
41
41
|
}
|
|
42
42
|
return { errors };
|
|
43
43
|
}
|
|
@@ -51,11 +51,13 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError, hideSuggesti
|
|
|
51
51
|
continue;
|
|
52
52
|
}
|
|
53
53
|
const { name: varName, type: varType } = varSignature;
|
|
54
|
-
|
|
55
|
-
if (
|
|
54
|
+
const value = Object.hasOwn(inputs, varName) ? inputs[varName] : undefined;
|
|
55
|
+
if (value === undefined) {
|
|
56
56
|
sources[varName] = { signature: varSignature };
|
|
57
57
|
if (varDefNode.defaultValue) {
|
|
58
|
-
coerced
|
|
58
|
+
maybeUseDefaultValue(coerced, varName, varSignature, (error, path) => {
|
|
59
|
+
onError(new GraphQLError_js_1.GraphQLError(`Variable "$${varName}" has invalid default value${(0, printPathArray_js_1.printPathArray)(path)}: ${error.message}`, { nodes: varDefNode }));
|
|
60
|
+
}, hideSuggestions);
|
|
59
61
|
continue;
|
|
60
62
|
}
|
|
61
63
|
else if (!(0, definition_js_1.isNonNullType)(varType)) {
|
|
@@ -64,7 +66,6 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError, hideSuggesti
|
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
68
|
else {
|
|
67
|
-
value = inputs[varName];
|
|
68
69
|
sources[varName] = { signature: varSignature, value };
|
|
69
70
|
}
|
|
70
71
|
const coercedValue = (0, coerceInputValue_js_1.coerceInputValue)(value, varType);
|
|
@@ -79,88 +80,125 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError, hideSuggesti
|
|
|
79
80
|
}
|
|
80
81
|
return { sources, coerced };
|
|
81
82
|
}
|
|
83
|
+
function maybeUseDefaultValue(coercedValues, name, inputValue, onError, hideSuggestions) {
|
|
84
|
+
try {
|
|
85
|
+
// coerceDefaultValue assumes validation has already rejected invalid
|
|
86
|
+
// defaults. If validation was skipped, invalid defaults or nested input
|
|
87
|
+
// field defaults can throw here; recover with validation-style errors below.
|
|
88
|
+
const coercedDefaultValue = (0, coerceInputValue_js_1.coerceDefaultValue)(inputValue);
|
|
89
|
+
if (coercedDefaultValue !== undefined) {
|
|
90
|
+
coercedValues[name] = coercedDefaultValue;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
const defaultInput = inputValue.default;
|
|
95
|
+
// Defensive: coerceDefaultValue should only throw while coercing a default.
|
|
96
|
+
/* c8 ignore next 3 */
|
|
97
|
+
if (defaultInput === undefined) {
|
|
98
|
+
throw error;
|
|
99
|
+
}
|
|
100
|
+
// Prefer validation's user-facing errors for invalid defaults.
|
|
101
|
+
let reportedValidationError = false;
|
|
102
|
+
(0, validate_js_1.validateDefaultInput)(defaultInput, inputValue.type, (defaultError, path) => {
|
|
103
|
+
reportedValidationError = true;
|
|
104
|
+
onError(defaultError, path);
|
|
105
|
+
}, hideSuggestions);
|
|
106
|
+
if (!reportedValidationError) {
|
|
107
|
+
// The default itself validated, so coercion failed while applying a nested
|
|
108
|
+
// input field default. Surface the original coercion error.
|
|
109
|
+
onError((0, ensureGraphQLError_js_1.ensureGraphQLError)(error), []);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
82
113
|
function getFragmentVariableValues(fragmentSpreadNode, fragmentSignatures, variableValues, fragmentVariableValues, hideSuggestions) {
|
|
83
|
-
const
|
|
114
|
+
const argumentNodes = fragmentSpreadNode.arguments ?? [];
|
|
115
|
+
const argNodeMap = new Map(argumentNodes.map((arg) => [arg.name.value, arg]));
|
|
84
116
|
const sources = Object.create(null);
|
|
117
|
+
const coerced = Object.create(null);
|
|
85
118
|
for (const [varName, varSignature] of Object.entries(fragmentSignatures)) {
|
|
86
|
-
varSignatures.push(varSignature);
|
|
87
119
|
sources[varName] = {
|
|
88
120
|
signature: varSignature,
|
|
89
|
-
value: fragmentVariableValues?.sources[varName]?.value ??
|
|
90
|
-
variableValues.sources[varName]?.value,
|
|
91
121
|
};
|
|
122
|
+
const argumentNode = argNodeMap.get(varName);
|
|
123
|
+
if (argumentNode !== undefined) {
|
|
124
|
+
const source = sources[varName];
|
|
125
|
+
source.value = argumentNode.value;
|
|
126
|
+
source.fragmentVariableValues = fragmentVariableValues;
|
|
127
|
+
}
|
|
128
|
+
coerceArgument(coerced, fragmentSpreadNode, varName, varSignature, argumentNode, variableValues, fragmentVariableValues, hideSuggestions);
|
|
92
129
|
}
|
|
93
|
-
const coerced = experimentalGetArgumentValues(fragmentSpreadNode, varSignatures, variableValues, fragmentVariableValues, hideSuggestions);
|
|
94
130
|
return { sources, coerced };
|
|
95
131
|
}
|
|
96
132
|
/**
|
|
97
133
|
* Prepares an object map of argument values given a list of argument
|
|
98
134
|
* definitions and list of argument AST nodes.
|
|
99
135
|
*
|
|
100
|
-
* Note: The returned value
|
|
101
|
-
*
|
|
102
|
-
* Object prototype.
|
|
136
|
+
* Note: The returned value uses a null prototype to avoid collisions with
|
|
137
|
+
* JavaScript's own property names.
|
|
103
138
|
*/
|
|
104
|
-
function getArgumentValues(def, node, variableValues, hideSuggestions) {
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
function experimentalGetArgumentValues(node, argDefs, variableValues, fragmentVariableValues, hideSuggestions) {
|
|
108
|
-
const coercedValues = {};
|
|
139
|
+
function getArgumentValues(def, node, variableValues, fragmentVariableValues, hideSuggestions) {
|
|
140
|
+
const coercedValues = Object.create(null);
|
|
109
141
|
const argumentNodes = node.arguments ?? [];
|
|
110
142
|
const argNodeMap = new Map(argumentNodes.map((arg) => [arg.name.value, arg]));
|
|
111
|
-
for (const argDef of
|
|
143
|
+
for (const argDef of def.args) {
|
|
112
144
|
const name = argDef.name;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
coercedValues[name] = coercedDefaultValue;
|
|
127
|
-
}
|
|
128
|
-
continue;
|
|
129
|
-
}
|
|
130
|
-
const valueNode = argumentNode.value;
|
|
131
|
-
// Variables without a value are treated as if no argument was provided if
|
|
132
|
-
// the argument is not required.
|
|
133
|
-
if (valueNode.kind === kinds_js_1.Kind.VARIABLE) {
|
|
134
|
-
const variableName = valueNode.name.value;
|
|
135
|
-
const scopedVariableValues = fragmentVariableValues?.sources[variableName]
|
|
136
|
-
? fragmentVariableValues
|
|
137
|
-
: variableValues;
|
|
138
|
-
if ((scopedVariableValues == null ||
|
|
139
|
-
!Object.hasOwn(scopedVariableValues.coerced, variableName)) &&
|
|
140
|
-
!(0, definition_js_1.isRequiredArgument)(argDef)) {
|
|
141
|
-
const coercedDefaultValue = (0, coerceInputValue_js_1.coerceDefaultValue)(argDef);
|
|
142
|
-
if (coercedDefaultValue !== undefined) {
|
|
143
|
-
coercedValues[name] = coercedDefaultValue;
|
|
144
|
-
}
|
|
145
|
-
continue;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
const coercedValue = (0, coerceInputValue_js_1.coerceInputLiteral)(valueNode, argType, variableValues, fragmentVariableValues);
|
|
149
|
-
if (coercedValue === undefined) {
|
|
150
|
-
// Note: ValuesOfCorrectTypeRule validation should catch this before
|
|
145
|
+
coerceArgument(coercedValues, node, name, argDef, argNodeMap.get(argDef.name), variableValues, fragmentVariableValues, hideSuggestions);
|
|
146
|
+
}
|
|
147
|
+
return coercedValues;
|
|
148
|
+
}
|
|
149
|
+
// eslint-disable-next-line max-params
|
|
150
|
+
function coerceArgument(coercedValues, node, argName, argDef, argumentNode, variableValues, fragmentVariableValues, hideSuggestions) {
|
|
151
|
+
const argType = argDef.type;
|
|
152
|
+
const onArgDefaultValueError = (error, path) => {
|
|
153
|
+
throw new GraphQLError_js_1.GraphQLError(`${printArgumentOrFragmentVariable(argDef, node)} has invalid default value${(0, printPathArray_js_1.printPathArray)(path)}: ${error.message}`, { nodes: node });
|
|
154
|
+
};
|
|
155
|
+
if (!argumentNode) {
|
|
156
|
+
if ((0, definition_js_1.isRequiredArgument)(argDef)) {
|
|
157
|
+
// Note: ProvidedRequiredArgumentsRule validation should catch this before
|
|
151
158
|
// execution. This is a runtime check to ensure execution does not
|
|
152
159
|
// continue with an invalid argument value.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
throw error;
|
|
157
|
-
}, variableValues, fragmentVariableValues, hideSuggestions);
|
|
158
|
-
/* c8 ignore next */
|
|
159
|
-
(false) || (0, invariant_js_1.invariant)(false, 'Invalid argument');
|
|
160
|
+
throw new GraphQLError_js_1.GraphQLError(
|
|
161
|
+
// TODO: clean up the naming of isRequiredArgument(), isArgument(), and argDef if/when experimental fragment variables are merged
|
|
162
|
+
`${printArgumentOrFragmentVariable(argDef, node)} of required type "${argType}" was not provided.`, { nodes: node });
|
|
160
163
|
}
|
|
161
|
-
coercedValues
|
|
164
|
+
maybeUseDefaultValue(coercedValues, argName, argDef, onArgDefaultValueError, hideSuggestions);
|
|
165
|
+
return;
|
|
162
166
|
}
|
|
163
|
-
|
|
167
|
+
const valueNode = argumentNode.value;
|
|
168
|
+
// Variables without a value are treated as if no argument was provided if
|
|
169
|
+
// the argument is not required.
|
|
170
|
+
if (valueNode.kind === kinds_js_1.Kind.VARIABLE) {
|
|
171
|
+
const variableName = valueNode.name.value;
|
|
172
|
+
const scopedVariableValues = fragmentVariableValues?.sources[variableName]
|
|
173
|
+
? fragmentVariableValues
|
|
174
|
+
: variableValues;
|
|
175
|
+
if ((scopedVariableValues == null ||
|
|
176
|
+
!Object.hasOwn(scopedVariableValues.coerced, variableName)) &&
|
|
177
|
+
!(0, definition_js_1.isRequiredArgument)(argDef)) {
|
|
178
|
+
maybeUseDefaultValue(coercedValues, argName, argDef, onArgDefaultValueError, hideSuggestions);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
const coercedValue = (0, coerceInputValue_js_1.coerceInputLiteral)(valueNode, argType, variableValues, fragmentVariableValues);
|
|
183
|
+
if (coercedValue === undefined) {
|
|
184
|
+
// Note: ValuesOfCorrectTypeRule validation should catch this before
|
|
185
|
+
// execution. This is a runtime check to ensure execution does not
|
|
186
|
+
// continue with an invalid argument value.
|
|
187
|
+
(0, validateInputValue_js_1.validateInputLiteral)(valueNode, argType, (error, path) => {
|
|
188
|
+
// TODO: clean up the naming of isRequiredArgument(), isArgument(), and argDef if/when experimental fragment variables are merged
|
|
189
|
+
error.message = `${printArgumentOrFragmentVariable(argDef, node)} has invalid value${(0, printPathArray_js_1.printPathArray)(path)}: ${error.message}`;
|
|
190
|
+
throw error;
|
|
191
|
+
}, variableValues, fragmentVariableValues, hideSuggestions);
|
|
192
|
+
/* c8 ignore next */
|
|
193
|
+
(0, invariant_js_1.invariant)(false, 'Invalid argument');
|
|
194
|
+
}
|
|
195
|
+
coercedValues[argName] = coercedValue;
|
|
196
|
+
}
|
|
197
|
+
// TODO: clean up the naming of isRequiredArgument(), isArgument(), and argDef if/when experimental fragment variables are merged
|
|
198
|
+
function printArgumentOrFragmentVariable(argDef, node) {
|
|
199
|
+
return (0, definition_js_1.isArgument)(argDef)
|
|
200
|
+
? `Argument "${argDef}"`
|
|
201
|
+
: `Variable "$${argDef.name}" defined by fragment "${node.name.value}"`;
|
|
164
202
|
}
|
|
165
203
|
/**
|
|
166
204
|
* Prepares an object map of argument values given a directive definition
|
|
@@ -169,14 +207,13 @@ function experimentalGetArgumentValues(node, argDefs, variableValues, fragmentVa
|
|
|
169
207
|
*
|
|
170
208
|
* If the directive does not exist on the node, returns undefined.
|
|
171
209
|
*
|
|
172
|
-
* Note: The returned value
|
|
173
|
-
*
|
|
174
|
-
* Object prototype.
|
|
210
|
+
* Note: The returned value uses a null prototype to avoid collisions with
|
|
211
|
+
* JavaScript's own property names.
|
|
175
212
|
*/
|
|
176
213
|
function getDirectiveValues(directiveDef, node, variableValues, fragmentVariableValues, hideSuggestions) {
|
|
177
214
|
const directiveNode = node.directives?.find((directive) => directive.name.value === directiveDef.name);
|
|
178
215
|
if (directiveNode) {
|
|
179
|
-
return
|
|
216
|
+
return getArgumentValues(directiveDef, directiveNode, variableValues, fragmentVariableValues, hideSuggestions);
|
|
180
217
|
}
|
|
181
218
|
}
|
|
182
219
|
//# sourceMappingURL=values.js.map
|
package/execution/values.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.js","sourceRoot":"","sources":["../../src/execution/values.ts"],"names":[],"mappings":";;AA4DA,8CAgCC;AA4DD,8DA4BC;AAUD,8CAaC;AAED,sEAsFC;AAaD,gDAoBC;AApUD,0DAAoD;AAGpD,oEAA8D;AAE9D,8DAAwD;AAQxD,mDAA4C;AAG5C,yDAI+B;AAI/B,0EAI0C;AAC1C,8EAG4C;AAG5C,uEAAiE;AAgBjE;;;;;;;;GAQG;AACH,SAAgB,iBAAiB,CAC/B,MAAqB,EACrB,WAAkD,EAClD,MAAgD,EAChD,OAA2D;IAE3D,MAAM,MAAM,GAAwB,EAAE,CAAC;IACvC,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,CAAC;IACrC,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,oBAAoB,CACzC,MAAM,EACN,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jB,cAAc,EACd,sBAAsB,EACtB,eAAe,CAChB,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { invariant } from '../jsutils/invariant.js';\nimport type { Maybe } from '../jsutils/Maybe.js';\nimport type { ObjMap, ReadOnlyObjMap } from '../jsutils/ObjMap.js';\nimport { printPathArray } from '../jsutils/printPathArray.js';\n\nimport { GraphQLError } from '../error/GraphQLError.js';\n\nimport type {\n DirectiveNode,\n FieldNode,\n FragmentSpreadNode,\n VariableDefinitionNode,\n} from '../language/ast.js';\nimport { Kind } from '../language/kinds.js';\n\nimport type { GraphQLArgument, GraphQLField } from '../type/definition.js';\nimport {\n isArgument,\n isNonNullType,\n isRequiredArgument,\n} from '../type/definition.js';\nimport type { GraphQLDirective } from '../type/directives.js';\nimport type { GraphQLSchema } from '../type/schema.js';\n\nimport {\n coerceDefaultValue,\n coerceInputLiteral,\n coerceInputValue,\n} from '../utilities/coerceInputValue.js';\nimport {\n validateInputLiteral,\n validateInputValue,\n} from '../utilities/validateInputValue.js';\n\nimport type { GraphQLVariableSignature } from './getVariableSignature.js';\nimport { getVariableSignature } from './getVariableSignature.js';\n\nexport interface VariableValues {\n readonly sources: ReadOnlyObjMap<VariableValueSource>;\n readonly coerced: ReadOnlyObjMap<unknown>;\n}\n\ninterface VariableValueSource {\n readonly signature: GraphQLVariableSignature;\n readonly value?: unknown;\n}\n\ntype VariableValuesOrErrors =\n | { variableValues: VariableValues; errors?: never }\n | { errors: ReadonlyArray<GraphQLError>; variableValues?: never };\n\n/**\n * Prepares an object map of variableValues of the correct type based on the\n * provided variable definitions and arbitrary input. If the input cannot be\n * parsed to match the variable definitions, a GraphQLError will be thrown.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n */\nexport function getVariableValues(\n schema: GraphQLSchema,\n varDefNodes: ReadonlyArray<VariableDefinitionNode>,\n inputs: { readonly [variable: string]: unknown },\n options?: { maxErrors?: number; hideSuggestions?: boolean },\n): VariableValuesOrErrors {\n const errors: Array<GraphQLError> = [];\n const maxErrors = options?.maxErrors;\n try {\n const variableValues = coerceVariableValues(\n schema,\n varDefNodes,\n inputs,\n (error) => {\n if (maxErrors != null && errors.length >= maxErrors) {\n throw new GraphQLError(\n 'Too many errors processing variables, error limit reached. Execution aborted.',\n );\n }\n errors.push(error);\n },\n options?.hideSuggestions,\n );\n\n if (errors.length === 0) {\n return { variableValues };\n }\n } catch (error) {\n errors.push(error);\n }\n\n return { errors };\n}\n\nfunction coerceVariableValues(\n schema: GraphQLSchema,\n varDefNodes: ReadonlyArray<VariableDefinitionNode>,\n inputs: { readonly [variable: string]: unknown },\n onError: (error: GraphQLError) => void,\n hideSuggestions?: Maybe<boolean>,\n): VariableValues {\n const sources: ObjMap<VariableValueSource> = Object.create(null);\n const coerced: ObjMap<unknown> = Object.create(null);\n for (const varDefNode of varDefNodes) {\n const varSignature = getVariableSignature(schema, varDefNode);\n\n if (varSignature instanceof GraphQLError) {\n onError(varSignature);\n continue;\n }\n\n const { name: varName, type: varType } = varSignature;\n let value: unknown;\n if (!Object.hasOwn(inputs, varName)) {\n sources[varName] = { signature: varSignature };\n if (varDefNode.defaultValue) {\n coerced[varName] = coerceInputLiteral(varDefNode.defaultValue, varType);\n continue;\n } else if (!isNonNullType(varType)) {\n // Non-provided values for nullable variables are omitted.\n continue;\n }\n } else {\n value = inputs[varName];\n sources[varName] = { signature: varSignature, value };\n }\n\n const coercedValue = coerceInputValue(value, varType);\n if (coercedValue !== undefined) {\n coerced[varName] = coercedValue;\n } else {\n validateInputValue(\n value,\n varType,\n (error, path) => {\n onError(\n new GraphQLError(\n `Variable \"$${varName}\" has invalid value${printPathArray(path)}: ${\n error.message\n }`,\n { nodes: varDefNode, originalError: error },\n ),\n );\n },\n hideSuggestions,\n );\n }\n }\n\n return { sources, coerced };\n}\n\nexport function getFragmentVariableValues(\n fragmentSpreadNode: FragmentSpreadNode,\n fragmentSignatures: ReadOnlyObjMap<GraphQLVariableSignature>,\n variableValues: VariableValues,\n fragmentVariableValues?: Maybe<VariableValues>,\n hideSuggestions?: Maybe<boolean>,\n): VariableValues {\n const varSignatures: Array<GraphQLVariableSignature> = [];\n const sources = Object.create(null);\n for (const [varName, varSignature] of Object.entries(fragmentSignatures)) {\n varSignatures.push(varSignature);\n sources[varName] = {\n signature: varSignature,\n value:\n fragmentVariableValues?.sources[varName]?.value ??\n variableValues.sources[varName]?.value,\n };\n }\n\n const coerced = experimentalGetArgumentValues(\n fragmentSpreadNode,\n varSignatures,\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n\n return { sources, coerced };\n}\n\n/**\n * Prepares an object map of argument values given a list of argument\n * definitions and list of argument AST nodes.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n */\nexport function getArgumentValues(\n def: GraphQLField<unknown, unknown> | GraphQLDirective,\n node: FieldNode | DirectiveNode,\n variableValues?: Maybe<VariableValues>,\n hideSuggestions?: Maybe<boolean>,\n): { [argument: string]: unknown } {\n return experimentalGetArgumentValues(\n node,\n def.args,\n variableValues,\n undefined,\n hideSuggestions,\n );\n}\n\nexport function experimentalGetArgumentValues(\n node: FieldNode | DirectiveNode | FragmentSpreadNode,\n argDefs: ReadonlyArray<GraphQLArgument | GraphQLVariableSignature>,\n variableValues: Maybe<VariableValues>,\n fragmentVariableValues?: Maybe<VariableValues>,\n hideSuggestions?: Maybe<boolean>,\n): { [argument: string]: unknown } {\n const coercedValues: { [argument: string]: unknown } = {};\n\n const argumentNodes = node.arguments ?? [];\n const argNodeMap = new Map(argumentNodes.map((arg) => [arg.name.value, arg]));\n\n for (const argDef of argDefs) {\n const name = argDef.name;\n const argType = argDef.type;\n const argumentNode = argNodeMap.get(name);\n\n if (!argumentNode) {\n if (isRequiredArgument(argDef)) {\n // Note: ProvidedRequiredArgumentsRule validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n throw new GraphQLError(\n // TODO: clean up the naming of isRequiredArgument(), isArgument(), and argDef if/when experimental fragment variables are merged\n `Argument \"${isArgument(argDef) ? argDef : argDef.name}\" of required type \"${argType}\" was not provided.`,\n { nodes: node },\n );\n }\n const coercedDefaultValue = coerceDefaultValue(argDef);\n if (coercedDefaultValue !== undefined) {\n coercedValues[name] = coercedDefaultValue;\n }\n continue;\n }\n\n const valueNode = argumentNode.value;\n\n // Variables without a value are treated as if no argument was provided if\n // the argument is not required.\n if (valueNode.kind === Kind.VARIABLE) {\n const variableName = valueNode.name.value;\n const scopedVariableValues = fragmentVariableValues?.sources[variableName]\n ? fragmentVariableValues\n : variableValues;\n if (\n (scopedVariableValues == null ||\n !Object.hasOwn(scopedVariableValues.coerced, variableName)) &&\n !isRequiredArgument(argDef)\n ) {\n const coercedDefaultValue = coerceDefaultValue(argDef);\n if (coercedDefaultValue !== undefined) {\n coercedValues[name] = coercedDefaultValue;\n }\n continue;\n }\n }\n const coercedValue = coerceInputLiteral(\n valueNode,\n argType,\n variableValues,\n fragmentVariableValues,\n );\n if (coercedValue === undefined) {\n // Note: ValuesOfCorrectTypeRule validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n validateInputLiteral(\n valueNode,\n argType,\n (error, path) => {\n // TODO: clean up the naming of isRequiredArgument(), isArgument(), and argDef if/when experimental fragment variables are merged\n error.message = `Argument \"${isArgument(argDef) ? argDef : argDef.name}\" has invalid value${printPathArray(\n path,\n )}: ${error.message}`;\n throw error;\n },\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n /* c8 ignore next */\n invariant(false, 'Invalid argument');\n }\n coercedValues[name] = coercedValue;\n }\n return coercedValues;\n}\n\n/**\n * Prepares an object map of argument values given a directive definition\n * and a AST node which may contain directives. Optionally also accepts a map\n * of variable values.\n *\n * If the directive does not exist on the node, returns undefined.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n */\nexport function getDirectiveValues(\n directiveDef: GraphQLDirective,\n node: { readonly directives?: ReadonlyArray<DirectiveNode> | undefined },\n variableValues?: Maybe<VariableValues>,\n fragmentVariableValues?: Maybe<VariableValues>,\n hideSuggestions?: Maybe<boolean>,\n): undefined | { [argument: string]: unknown } {\n const directiveNode = node.directives?.find(\n (directive) => directive.name.value === directiveDef.name,\n );\n\n if (directiveNode) {\n return experimentalGetArgumentValues(\n directiveNode,\n directiveDef.args,\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"values.js","sourceRoot":"","sources":["../../src/execution/values.ts"],"names":[],"mappings":";;AAgEA,8CAgCC;AAmHD,8DAmCC;AASD,8CA0BC;AAuHD,gDAoBC;AApaD,0DAAoD;AAGpD,oEAA8D;AAE9D,0EAAoE;AACpE,8DAAwD;AAUxD,mDAA4C;AAG5C,yDAI+B;AAG/B,qDAA2D;AAE3D,0EAI0C;AAC1C,8EAG4C;AAI5C,uEAAiE;AAgBjE;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAC/B,MAAqB,EACrB,WAAkD,EAClD,MAAgD,EAChD,OAA2D;IAE3D,MAAM,MAAM,GAAwB,EAAE,CAAC;IACvC,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,CAAC;IACrC,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,oBAAoB,CACzC,MAAM,EACN,WAAW,EACX,MAAM,EACN,CAAC,KAAK,EAAE,EAAE;YACR,IAAI,SAAS,IAAI,IAAI,IAAI,MAAM,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;gBACpD,MAAM,IAAI,8BAAY,CACpB,+EAA+E,CAChF,CAAC;YACJ,CAAC;YACD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC,EACD,OAAO,EAAE,eAAe,CACzB,CAAC;QAEF,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,EAAE,cAAc,EAAE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gB,kBAAkB,CAChC,YAA8B,EAC9B,IAAwE,EACxE,cAAsC,EACtC,sBAAsD,EACtD,eAAgC;IAEhC,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,CACzC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,KAAK,YAAY,CAAC,IAAI,CAC1D,CAAC;IAEF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,iBAAiB,CACtB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,eAAe,CAChB,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { invariant } from '../jsutils/invariant.js';\nimport type { Maybe } from '../jsutils/Maybe.js';\nimport type { ObjMap, ReadOnlyObjMap } from '../jsutils/ObjMap.js';\nimport { printPathArray } from '../jsutils/printPathArray.js';\n\nimport { ensureGraphQLError } from '../error/ensureGraphQLError.js';\nimport { GraphQLError } from '../error/GraphQLError.js';\n\nimport type {\n ArgumentNode,\n DirectiveNode,\n FieldNode,\n FragmentArgumentNode,\n FragmentSpreadNode,\n VariableDefinitionNode,\n} from '../language/ast.js';\nimport { Kind } from '../language/kinds.js';\n\nimport type { GraphQLArgument, GraphQLField } from '../type/definition.js';\nimport {\n isArgument,\n isNonNullType,\n isRequiredArgument,\n} from '../type/definition.js';\nimport type { GraphQLDirective } from '../type/directives.js';\nimport type { GraphQLSchema } from '../type/schema.js';\nimport { validateDefaultInput } from '../type/validate.js';\n\nimport {\n coerceDefaultValue,\n coerceInputLiteral,\n coerceInputValue,\n} from '../utilities/coerceInputValue.js';\nimport {\n validateInputLiteral,\n validateInputValue,\n} from '../utilities/validateInputValue.js';\n\nimport type { FragmentVariableValues } from './collectFields.js';\nimport type { GraphQLVariableSignature } from './getVariableSignature.js';\nimport { getVariableSignature } from './getVariableSignature.js';\n\nexport interface VariableValues {\n readonly sources: ReadOnlyObjMap<VariableValueSource>;\n readonly coerced: ReadOnlyObjMap<unknown>;\n}\n\ninterface VariableValueSource {\n readonly signature: GraphQLVariableSignature;\n readonly value?: unknown;\n}\n\ntype VariableValuesOrErrors =\n | { variableValues: VariableValues; errors?: never }\n | { errors: ReadonlyArray<GraphQLError>; variableValues?: never };\n\n/**\n * Prepares an object map of variableValues of the correct type based on the\n * provided variable definitions and arbitrary input. If the input cannot be\n * parsed to match the variable definitions, a GraphQLError will be thrown.\n *\n * Note: The `coerced` and `sources` properties of VariableValues use null\n * prototype to avoid collisions with JavaScript's own property names.\n */\nexport function getVariableValues(\n schema: GraphQLSchema,\n varDefNodes: ReadonlyArray<VariableDefinitionNode>,\n inputs: { readonly [variable: string]: unknown },\n options?: { maxErrors?: number; hideSuggestions?: boolean },\n): VariableValuesOrErrors {\n const errors: Array<GraphQLError> = [];\n const maxErrors = options?.maxErrors;\n try {\n const variableValues = coerceVariableValues(\n schema,\n varDefNodes,\n inputs,\n (error) => {\n if (maxErrors != null && errors.length >= maxErrors) {\n throw new GraphQLError(\n 'Too many errors processing variables, error limit reached. Execution aborted.',\n );\n }\n errors.push(error);\n },\n options?.hideSuggestions,\n );\n\n if (errors.length === 0) {\n return { variableValues };\n }\n } catch (error) {\n errors.push(ensureGraphQLError(error));\n }\n\n return { errors };\n}\n\nfunction coerceVariableValues(\n schema: GraphQLSchema,\n varDefNodes: ReadonlyArray<VariableDefinitionNode>,\n inputs: { readonly [variable: string]: unknown },\n onError: (error: GraphQLError) => void,\n hideSuggestions?: Maybe<boolean>,\n): VariableValues {\n const sources: ObjMap<VariableValueSource> = Object.create(null);\n const coerced: ObjMap<unknown> = Object.create(null);\n for (const varDefNode of varDefNodes) {\n const varSignature = getVariableSignature(schema, varDefNode);\n\n if (varSignature instanceof GraphQLError) {\n onError(varSignature);\n continue;\n }\n\n const { name: varName, type: varType } = varSignature;\n const value = Object.hasOwn(inputs, varName) ? inputs[varName] : undefined;\n if (value === undefined) {\n sources[varName] = { signature: varSignature };\n if (varDefNode.defaultValue) {\n maybeUseDefaultValue(\n coerced,\n varName,\n varSignature,\n (error, path) => {\n onError(\n new GraphQLError(\n `Variable \"$${varName}\" has invalid default value${printPathArray(path)}: ${error.message}`,\n { nodes: varDefNode },\n ),\n );\n },\n hideSuggestions,\n );\n continue;\n } else if (!isNonNullType(varType)) {\n // Non-provided values for nullable variables are omitted.\n continue;\n }\n } else {\n sources[varName] = { signature: varSignature, value };\n }\n\n const coercedValue = coerceInputValue(value, varType);\n if (coercedValue !== undefined) {\n coerced[varName] = coercedValue;\n } else {\n validateInputValue(\n value,\n varType,\n (error, path) => {\n onError(\n new GraphQLError(\n `Variable \"$${varName}\" has invalid value${printPathArray(path)}: ${\n error.message\n }`,\n { nodes: varDefNode, originalError: error },\n ),\n );\n },\n hideSuggestions,\n );\n }\n }\n\n return { sources, coerced };\n}\n\nfunction maybeUseDefaultValue(\n coercedValues: ObjMap<unknown>,\n name: string,\n inputValue: GraphQLArgument | GraphQLVariableSignature,\n onError: (error: GraphQLError, path: ReadonlyArray<string | number>) => void,\n hideSuggestions?: Maybe<boolean>,\n): void {\n try {\n // coerceDefaultValue assumes validation has already rejected invalid\n // defaults. If validation was skipped, invalid defaults or nested input\n // field defaults can throw here; recover with validation-style errors below.\n const coercedDefaultValue = coerceDefaultValue(inputValue);\n if (coercedDefaultValue !== undefined) {\n coercedValues[name] = coercedDefaultValue;\n }\n } catch (error) {\n const defaultInput = inputValue.default;\n // Defensive: coerceDefaultValue should only throw while coercing a default.\n /* c8 ignore next 3 */\n if (defaultInput === undefined) {\n throw error;\n }\n\n // Prefer validation's user-facing errors for invalid defaults.\n let reportedValidationError = false;\n validateDefaultInput(\n defaultInput,\n inputValue.type,\n (defaultError, path) => {\n reportedValidationError = true;\n onError(defaultError, path);\n },\n hideSuggestions,\n );\n\n if (!reportedValidationError) {\n // The default itself validated, so coercion failed while applying a nested\n // input field default. Surface the original coercion error.\n onError(ensureGraphQLError(error), []);\n }\n }\n}\n\nexport function getFragmentVariableValues(\n fragmentSpreadNode: FragmentSpreadNode,\n fragmentSignatures: ReadOnlyObjMap<GraphQLVariableSignature>,\n variableValues: VariableValues,\n fragmentVariableValues?: Maybe<FragmentVariableValues>,\n hideSuggestions?: Maybe<boolean>,\n): FragmentVariableValues {\n const argumentNodes = fragmentSpreadNode.arguments ?? [];\n const argNodeMap = new Map(argumentNodes.map((arg) => [arg.name.value, arg]));\n const sources = Object.create(null);\n const coerced = Object.create(null);\n for (const [varName, varSignature] of Object.entries(fragmentSignatures)) {\n sources[varName] = {\n signature: varSignature,\n };\n const argumentNode = argNodeMap.get(varName);\n if (argumentNode !== undefined) {\n const source = sources[varName];\n source.value = argumentNode.value;\n source.fragmentVariableValues = fragmentVariableValues;\n }\n\n coerceArgument(\n coerced,\n fragmentSpreadNode,\n varName,\n varSignature,\n argumentNode,\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n }\n\n return { sources, coerced };\n}\n\n/**\n * Prepares an object map of argument values given a list of argument\n * definitions and list of argument AST nodes.\n *\n * Note: The returned value uses a null prototype to avoid collisions with\n * JavaScript's own property names.\n */\nexport function getArgumentValues(\n def: GraphQLField<unknown, unknown> | GraphQLDirective,\n node: FieldNode | DirectiveNode,\n variableValues?: Maybe<VariableValues>,\n fragmentVariableValues?: Maybe<FragmentVariableValues>,\n hideSuggestions?: Maybe<boolean>,\n): ObjMap<unknown> {\n const coercedValues: ObjMap<unknown> = Object.create(null);\n\n const argumentNodes = node.arguments ?? [];\n const argNodeMap = new Map(argumentNodes.map((arg) => [arg.name.value, arg]));\n\n for (const argDef of def.args) {\n const name = argDef.name;\n coerceArgument(\n coercedValues,\n node,\n name,\n argDef,\n argNodeMap.get(argDef.name),\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n }\n return coercedValues;\n}\n\n// eslint-disable-next-line max-params\nfunction coerceArgument(\n coercedValues: ObjMap<unknown>,\n node: FieldNode | DirectiveNode | FragmentSpreadNode,\n argName: string,\n argDef: GraphQLArgument | GraphQLVariableSignature,\n argumentNode: ArgumentNode | FragmentArgumentNode | undefined,\n variableValues: Maybe<VariableValues>,\n fragmentVariableValues: Maybe<FragmentVariableValues>,\n hideSuggestions?: Maybe<boolean>,\n): void {\n const argType = argDef.type;\n const onArgDefaultValueError = (\n error: GraphQLError,\n path: ReadonlyArray<string | number>,\n ): never => {\n throw new GraphQLError(\n `${printArgumentOrFragmentVariable(argDef, node)} has invalid default value${printPathArray(path)}: ${error.message}`,\n { nodes: node },\n );\n };\n\n if (!argumentNode) {\n if (isRequiredArgument(argDef)) {\n // Note: ProvidedRequiredArgumentsRule validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n throw new GraphQLError(\n // TODO: clean up the naming of isRequiredArgument(), isArgument(), and argDef if/when experimental fragment variables are merged\n `${printArgumentOrFragmentVariable(argDef, node)} of required type \"${argType}\" was not provided.`,\n { nodes: node },\n );\n }\n maybeUseDefaultValue(\n coercedValues,\n argName,\n argDef,\n onArgDefaultValueError,\n hideSuggestions,\n );\n return;\n }\n\n const valueNode = argumentNode.value;\n\n // Variables without a value are treated as if no argument was provided if\n // the argument is not required.\n if (valueNode.kind === Kind.VARIABLE) {\n const variableName = valueNode.name.value;\n const scopedVariableValues = fragmentVariableValues?.sources[variableName]\n ? fragmentVariableValues\n : variableValues;\n if (\n (scopedVariableValues == null ||\n !Object.hasOwn(scopedVariableValues.coerced, variableName)) &&\n !isRequiredArgument(argDef)\n ) {\n maybeUseDefaultValue(\n coercedValues,\n argName,\n argDef,\n onArgDefaultValueError,\n hideSuggestions,\n );\n return;\n }\n }\n const coercedValue = coerceInputLiteral(\n valueNode,\n argType,\n variableValues,\n fragmentVariableValues,\n );\n if (coercedValue === undefined) {\n // Note: ValuesOfCorrectTypeRule validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n validateInputLiteral(\n valueNode,\n argType,\n (error, path) => {\n // TODO: clean up the naming of isRequiredArgument(), isArgument(), and argDef if/when experimental fragment variables are merged\n error.message = `${printArgumentOrFragmentVariable(argDef, node)} has invalid value${printPathArray(\n path,\n )}: ${error.message}`;\n throw error;\n },\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n /* c8 ignore next */\n invariant(false, 'Invalid argument');\n }\n coercedValues[argName] = coercedValue;\n}\n\n// TODO: clean up the naming of isRequiredArgument(), isArgument(), and argDef if/when experimental fragment variables are merged\nfunction printArgumentOrFragmentVariable(\n argDef: GraphQLArgument | GraphQLVariableSignature,\n node: FieldNode | DirectiveNode | FragmentSpreadNode,\n): string {\n return isArgument(argDef)\n ? `Argument \"${argDef}\"`\n : `Variable \"$${argDef.name}\" defined by fragment \"${node.name.value}\"`;\n}\n\n/**\n * Prepares an object map of argument values given a directive definition\n * and a AST node which may contain directives. Optionally also accepts a map\n * of variable values.\n *\n * If the directive does not exist on the node, returns undefined.\n *\n * Note: The returned value uses a null prototype to avoid collisions with\n * JavaScript's own property names.\n */\nexport function getDirectiveValues(\n directiveDef: GraphQLDirective,\n node: { readonly directives?: ReadonlyArray<DirectiveNode> | undefined },\n variableValues?: Maybe<VariableValues>,\n fragmentVariableValues?: Maybe<FragmentVariableValues>,\n hideSuggestions?: Maybe<boolean>,\n): undefined | ObjMap<unknown> {\n const directiveNode = node.directives?.find(\n (directive) => directive.name.value === directiveDef.name,\n );\n\n if (directiveNode) {\n return getArgumentValues(\n directiveDef,\n directiveNode,\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n }\n}\n"]}
|
package/execution/values.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { invariant } from "../jsutils/invariant.mjs";
|
|
2
2
|
import { printPathArray } from "../jsutils/printPathArray.mjs";
|
|
3
|
+
import { ensureGraphQLError } from "../error/ensureGraphQLError.mjs";
|
|
3
4
|
import { GraphQLError } from "../error/GraphQLError.mjs";
|
|
4
5
|
import { Kind } from "../language/kinds.mjs";
|
|
5
6
|
import { isArgument, isNonNullType, isRequiredArgument, } from "../type/definition.mjs";
|
|
7
|
+
import { validateDefaultInput } from "../type/validate.mjs";
|
|
6
8
|
import { coerceDefaultValue, coerceInputLiteral, coerceInputValue, } from "../utilities/coerceInputValue.mjs";
|
|
7
9
|
import { validateInputLiteral, validateInputValue, } from "../utilities/validateInputValue.mjs";
|
|
8
10
|
import { getVariableSignature } from "./getVariableSignature.mjs";
|
|
@@ -11,9 +13,8 @@ import { getVariableSignature } from "./getVariableSignature.mjs";
|
|
|
11
13
|
* provided variable definitions and arbitrary input. If the input cannot be
|
|
12
14
|
* parsed to match the variable definitions, a GraphQLError will be thrown.
|
|
13
15
|
*
|
|
14
|
-
* Note: The
|
|
15
|
-
*
|
|
16
|
-
* Object prototype.
|
|
16
|
+
* Note: The `coerced` and `sources` properties of VariableValues use null
|
|
17
|
+
* prototype to avoid collisions with JavaScript's own property names.
|
|
17
18
|
*/
|
|
18
19
|
export function getVariableValues(schema, varDefNodes, inputs, options) {
|
|
19
20
|
const errors = [];
|
|
@@ -30,7 +31,7 @@ export function getVariableValues(schema, varDefNodes, inputs, options) {
|
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
catch (error) {
|
|
33
|
-
errors.push(error);
|
|
34
|
+
errors.push(ensureGraphQLError(error));
|
|
34
35
|
}
|
|
35
36
|
return { errors };
|
|
36
37
|
}
|
|
@@ -44,11 +45,13 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError, hideSuggesti
|
|
|
44
45
|
continue;
|
|
45
46
|
}
|
|
46
47
|
const { name: varName, type: varType } = varSignature;
|
|
47
|
-
|
|
48
|
-
if (
|
|
48
|
+
const value = Object.hasOwn(inputs, varName) ? inputs[varName] : undefined;
|
|
49
|
+
if (value === undefined) {
|
|
49
50
|
sources[varName] = { signature: varSignature };
|
|
50
51
|
if (varDefNode.defaultValue) {
|
|
51
|
-
coerced
|
|
52
|
+
maybeUseDefaultValue(coerced, varName, varSignature, (error, path) => {
|
|
53
|
+
onError(new GraphQLError(`Variable "$${varName}" has invalid default value${printPathArray(path)}: ${error.message}`, { nodes: varDefNode }));
|
|
54
|
+
}, hideSuggestions);
|
|
52
55
|
continue;
|
|
53
56
|
}
|
|
54
57
|
else if (!isNonNullType(varType)) {
|
|
@@ -57,7 +60,6 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError, hideSuggesti
|
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
62
|
else {
|
|
60
|
-
value = inputs[varName];
|
|
61
63
|
sources[varName] = { signature: varSignature, value };
|
|
62
64
|
}
|
|
63
65
|
const coercedValue = coerceInputValue(value, varType);
|
|
@@ -72,88 +74,125 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError, hideSuggesti
|
|
|
72
74
|
}
|
|
73
75
|
return { sources, coerced };
|
|
74
76
|
}
|
|
77
|
+
function maybeUseDefaultValue(coercedValues, name, inputValue, onError, hideSuggestions) {
|
|
78
|
+
try {
|
|
79
|
+
// coerceDefaultValue assumes validation has already rejected invalid
|
|
80
|
+
// defaults. If validation was skipped, invalid defaults or nested input
|
|
81
|
+
// field defaults can throw here; recover with validation-style errors below.
|
|
82
|
+
const coercedDefaultValue = coerceDefaultValue(inputValue);
|
|
83
|
+
if (coercedDefaultValue !== undefined) {
|
|
84
|
+
coercedValues[name] = coercedDefaultValue;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
const defaultInput = inputValue.default;
|
|
89
|
+
// Defensive: coerceDefaultValue should only throw while coercing a default.
|
|
90
|
+
/* c8 ignore next 3 */
|
|
91
|
+
if (defaultInput === undefined) {
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
94
|
+
// Prefer validation's user-facing errors for invalid defaults.
|
|
95
|
+
let reportedValidationError = false;
|
|
96
|
+
validateDefaultInput(defaultInput, inputValue.type, (defaultError, path) => {
|
|
97
|
+
reportedValidationError = true;
|
|
98
|
+
onError(defaultError, path);
|
|
99
|
+
}, hideSuggestions);
|
|
100
|
+
if (!reportedValidationError) {
|
|
101
|
+
// The default itself validated, so coercion failed while applying a nested
|
|
102
|
+
// input field default. Surface the original coercion error.
|
|
103
|
+
onError(ensureGraphQLError(error), []);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
75
107
|
export function getFragmentVariableValues(fragmentSpreadNode, fragmentSignatures, variableValues, fragmentVariableValues, hideSuggestions) {
|
|
76
|
-
const
|
|
108
|
+
const argumentNodes = fragmentSpreadNode.arguments ?? [];
|
|
109
|
+
const argNodeMap = new Map(argumentNodes.map((arg) => [arg.name.value, arg]));
|
|
77
110
|
const sources = Object.create(null);
|
|
111
|
+
const coerced = Object.create(null);
|
|
78
112
|
for (const [varName, varSignature] of Object.entries(fragmentSignatures)) {
|
|
79
|
-
varSignatures.push(varSignature);
|
|
80
113
|
sources[varName] = {
|
|
81
114
|
signature: varSignature,
|
|
82
|
-
value: fragmentVariableValues?.sources[varName]?.value ??
|
|
83
|
-
variableValues.sources[varName]?.value,
|
|
84
115
|
};
|
|
116
|
+
const argumentNode = argNodeMap.get(varName);
|
|
117
|
+
if (argumentNode !== undefined) {
|
|
118
|
+
const source = sources[varName];
|
|
119
|
+
source.value = argumentNode.value;
|
|
120
|
+
source.fragmentVariableValues = fragmentVariableValues;
|
|
121
|
+
}
|
|
122
|
+
coerceArgument(coerced, fragmentSpreadNode, varName, varSignature, argumentNode, variableValues, fragmentVariableValues, hideSuggestions);
|
|
85
123
|
}
|
|
86
|
-
const coerced = experimentalGetArgumentValues(fragmentSpreadNode, varSignatures, variableValues, fragmentVariableValues, hideSuggestions);
|
|
87
124
|
return { sources, coerced };
|
|
88
125
|
}
|
|
89
126
|
/**
|
|
90
127
|
* Prepares an object map of argument values given a list of argument
|
|
91
128
|
* definitions and list of argument AST nodes.
|
|
92
129
|
*
|
|
93
|
-
* Note: The returned value
|
|
94
|
-
*
|
|
95
|
-
* Object prototype.
|
|
130
|
+
* Note: The returned value uses a null prototype to avoid collisions with
|
|
131
|
+
* JavaScript's own property names.
|
|
96
132
|
*/
|
|
97
|
-
export function getArgumentValues(def, node, variableValues, hideSuggestions) {
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
export function experimentalGetArgumentValues(node, argDefs, variableValues, fragmentVariableValues, hideSuggestions) {
|
|
101
|
-
const coercedValues = {};
|
|
133
|
+
export function getArgumentValues(def, node, variableValues, fragmentVariableValues, hideSuggestions) {
|
|
134
|
+
const coercedValues = Object.create(null);
|
|
102
135
|
const argumentNodes = node.arguments ?? [];
|
|
103
136
|
const argNodeMap = new Map(argumentNodes.map((arg) => [arg.name.value, arg]));
|
|
104
|
-
for (const argDef of
|
|
137
|
+
for (const argDef of def.args) {
|
|
105
138
|
const name = argDef.name;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
coercedValues[name] = coercedDefaultValue;
|
|
120
|
-
}
|
|
121
|
-
continue;
|
|
122
|
-
}
|
|
123
|
-
const valueNode = argumentNode.value;
|
|
124
|
-
// Variables without a value are treated as if no argument was provided if
|
|
125
|
-
// the argument is not required.
|
|
126
|
-
if (valueNode.kind === Kind.VARIABLE) {
|
|
127
|
-
const variableName = valueNode.name.value;
|
|
128
|
-
const scopedVariableValues = fragmentVariableValues?.sources[variableName]
|
|
129
|
-
? fragmentVariableValues
|
|
130
|
-
: variableValues;
|
|
131
|
-
if ((scopedVariableValues == null ||
|
|
132
|
-
!Object.hasOwn(scopedVariableValues.coerced, variableName)) &&
|
|
133
|
-
!isRequiredArgument(argDef)) {
|
|
134
|
-
const coercedDefaultValue = coerceDefaultValue(argDef);
|
|
135
|
-
if (coercedDefaultValue !== undefined) {
|
|
136
|
-
coercedValues[name] = coercedDefaultValue;
|
|
137
|
-
}
|
|
138
|
-
continue;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
const coercedValue = coerceInputLiteral(valueNode, argType, variableValues, fragmentVariableValues);
|
|
142
|
-
if (coercedValue === undefined) {
|
|
143
|
-
// Note: ValuesOfCorrectTypeRule validation should catch this before
|
|
139
|
+
coerceArgument(coercedValues, node, name, argDef, argNodeMap.get(argDef.name), variableValues, fragmentVariableValues, hideSuggestions);
|
|
140
|
+
}
|
|
141
|
+
return coercedValues;
|
|
142
|
+
}
|
|
143
|
+
// eslint-disable-next-line max-params
|
|
144
|
+
function coerceArgument(coercedValues, node, argName, argDef, argumentNode, variableValues, fragmentVariableValues, hideSuggestions) {
|
|
145
|
+
const argType = argDef.type;
|
|
146
|
+
const onArgDefaultValueError = (error, path) => {
|
|
147
|
+
throw new GraphQLError(`${printArgumentOrFragmentVariable(argDef, node)} has invalid default value${printPathArray(path)}: ${error.message}`, { nodes: node });
|
|
148
|
+
};
|
|
149
|
+
if (!argumentNode) {
|
|
150
|
+
if (isRequiredArgument(argDef)) {
|
|
151
|
+
// Note: ProvidedRequiredArgumentsRule validation should catch this before
|
|
144
152
|
// execution. This is a runtime check to ensure execution does not
|
|
145
153
|
// continue with an invalid argument value.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
throw error;
|
|
150
|
-
}, variableValues, fragmentVariableValues, hideSuggestions);
|
|
151
|
-
/* c8 ignore next */
|
|
152
|
-
(false) || invariant(false, 'Invalid argument');
|
|
154
|
+
throw new GraphQLError(
|
|
155
|
+
// TODO: clean up the naming of isRequiredArgument(), isArgument(), and argDef if/when experimental fragment variables are merged
|
|
156
|
+
`${printArgumentOrFragmentVariable(argDef, node)} of required type "${argType}" was not provided.`, { nodes: node });
|
|
153
157
|
}
|
|
154
|
-
coercedValues
|
|
158
|
+
maybeUseDefaultValue(coercedValues, argName, argDef, onArgDefaultValueError, hideSuggestions);
|
|
159
|
+
return;
|
|
155
160
|
}
|
|
156
|
-
|
|
161
|
+
const valueNode = argumentNode.value;
|
|
162
|
+
// Variables without a value are treated as if no argument was provided if
|
|
163
|
+
// the argument is not required.
|
|
164
|
+
if (valueNode.kind === Kind.VARIABLE) {
|
|
165
|
+
const variableName = valueNode.name.value;
|
|
166
|
+
const scopedVariableValues = fragmentVariableValues?.sources[variableName]
|
|
167
|
+
? fragmentVariableValues
|
|
168
|
+
: variableValues;
|
|
169
|
+
if ((scopedVariableValues == null ||
|
|
170
|
+
!Object.hasOwn(scopedVariableValues.coerced, variableName)) &&
|
|
171
|
+
!isRequiredArgument(argDef)) {
|
|
172
|
+
maybeUseDefaultValue(coercedValues, argName, argDef, onArgDefaultValueError, hideSuggestions);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
const coercedValue = coerceInputLiteral(valueNode, argType, variableValues, fragmentVariableValues);
|
|
177
|
+
if (coercedValue === undefined) {
|
|
178
|
+
// Note: ValuesOfCorrectTypeRule validation should catch this before
|
|
179
|
+
// execution. This is a runtime check to ensure execution does not
|
|
180
|
+
// continue with an invalid argument value.
|
|
181
|
+
validateInputLiteral(valueNode, argType, (error, path) => {
|
|
182
|
+
// TODO: clean up the naming of isRequiredArgument(), isArgument(), and argDef if/when experimental fragment variables are merged
|
|
183
|
+
error.message = `${printArgumentOrFragmentVariable(argDef, node)} has invalid value${printPathArray(path)}: ${error.message}`;
|
|
184
|
+
throw error;
|
|
185
|
+
}, variableValues, fragmentVariableValues, hideSuggestions);
|
|
186
|
+
/* c8 ignore next */
|
|
187
|
+
invariant(false, 'Invalid argument');
|
|
188
|
+
}
|
|
189
|
+
coercedValues[argName] = coercedValue;
|
|
190
|
+
}
|
|
191
|
+
// TODO: clean up the naming of isRequiredArgument(), isArgument(), and argDef if/when experimental fragment variables are merged
|
|
192
|
+
function printArgumentOrFragmentVariable(argDef, node) {
|
|
193
|
+
return isArgument(argDef)
|
|
194
|
+
? `Argument "${argDef}"`
|
|
195
|
+
: `Variable "$${argDef.name}" defined by fragment "${node.name.value}"`;
|
|
157
196
|
}
|
|
158
197
|
/**
|
|
159
198
|
* Prepares an object map of argument values given a directive definition
|
|
@@ -162,14 +201,13 @@ export function experimentalGetArgumentValues(node, argDefs, variableValues, fra
|
|
|
162
201
|
*
|
|
163
202
|
* If the directive does not exist on the node, returns undefined.
|
|
164
203
|
*
|
|
165
|
-
* Note: The returned value
|
|
166
|
-
*
|
|
167
|
-
* Object prototype.
|
|
204
|
+
* Note: The returned value uses a null prototype to avoid collisions with
|
|
205
|
+
* JavaScript's own property names.
|
|
168
206
|
*/
|
|
169
207
|
export function getDirectiveValues(directiveDef, node, variableValues, fragmentVariableValues, hideSuggestions) {
|
|
170
208
|
const directiveNode = node.directives?.find((directive) => directive.name.value === directiveDef.name);
|
|
171
209
|
if (directiveNode) {
|
|
172
|
-
return
|
|
210
|
+
return getArgumentValues(directiveDef, directiveNode, variableValues, fragmentVariableValues, hideSuggestions);
|
|
173
211
|
}
|
|
174
212
|
}
|
|
175
213
|
//# sourceMappingURL=values.js.map
|