@zuplo/cli 7.14.0 → 7.14.3
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/node_modules/@posthog/types/dist/posthog-config.d.ts +16 -0
- package/node_modules/@posthog/types/dist/posthog-config.d.ts.map +1 -1
- package/node_modules/@posthog/types/package.json +1 -1
- package/node_modules/@posthog/types/src/posthog-config.ts +16 -0
- package/node_modules/@zuplo/core/customer.cli.minified.js +252 -252
- package/node_modules/@zuplo/core/index.minified.js +257 -257
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-7RNZS3GX.js +26 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-7RNZS3GX.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-ADPB2ZMZ.js +414 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-ADPB2ZMZ.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-AENEWA54.js +26 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-AENEWA54.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-C32OTSKW.js +91 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-C32OTSKW.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-UFTMOJ7K.js +37 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-UFTMOJ7K.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp/messages/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +12 -12
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mocks/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/sdks/aws/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/sdks/aws/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +120 -0
- package/node_modules/@zuplo/runtime/out/types/internal/index.d.ts +64 -0
- package/node_modules/@zuplo/runtime/out/types/mcp/messages/index.d.ts +78 -0
- package/node_modules/@zuplo/runtime/out/types/mcp-gateway/index.d.ts +3 -2
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/graphql/error/GraphQLError.d.ts +5 -1
- package/node_modules/graphql/error/GraphQLError.js +12 -7
- package/node_modules/graphql/error/GraphQLError.mjs +13 -6
- package/node_modules/graphql/error/locatedError.d.ts +6 -4
- package/node_modules/graphql/error/locatedError.js +6 -4
- package/node_modules/graphql/error/locatedError.mjs +6 -4
- package/node_modules/graphql/execution/collectFields.d.ts +1 -0
- package/node_modules/graphql/execution/collectFields.js +9 -0
- package/node_modules/graphql/execution/collectFields.mjs +9 -0
- package/node_modules/graphql/execution/execute.d.ts +9 -10
- package/node_modules/graphql/execution/execute.js +44 -29
- package/node_modules/graphql/execution/execute.mjs +44 -29
- package/node_modules/graphql/execution/mapAsyncIterator.js +12 -11
- package/node_modules/graphql/execution/mapAsyncIterator.mjs +12 -11
- package/node_modules/graphql/execution/subscribe.d.ts +5 -2
- package/node_modules/graphql/execution/subscribe.js +5 -2
- package/node_modules/graphql/execution/subscribe.mjs +5 -2
- package/node_modules/graphql/execution/values.d.ts +43 -21
- package/node_modules/graphql/execution/values.js +52 -24
- package/node_modules/graphql/execution/values.mjs +51 -23
- package/node_modules/graphql/graphql.d.ts +8 -14
- package/node_modules/graphql/graphql.js +16 -15
- package/node_modules/graphql/graphql.mjs +11 -15
- package/node_modules/graphql/jsutils/SetMap.d.ts +14 -0
- package/node_modules/graphql/jsutils/SetMap.js +48 -0
- package/node_modules/graphql/jsutils/SetMap.mjs +39 -0
- package/node_modules/graphql/jsutils/isIterableObject.d.ts +2 -0
- package/node_modules/graphql/jsutils/isIterableObject.js +2 -0
- package/node_modules/graphql/jsutils/isIterableObject.mjs +2 -0
- package/node_modules/graphql/jsutils/keyMap.d.ts +2 -0
- package/node_modules/graphql/jsutils/keyMap.js +2 -0
- package/node_modules/graphql/jsutils/keyMap.mjs +2 -0
- package/node_modules/graphql/jsutils/keyValMap.d.ts +3 -3
- package/node_modules/graphql/jsutils/keyValMap.js +3 -3
- package/node_modules/graphql/jsutils/keyValMap.mjs +3 -3
- package/node_modules/graphql/language/ast.d.ts +2 -6
- package/node_modules/graphql/language/ast.js +2 -6
- package/node_modules/graphql/language/ast.mjs +2 -6
- package/node_modules/graphql/language/lexer.d.ts +6 -0
- package/node_modules/graphql/language/lexer.js +22 -0
- package/node_modules/graphql/language/lexer.mjs +22 -0
- package/node_modules/graphql/language/location.d.ts +8 -3
- package/node_modules/graphql/language/location.js +57 -17
- package/node_modules/graphql/language/location.mjs +56 -16
- package/node_modules/graphql/language/parser.d.ts +27 -13
- package/node_modules/graphql/language/parser.js +31 -9
- package/node_modules/graphql/language/parser.mjs +31 -9
- package/node_modules/graphql/language/predicates.d.ts +10 -3
- package/node_modules/graphql/language/predicates.js +10 -3
- package/node_modules/graphql/language/predicates.mjs +10 -3
- package/node_modules/graphql/language/printLocation.d.ts +2 -6
- package/node_modules/graphql/language/printLocation.js +2 -6
- package/node_modules/graphql/language/printLocation.mjs +2 -6
- package/node_modules/graphql/language/printer.d.ts +22 -3
- package/node_modules/graphql/language/printer.js +394 -308
- package/node_modules/graphql/language/printer.mjs +394 -308
- package/node_modules/graphql/language/reducer.d.ts +32 -0
- package/node_modules/graphql/language/reducer.js +95 -0
- package/node_modules/graphql/language/reducer.mjs +86 -0
- package/node_modules/graphql/language/source.d.ts +4 -5
- package/node_modules/graphql/language/source.js +4 -5
- package/node_modules/graphql/language/source.mjs +4 -5
- package/node_modules/graphql/language/visitor.d.ts +16 -10
- package/node_modules/graphql/language/visitor.js +15 -7
- package/node_modules/graphql/language/visitor.mjs +15 -7
- package/node_modules/graphql/package.json +1 -4
- package/node_modules/graphql/type/definition.d.ts +170 -102
- package/node_modules/graphql/type/definition.js +169 -96
- package/node_modules/graphql/type/definition.mjs +168 -95
- package/node_modules/graphql/type/directives.d.ts +12 -6
- package/node_modules/graphql/type/directives.js +12 -6
- package/node_modules/graphql/type/directives.mjs +12 -6
- package/node_modules/graphql/type/scalars.js +8 -11
- package/node_modules/graphql/type/scalars.mjs +1 -1
- package/node_modules/graphql/type/schema.d.ts +36 -11
- package/node_modules/graphql/type/schema.js +35 -10
- package/node_modules/graphql/type/schema.mjs +35 -10
- package/node_modules/graphql/type/validate.d.ts +1 -3
- package/node_modules/graphql/type/validate.js +1 -3
- package/node_modules/graphql/type/validate.mjs +1 -3
- package/node_modules/graphql/utilities/TypeInfo.d.ts +15 -11
- package/node_modules/graphql/utilities/TypeInfo.js +15 -11
- package/node_modules/graphql/utilities/TypeInfo.mjs +15 -11
- package/node_modules/graphql/utilities/assertValidName.d.ts +1 -1
- package/node_modules/graphql/utilities/assertValidName.js +1 -1
- package/node_modules/graphql/utilities/assertValidName.mjs +1 -1
- package/node_modules/graphql/utilities/astFromValue.d.ts +3 -1
- package/node_modules/graphql/utilities/astFromValue.js +3 -1
- package/node_modules/graphql/utilities/astFromValue.mjs +3 -1
- package/node_modules/graphql/utilities/buildASTSchema.d.ts +8 -8
- package/node_modules/graphql/utilities/buildASTSchema.js +9 -20
- package/node_modules/graphql/utilities/buildASTSchema.mjs +9 -20
- package/node_modules/graphql/utilities/buildClientSchema.d.ts +6 -2
- package/node_modules/graphql/utilities/buildClientSchema.js +6 -2
- package/node_modules/graphql/utilities/buildClientSchema.mjs +6 -2
- package/node_modules/graphql/utilities/coerceInputValue.d.ts +9 -3
- package/node_modules/graphql/utilities/coerceInputValue.js +60 -13
- package/node_modules/graphql/utilities/coerceInputValue.mjs +58 -13
- package/node_modules/graphql/utilities/concatAST.d.ts +4 -1
- package/node_modules/graphql/utilities/concatAST.js +4 -1
- package/node_modules/graphql/utilities/concatAST.mjs +4 -1
- package/node_modules/graphql/utilities/extendSchema.d.ts +7 -4
- package/node_modules/graphql/utilities/extendSchema.js +7 -4
- package/node_modules/graphql/utilities/extendSchema.mjs +7 -4
- package/node_modules/graphql/utilities/findBreakingChanges.d.ts +2 -2
- package/node_modules/graphql/utilities/findBreakingChanges.js +2 -2
- package/node_modules/graphql/utilities/findBreakingChanges.mjs +2 -2
- package/node_modules/graphql/utilities/getIntrospectionQuery.d.ts +9 -9
- package/node_modules/graphql/utilities/getIntrospectionQuery.js +8 -8
- package/node_modules/graphql/utilities/getIntrospectionQuery.mjs +8 -8
- package/node_modules/graphql/utilities/getOperationAST.d.ts +2 -2
- package/node_modules/graphql/utilities/getOperationAST.js +2 -2
- package/node_modules/graphql/utilities/getOperationAST.mjs +2 -2
- package/node_modules/graphql/utilities/getOperationRootType.d.ts +3 -1
- package/node_modules/graphql/utilities/getOperationRootType.js +3 -1
- package/node_modules/graphql/utilities/getOperationRootType.mjs +3 -1
- package/node_modules/graphql/utilities/introspectionFromSchema.d.ts +12 -4
- package/node_modules/graphql/utilities/introspectionFromSchema.js +12 -4
- package/node_modules/graphql/utilities/introspectionFromSchema.mjs +12 -4
- package/node_modules/graphql/utilities/lexicographicSortSchema.d.ts +17 -13
- package/node_modules/graphql/utilities/lexicographicSortSchema.js +17 -13
- package/node_modules/graphql/utilities/lexicographicSortSchema.mjs +17 -13
- package/node_modules/graphql/utilities/printSchema.d.ts +7 -4
- package/node_modules/graphql/utilities/printSchema.js +7 -4
- package/node_modules/graphql/utilities/printSchema.mjs +7 -4
- package/node_modules/graphql/utilities/resolveSchemaCoordinate.d.ts +9 -8
- package/node_modules/graphql/utilities/resolveSchemaCoordinate.js +9 -8
- package/node_modules/graphql/utilities/resolveSchemaCoordinate.mjs +9 -8
- package/node_modules/graphql/utilities/separateOperations.d.ts +2 -2
- package/node_modules/graphql/utilities/separateOperations.js +2 -2
- package/node_modules/graphql/utilities/separateOperations.mjs +2 -2
- package/node_modules/graphql/utilities/stripIgnoredCharacters.d.ts +19 -5
- package/node_modules/graphql/utilities/stripIgnoredCharacters.js +19 -5
- package/node_modules/graphql/utilities/stripIgnoredCharacters.mjs +19 -5
- package/node_modules/graphql/utilities/typeComparators.d.ts +1 -5
- package/node_modules/graphql/utilities/typeComparators.js +1 -5
- package/node_modules/graphql/utilities/typeComparators.mjs +1 -5
- package/node_modules/graphql/utilities/valueFromAST.js +4 -4
- package/node_modules/graphql/utilities/valueFromAST.mjs +4 -4
- package/node_modules/graphql/utilities/valueFromASTUntyped.d.ts +1 -3
- package/node_modules/graphql/utilities/valueFromASTUntyped.js +1 -3
- package/node_modules/graphql/utilities/valueFromASTUntyped.mjs +1 -3
- package/node_modules/graphql/validation/ValidationContext.d.ts +22 -3
- package/node_modules/graphql/validation/ValidationContext.js +84 -27
- package/node_modules/graphql/validation/ValidationContext.mjs +82 -27
- package/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js +6 -4
- package/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs +6 -4
- package/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js +10 -6
- package/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs +12 -6
- package/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js +6 -4
- package/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs +6 -4
- package/node_modules/graphql/validation/rules/KnownArgumentNamesRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js +26 -17
- package/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs +21 -11
- package/node_modules/graphql/validation/rules/KnownDirectivesRule.d.ts +1 -3
- package/node_modules/graphql/validation/rules/KnownDirectivesRule.js +1 -3
- package/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs +1 -3
- package/node_modules/graphql/validation/rules/KnownFragmentNamesRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js +4 -4
- package/node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs +4 -4
- package/node_modules/graphql/validation/rules/KnownTypeNamesRule.d.ts +1 -3
- package/node_modules/graphql/validation/rules/KnownTypeNamesRule.js +7 -7
- package/node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs +7 -7
- package/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js +6 -4
- package/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs +6 -4
- package/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.js +44 -19
- package/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs +44 -19
- package/node_modules/graphql/validation/rules/NoFragmentCyclesRule.d.ts +1 -3
- package/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js +1 -3
- package/node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs +1 -3
- package/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js +4 -4
- package/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs +4 -4
- package/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js +10 -14
- package/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs +10 -14
- package/node_modules/graphql/validation/rules/NoUnusedVariablesRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js +4 -4
- package/node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs +4 -4
- package/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts +8 -6
- package/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js +552 -354
- package/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +545 -352
- package/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js +6 -4
- package/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs +6 -4
- package/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js +6 -4
- package/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs +6 -4
- package/node_modules/graphql/validation/rules/ScalarLeafsRule.d.ts +1 -3
- package/node_modules/graphql/validation/rules/ScalarLeafsRule.js +1 -3
- package/node_modules/graphql/validation/rules/ScalarLeafsRule.mjs +1 -3
- package/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js +50 -9
- package/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs +50 -9
- package/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js +4 -4
- package/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs +4 -4
- package/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js +6 -4
- package/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs +6 -4
- package/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js +4 -4
- package/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs +4 -4
- package/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js +6 -4
- package/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs +6 -4
- package/node_modules/graphql/validation/rules/UniqueOperationNamesRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js +4 -4
- package/node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs +4 -4
- package/node_modules/graphql/validation/rules/UniqueVariableNamesRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js +4 -4
- package/node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs +4 -4
- package/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js +29 -23
- package/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs +24 -14
- package/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js +6 -4
- package/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs +6 -4
- package/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js +6 -4
- package/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs +6 -4
- package/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js +4 -4
- package/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs +4 -4
- package/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts +7 -5
- package/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js +7 -5
- package/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs +7 -5
- package/node_modules/graphql/validation/validate.d.ts +2 -0
- package/node_modules/graphql/validation/validate.js +14 -2
- package/node_modules/graphql/validation/validate.mjs +13 -2
- package/node_modules/graphql/validation/validationAbortedError.d.ts +3 -0
- package/node_modules/graphql/validation/validationAbortedError.js +14 -0
- package/node_modules/graphql/validation/validationAbortedError.mjs +4 -0
- package/node_modules/graphql/version.js +3 -3
- package/node_modules/graphql/version.mjs +3 -3
- package/package.json +11 -11
- package/node_modules/@zuplo/runtime/out/esm/chunk-4SVXBKXH.js +0 -414
- package/node_modules/@zuplo/runtime/out/esm/chunk-4SVXBKXH.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-7FFIW3HF.js +0 -26
- package/node_modules/@zuplo/runtime/out/esm/chunk-7FFIW3HF.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-QGAJTUPE.js +0 -26
- package/node_modules/@zuplo/runtime/out/esm/chunk-QGAJTUPE.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-WUZE2HKB.js +0 -102
- package/node_modules/@zuplo/runtime/out/esm/chunk-WUZE2HKB.js.map +0 -1
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-4SVXBKXH.js.LEGAL.txt → chunk-ADPB2ZMZ.js.LEGAL.txt} +0 -0
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-WUZE2HKB.js.LEGAL.txt → chunk-UFTMOJ7K.js.LEGAL.txt} +0 -0
|
@@ -44,8 +44,9 @@ var _valueFromAST = require('../utilities/valueFromAST.js');
|
|
|
44
44
|
* @returns Coerced variable values, or request errors.
|
|
45
45
|
* @example
|
|
46
46
|
* ```ts
|
|
47
|
+
* import assert from 'node:assert/strict';
|
|
47
48
|
* // Coerce provided variables and apply operation defaults.
|
|
48
|
-
* import { parse } from 'graphql/language';
|
|
49
|
+
* import { parse, Kind } from 'graphql/language';
|
|
49
50
|
* import { buildSchema } from 'graphql/utilities';
|
|
50
51
|
* import { getVariableValues } from 'graphql/execution';
|
|
51
52
|
*
|
|
@@ -60,19 +61,19 @@ var _valueFromAST = require('../utilities/valueFromAST.js');
|
|
|
60
61
|
* }
|
|
61
62
|
* `);
|
|
62
63
|
* const operation = document.definitions[0];
|
|
64
|
+
* assert(operation.kind === Kind.OPERATION_DEFINITION);
|
|
63
65
|
*
|
|
64
|
-
* const result = getVariableValues(
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* { stars: '5' },
|
|
68
|
-
* );
|
|
66
|
+
* const result = getVariableValues(schema, operation.variableDefinitions ?? [], {
|
|
67
|
+
* stars: 5,
|
|
68
|
+
* });
|
|
69
69
|
*
|
|
70
70
|
* result; // => { coerced: { stars: 5, limit: 10 } }
|
|
71
71
|
* ```
|
|
72
72
|
* @example
|
|
73
73
|
* ```ts
|
|
74
|
+
* import assert from 'node:assert/strict';
|
|
74
75
|
* // This variant uses maxErrors to cap reported coercion errors.
|
|
75
|
-
* import { parse } from 'graphql/language';
|
|
76
|
+
* import { parse, Kind } from 'graphql/language';
|
|
76
77
|
* import { buildSchema } from 'graphql/utilities';
|
|
77
78
|
* import { getVariableValues } from 'graphql/execution';
|
|
78
79
|
*
|
|
@@ -92,16 +93,17 @@ var _valueFromAST = require('../utilities/valueFromAST.js');
|
|
|
92
93
|
* }
|
|
93
94
|
* `);
|
|
94
95
|
* const operation = document.definitions[0];
|
|
96
|
+
* assert(operation.kind === Kind.OPERATION_DEFINITION);
|
|
95
97
|
*
|
|
96
98
|
* const result = getVariableValues(
|
|
97
99
|
* schema,
|
|
98
|
-
* operation.variableDefinitions,
|
|
100
|
+
* operation.variableDefinitions ?? [],
|
|
99
101
|
* { first: { stars: 'bad' }, second: { stars: 'also bad' } },
|
|
100
102
|
* { maxErrors: 1 },
|
|
101
103
|
* );
|
|
102
104
|
*
|
|
103
|
-
* result.errors
|
|
104
|
-
* result.errors[1].message; //
|
|
105
|
+
* result.errors?.length; // => 2
|
|
106
|
+
* result.errors?.[1].message.includes('error limit reached'); // => true
|
|
105
107
|
* ```
|
|
106
108
|
*/
|
|
107
109
|
function getVariableValues(schema, varDefNodes, inputs, options) {
|
|
@@ -123,6 +125,7 @@ function getVariableValues(schema, varDefNodes, inputs, options) {
|
|
|
123
125
|
|
|
124
126
|
errors.push(error);
|
|
125
127
|
},
|
|
128
|
+
options === null || options === void 0 ? void 0 : options.hideSuggestions,
|
|
126
129
|
);
|
|
127
130
|
|
|
128
131
|
if (errors.length === 0) {
|
|
@@ -139,7 +142,13 @@ function getVariableValues(schema, varDefNodes, inputs, options) {
|
|
|
139
142
|
};
|
|
140
143
|
}
|
|
141
144
|
|
|
142
|
-
function coerceVariableValues(
|
|
145
|
+
function coerceVariableValues(
|
|
146
|
+
schema,
|
|
147
|
+
varDefNodes,
|
|
148
|
+
inputs,
|
|
149
|
+
onError,
|
|
150
|
+
hideSuggestions,
|
|
151
|
+
) {
|
|
143
152
|
const coercedValues = Object.create(null);
|
|
144
153
|
|
|
145
154
|
for (const varDefNode of varDefNodes) {
|
|
@@ -149,7 +158,7 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError) {
|
|
|
149
158
|
if (!(0, _definition.isInputType)(varType)) {
|
|
150
159
|
// Must use input types for variables. This should be caught during
|
|
151
160
|
// validation, however is checked again here for safety.
|
|
152
|
-
const varTypeStr = (0, _printer.
|
|
161
|
+
const varTypeStr = (0, _printer.printForError)(varDefNode.type);
|
|
153
162
|
onError(
|
|
154
163
|
new _GraphQLError.GraphQLError(
|
|
155
164
|
`Variable "$${varName}" expected value of type "${varTypeStr}" which cannot be used as an input type.`,
|
|
@@ -218,6 +227,7 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError) {
|
|
|
218
227
|
}),
|
|
219
228
|
);
|
|
220
229
|
},
|
|
230
|
+
hideSuggestions,
|
|
221
231
|
);
|
|
222
232
|
}
|
|
223
233
|
|
|
@@ -236,8 +246,9 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError) {
|
|
|
236
246
|
* @returns Coerced argument values keyed by argument name.
|
|
237
247
|
* @example
|
|
238
248
|
* ```ts
|
|
249
|
+
* import assert from 'node:assert/strict';
|
|
239
250
|
* // Read literal argument values and defaults.
|
|
240
|
-
* import { parse } from 'graphql/language';
|
|
251
|
+
* import { parse, Kind } from 'graphql/language';
|
|
241
252
|
* import { buildSchema } from 'graphql/utilities';
|
|
242
253
|
* import { getArgumentValues } from 'graphql/execution';
|
|
243
254
|
*
|
|
@@ -246,16 +257,21 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError) {
|
|
|
246
257
|
* reviews(stars: Int!, limit: Int = 10): [String]
|
|
247
258
|
* }
|
|
248
259
|
* `);
|
|
249
|
-
* const fieldDef = schema.getQueryType()
|
|
260
|
+
* const fieldDef = schema.getQueryType()?.getFields().reviews;
|
|
261
|
+
* assert(fieldDef);
|
|
250
262
|
* const document = parse('{ reviews(stars: 5) }');
|
|
251
|
-
* const
|
|
263
|
+
* const operation = document.definitions[0];
|
|
264
|
+
* assert(operation.kind === Kind.OPERATION_DEFINITION);
|
|
265
|
+
* const fieldNode = operation.selectionSet.selections[0];
|
|
266
|
+
* assert(fieldNode.kind === Kind.FIELD);
|
|
252
267
|
*
|
|
253
268
|
* getArgumentValues(fieldDef, fieldNode); // => { stars: 5, limit: 10 }
|
|
254
269
|
* ```
|
|
255
270
|
* @example
|
|
256
271
|
* ```ts
|
|
272
|
+
* import assert from 'node:assert/strict';
|
|
257
273
|
* // This variant resolves argument values from operation variables.
|
|
258
|
-
* import { parse } from 'graphql/language';
|
|
274
|
+
* import { parse, Kind } from 'graphql/language';
|
|
259
275
|
* import { buildSchema } from 'graphql/utilities';
|
|
260
276
|
* import { getArgumentValues } from 'graphql/execution';
|
|
261
277
|
*
|
|
@@ -264,9 +280,13 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError) {
|
|
|
264
280
|
* reviews(stars: Int!): [String]
|
|
265
281
|
* }
|
|
266
282
|
* `);
|
|
267
|
-
* const fieldDef = schema.getQueryType()
|
|
283
|
+
* const fieldDef = schema.getQueryType()?.getFields().reviews;
|
|
284
|
+
* assert(fieldDef);
|
|
268
285
|
* const document = parse('query ($stars: Int!) { reviews(stars: $stars) }');
|
|
269
|
-
* const
|
|
286
|
+
* const operation = document.definitions[0];
|
|
287
|
+
* assert(operation.kind === Kind.OPERATION_DEFINITION);
|
|
288
|
+
* const fieldNode = operation.selectionSet.selections[0];
|
|
289
|
+
* assert(fieldNode.kind === Kind.FIELD);
|
|
270
290
|
*
|
|
271
291
|
* getArgumentValues(fieldDef, fieldNode, { stars: 5 }); // => { stars: 5 }
|
|
272
292
|
* getArgumentValues(fieldDef, fieldNode, {}); // throws an error
|
|
@@ -363,7 +383,7 @@ function getArgumentValues(def, node, variableValues) {
|
|
|
363
383
|
// execution. This is a runtime check to ensure execution does not
|
|
364
384
|
// continue with an invalid argument value.
|
|
365
385
|
throw new _GraphQLError.GraphQLError(
|
|
366
|
-
`Argument "${name}" has invalid value ${(0, _printer.
|
|
386
|
+
`Argument "${name}" has invalid value ${(0, _printer.printForError)(
|
|
367
387
|
valueNode,
|
|
368
388
|
)}.`,
|
|
369
389
|
{
|
|
@@ -398,25 +418,33 @@ function getArgumentValues(def, node, variableValues) {
|
|
|
398
418
|
* @returns Coerced directive argument values keyed by argument name.
|
|
399
419
|
* @example
|
|
400
420
|
* ```ts
|
|
421
|
+
* import assert from 'node:assert/strict';
|
|
401
422
|
* // Read literal directive arguments from a node.
|
|
402
|
-
* import { parse } from 'graphql/language';
|
|
423
|
+
* import { parse, Kind } from 'graphql/language';
|
|
403
424
|
* import { GraphQLSkipDirective } from 'graphql/type';
|
|
404
425
|
* import { getDirectiveValues } from 'graphql/execution';
|
|
405
426
|
*
|
|
406
427
|
* const document = parse('{ name @skip(if: true) }');
|
|
407
|
-
* const
|
|
428
|
+
* const operation = document.definitions[0];
|
|
429
|
+
* assert(operation.kind === Kind.OPERATION_DEFINITION);
|
|
430
|
+
* const fieldNode = operation.selectionSet.selections[0];
|
|
408
431
|
*
|
|
409
432
|
* getDirectiveValues(GraphQLSkipDirective, fieldNode); // => { if: true }
|
|
410
433
|
* ```
|
|
411
434
|
* @example
|
|
412
435
|
* ```ts
|
|
436
|
+
* import assert from 'node:assert/strict';
|
|
413
437
|
* // This variant resolves directive arguments from variables and handles absent directives.
|
|
414
|
-
* import { parse } from 'graphql/language';
|
|
438
|
+
* import { parse, Kind } from 'graphql/language';
|
|
415
439
|
* import { GraphQLIncludeDirective } from 'graphql/type';
|
|
416
440
|
* import { getDirectiveValues } from 'graphql/execution';
|
|
417
441
|
*
|
|
418
|
-
* const document = parse(
|
|
419
|
-
*
|
|
442
|
+
* const document = parse(
|
|
443
|
+
* 'query ($includeName: Boolean!) { name @include(if: $includeName) }',
|
|
444
|
+
* );
|
|
445
|
+
* const operation = document.definitions[0];
|
|
446
|
+
* assert(operation.kind === Kind.OPERATION_DEFINITION);
|
|
447
|
+
* const fieldNode = operation.selectionSet.selections[0];
|
|
420
448
|
*
|
|
421
449
|
* getDirectiveValues(GraphQLIncludeDirective, fieldNode, {
|
|
422
450
|
* includeName: false,
|
|
@@ -4,7 +4,7 @@ import { keyMap } from '../jsutils/keyMap.mjs';
|
|
|
4
4
|
import { printPathArray } from '../jsutils/printPathArray.mjs';
|
|
5
5
|
import { GraphQLError } from '../error/GraphQLError.mjs';
|
|
6
6
|
import { Kind } from '../language/kinds.mjs';
|
|
7
|
-
import { print } from '../language/printer.mjs';
|
|
7
|
+
import { printForError as print } from '../language/printer.mjs';
|
|
8
8
|
import { isInputType, isNonNullType } from '../type/definition.mjs';
|
|
9
9
|
import { coerceInputValue } from '../utilities/coerceInputValue.mjs';
|
|
10
10
|
import { typeFromAST } from '../utilities/typeFromAST.mjs';
|
|
@@ -25,8 +25,9 @@ import { valueFromAST } from '../utilities/valueFromAST.mjs';
|
|
|
25
25
|
* @returns Coerced variable values, or request errors.
|
|
26
26
|
* @example
|
|
27
27
|
* ```ts
|
|
28
|
+
* import assert from 'node:assert/strict';
|
|
28
29
|
* // Coerce provided variables and apply operation defaults.
|
|
29
|
-
* import { parse } from 'graphql/language';
|
|
30
|
+
* import { parse, Kind } from 'graphql/language';
|
|
30
31
|
* import { buildSchema } from 'graphql/utilities';
|
|
31
32
|
* import { getVariableValues } from 'graphql/execution';
|
|
32
33
|
*
|
|
@@ -41,19 +42,19 @@ import { valueFromAST } from '../utilities/valueFromAST.mjs';
|
|
|
41
42
|
* }
|
|
42
43
|
* `);
|
|
43
44
|
* const operation = document.definitions[0];
|
|
45
|
+
* assert(operation.kind === Kind.OPERATION_DEFINITION);
|
|
44
46
|
*
|
|
45
|
-
* const result = getVariableValues(
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* { stars: '5' },
|
|
49
|
-
* );
|
|
47
|
+
* const result = getVariableValues(schema, operation.variableDefinitions ?? [], {
|
|
48
|
+
* stars: 5,
|
|
49
|
+
* });
|
|
50
50
|
*
|
|
51
51
|
* result; // => { coerced: { stars: 5, limit: 10 } }
|
|
52
52
|
* ```
|
|
53
53
|
* @example
|
|
54
54
|
* ```ts
|
|
55
|
+
* import assert from 'node:assert/strict';
|
|
55
56
|
* // This variant uses maxErrors to cap reported coercion errors.
|
|
56
|
-
* import { parse } from 'graphql/language';
|
|
57
|
+
* import { parse, Kind } from 'graphql/language';
|
|
57
58
|
* import { buildSchema } from 'graphql/utilities';
|
|
58
59
|
* import { getVariableValues } from 'graphql/execution';
|
|
59
60
|
*
|
|
@@ -73,16 +74,17 @@ import { valueFromAST } from '../utilities/valueFromAST.mjs';
|
|
|
73
74
|
* }
|
|
74
75
|
* `);
|
|
75
76
|
* const operation = document.definitions[0];
|
|
77
|
+
* assert(operation.kind === Kind.OPERATION_DEFINITION);
|
|
76
78
|
*
|
|
77
79
|
* const result = getVariableValues(
|
|
78
80
|
* schema,
|
|
79
|
-
* operation.variableDefinitions,
|
|
81
|
+
* operation.variableDefinitions ?? [],
|
|
80
82
|
* { first: { stars: 'bad' }, second: { stars: 'also bad' } },
|
|
81
83
|
* { maxErrors: 1 },
|
|
82
84
|
* );
|
|
83
85
|
*
|
|
84
|
-
* result.errors
|
|
85
|
-
* result.errors[1].message; //
|
|
86
|
+
* result.errors?.length; // => 2
|
|
87
|
+
* result.errors?.[1].message.includes('error limit reached'); // => true
|
|
86
88
|
* ```
|
|
87
89
|
*/
|
|
88
90
|
export function getVariableValues(schema, varDefNodes, inputs, options) {
|
|
@@ -104,6 +106,7 @@ export function getVariableValues(schema, varDefNodes, inputs, options) {
|
|
|
104
106
|
|
|
105
107
|
errors.push(error);
|
|
106
108
|
},
|
|
109
|
+
options === null || options === void 0 ? void 0 : options.hideSuggestions,
|
|
107
110
|
);
|
|
108
111
|
|
|
109
112
|
if (errors.length === 0) {
|
|
@@ -120,7 +123,13 @@ export function getVariableValues(schema, varDefNodes, inputs, options) {
|
|
|
120
123
|
};
|
|
121
124
|
}
|
|
122
125
|
|
|
123
|
-
function coerceVariableValues(
|
|
126
|
+
function coerceVariableValues(
|
|
127
|
+
schema,
|
|
128
|
+
varDefNodes,
|
|
129
|
+
inputs,
|
|
130
|
+
onError,
|
|
131
|
+
hideSuggestions,
|
|
132
|
+
) {
|
|
124
133
|
const coercedValues = Object.create(null);
|
|
125
134
|
|
|
126
135
|
for (const varDefNode of varDefNodes) {
|
|
@@ -193,6 +202,7 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError) {
|
|
|
193
202
|
}),
|
|
194
203
|
);
|
|
195
204
|
},
|
|
205
|
+
hideSuggestions,
|
|
196
206
|
);
|
|
197
207
|
}
|
|
198
208
|
|
|
@@ -211,8 +221,9 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError) {
|
|
|
211
221
|
* @returns Coerced argument values keyed by argument name.
|
|
212
222
|
* @example
|
|
213
223
|
* ```ts
|
|
224
|
+
* import assert from 'node:assert/strict';
|
|
214
225
|
* // Read literal argument values and defaults.
|
|
215
|
-
* import { parse } from 'graphql/language';
|
|
226
|
+
* import { parse, Kind } from 'graphql/language';
|
|
216
227
|
* import { buildSchema } from 'graphql/utilities';
|
|
217
228
|
* import { getArgumentValues } from 'graphql/execution';
|
|
218
229
|
*
|
|
@@ -221,16 +232,21 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError) {
|
|
|
221
232
|
* reviews(stars: Int!, limit: Int = 10): [String]
|
|
222
233
|
* }
|
|
223
234
|
* `);
|
|
224
|
-
* const fieldDef = schema.getQueryType()
|
|
235
|
+
* const fieldDef = schema.getQueryType()?.getFields().reviews;
|
|
236
|
+
* assert(fieldDef);
|
|
225
237
|
* const document = parse('{ reviews(stars: 5) }');
|
|
226
|
-
* const
|
|
238
|
+
* const operation = document.definitions[0];
|
|
239
|
+
* assert(operation.kind === Kind.OPERATION_DEFINITION);
|
|
240
|
+
* const fieldNode = operation.selectionSet.selections[0];
|
|
241
|
+
* assert(fieldNode.kind === Kind.FIELD);
|
|
227
242
|
*
|
|
228
243
|
* getArgumentValues(fieldDef, fieldNode); // => { stars: 5, limit: 10 }
|
|
229
244
|
* ```
|
|
230
245
|
* @example
|
|
231
246
|
* ```ts
|
|
247
|
+
* import assert from 'node:assert/strict';
|
|
232
248
|
* // This variant resolves argument values from operation variables.
|
|
233
|
-
* import { parse } from 'graphql/language';
|
|
249
|
+
* import { parse, Kind } from 'graphql/language';
|
|
234
250
|
* import { buildSchema } from 'graphql/utilities';
|
|
235
251
|
* import { getArgumentValues } from 'graphql/execution';
|
|
236
252
|
*
|
|
@@ -239,9 +255,13 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError) {
|
|
|
239
255
|
* reviews(stars: Int!): [String]
|
|
240
256
|
* }
|
|
241
257
|
* `);
|
|
242
|
-
* const fieldDef = schema.getQueryType()
|
|
258
|
+
* const fieldDef = schema.getQueryType()?.getFields().reviews;
|
|
259
|
+
* assert(fieldDef);
|
|
243
260
|
* const document = parse('query ($stars: Int!) { reviews(stars: $stars) }');
|
|
244
|
-
* const
|
|
261
|
+
* const operation = document.definitions[0];
|
|
262
|
+
* assert(operation.kind === Kind.OPERATION_DEFINITION);
|
|
263
|
+
* const fieldNode = operation.selectionSet.selections[0];
|
|
264
|
+
* assert(fieldNode.kind === Kind.FIELD);
|
|
245
265
|
*
|
|
246
266
|
* getArgumentValues(fieldDef, fieldNode, { stars: 5 }); // => { stars: 5 }
|
|
247
267
|
* getArgumentValues(fieldDef, fieldNode, {}); // throws an error
|
|
@@ -360,25 +380,33 @@ export function getArgumentValues(def, node, variableValues) {
|
|
|
360
380
|
* @returns Coerced directive argument values keyed by argument name.
|
|
361
381
|
* @example
|
|
362
382
|
* ```ts
|
|
383
|
+
* import assert from 'node:assert/strict';
|
|
363
384
|
* // Read literal directive arguments from a node.
|
|
364
|
-
* import { parse } from 'graphql/language';
|
|
385
|
+
* import { parse, Kind } from 'graphql/language';
|
|
365
386
|
* import { GraphQLSkipDirective } from 'graphql/type';
|
|
366
387
|
* import { getDirectiveValues } from 'graphql/execution';
|
|
367
388
|
*
|
|
368
389
|
* const document = parse('{ name @skip(if: true) }');
|
|
369
|
-
* const
|
|
390
|
+
* const operation = document.definitions[0];
|
|
391
|
+
* assert(operation.kind === Kind.OPERATION_DEFINITION);
|
|
392
|
+
* const fieldNode = operation.selectionSet.selections[0];
|
|
370
393
|
*
|
|
371
394
|
* getDirectiveValues(GraphQLSkipDirective, fieldNode); // => { if: true }
|
|
372
395
|
* ```
|
|
373
396
|
* @example
|
|
374
397
|
* ```ts
|
|
398
|
+
* import assert from 'node:assert/strict';
|
|
375
399
|
* // This variant resolves directive arguments from variables and handles absent directives.
|
|
376
|
-
* import { parse } from 'graphql/language';
|
|
400
|
+
* import { parse, Kind } from 'graphql/language';
|
|
377
401
|
* import { GraphQLIncludeDirective } from 'graphql/type';
|
|
378
402
|
* import { getDirectiveValues } from 'graphql/execution';
|
|
379
403
|
*
|
|
380
|
-
* const document = parse(
|
|
381
|
-
*
|
|
404
|
+
* const document = parse(
|
|
405
|
+
* 'query ($includeName: Boolean!) { name @include(if: $includeName) }',
|
|
406
|
+
* );
|
|
407
|
+
* const operation = document.definitions[0];
|
|
408
|
+
* assert(operation.kind === Kind.OPERATION_DEFINITION);
|
|
409
|
+
* const fieldNode = operation.selectionSet.selections[0];
|
|
382
410
|
*
|
|
383
411
|
* getDirectiveValues(GraphQLIncludeDirective, fieldNode, {
|
|
384
412
|
* includeName: false,
|
|
@@ -14,6 +14,8 @@ import type { ExecutionResult } from './execution/execute';
|
|
|
14
14
|
* @category Request Pipeline
|
|
15
15
|
*/
|
|
16
16
|
export interface GraphQLArgs {
|
|
17
|
+
/** Omit suggestions from validation and input coercion errors. */
|
|
18
|
+
hideSuggestions?: Maybe<boolean>;
|
|
17
19
|
/** The GraphQL type system to use when validating and executing a query. */
|
|
18
20
|
schema: GraphQLSchema;
|
|
19
21
|
/**
|
|
@@ -84,13 +86,11 @@ export interface GraphQLArgs {
|
|
|
84
86
|
* schema,
|
|
85
87
|
* source: 'query SayHello($name: String!) { greeting(name: $name) }',
|
|
86
88
|
* rootValue: {
|
|
87
|
-
* greeting: ({ name }) => `Hello, ${name}!`,
|
|
89
|
+
* greeting: ({ name }: { name: string }) => `Hello, ${name}!`,
|
|
88
90
|
* },
|
|
89
91
|
* variableValues: { name: 'Ada' },
|
|
90
92
|
* operationName: 'SayHello',
|
|
91
|
-
* });
|
|
92
|
-
*
|
|
93
|
-
* result; // => { data: { greeting: 'Hello, Ada!' } }
|
|
93
|
+
* }); // => { data: { greeting: 'Hello, Ada!' } }
|
|
94
94
|
* ```
|
|
95
95
|
* @example
|
|
96
96
|
* ```ts
|
|
@@ -123,9 +123,7 @@ export interface GraphQLArgs {
|
|
|
123
123
|
* typeResolver: (value) => {
|
|
124
124
|
* return value.kind === 'user' ? 'User' : undefined;
|
|
125
125
|
* },
|
|
126
|
-
* });
|
|
127
|
-
*
|
|
128
|
-
* result; // => { data: { viewer: { __typename: 'User', name: 'Ada' } } }
|
|
126
|
+
* }); // => { data: { viewer: { __typename: 'User', name: 'Ada' } } }
|
|
129
127
|
* ```
|
|
130
128
|
* @category Request Pipeline
|
|
131
129
|
*/
|
|
@@ -154,13 +152,11 @@ export declare function graphql(args: GraphQLArgs): Promise<ExecutionResult>;
|
|
|
154
152
|
* schema,
|
|
155
153
|
* source: 'query SayHello($name: String!) { greeting(name: $name) }',
|
|
156
154
|
* rootValue: {
|
|
157
|
-
* greeting: ({ name }) => `Hello, ${name}!`,
|
|
155
|
+
* greeting: ({ name }: { name: string }) => `Hello, ${name}!`,
|
|
158
156
|
* },
|
|
159
157
|
* variableValues: { name: 'Ada' },
|
|
160
158
|
* operationName: 'SayHello',
|
|
161
|
-
* });
|
|
162
|
-
*
|
|
163
|
-
* result; // => { data: { greeting: 'Hello, Ada!' } }
|
|
159
|
+
* }); // => { data: { greeting: 'Hello, Ada!' } }
|
|
164
160
|
* ```
|
|
165
161
|
* @example
|
|
166
162
|
* ```ts
|
|
@@ -180,9 +176,7 @@ export declare function graphql(args: GraphQLArgs): Promise<ExecutionResult>;
|
|
|
180
176
|
* return contextValue.defaultGreeting;
|
|
181
177
|
* },
|
|
182
178
|
* contextValue: { defaultGreeting: 'Hello' },
|
|
183
|
-
* });
|
|
184
|
-
*
|
|
185
|
-
* result; // => { data: { greeting: 'Hello' } }
|
|
179
|
+
* }); // => { data: { greeting: 'Hello' } }
|
|
186
180
|
* ```
|
|
187
181
|
* @category Request Pipeline
|
|
188
182
|
*/
|
|
@@ -45,13 +45,11 @@ var _execute = require('./execution/execute.js');
|
|
|
45
45
|
* schema,
|
|
46
46
|
* source: 'query SayHello($name: String!) { greeting(name: $name) }',
|
|
47
47
|
* rootValue: {
|
|
48
|
-
* greeting: ({ name }) => `Hello, ${name}!`,
|
|
48
|
+
* greeting: ({ name }: { name: string }) => `Hello, ${name}!`,
|
|
49
49
|
* },
|
|
50
50
|
* variableValues: { name: 'Ada' },
|
|
51
51
|
* operationName: 'SayHello',
|
|
52
|
-
* });
|
|
53
|
-
*
|
|
54
|
-
* result; // => { data: { greeting: 'Hello, Ada!' } }
|
|
52
|
+
* }); // => { data: { greeting: 'Hello, Ada!' } }
|
|
55
53
|
* ```
|
|
56
54
|
* @example
|
|
57
55
|
* ```ts
|
|
@@ -84,9 +82,7 @@ var _execute = require('./execution/execute.js');
|
|
|
84
82
|
* typeResolver: (value) => {
|
|
85
83
|
* return value.kind === 'user' ? 'User' : undefined;
|
|
86
84
|
* },
|
|
87
|
-
* });
|
|
88
|
-
*
|
|
89
|
-
* result; // => { data: { viewer: { __typename: 'User', name: 'Ada' } } }
|
|
85
|
+
* }); // => { data: { viewer: { __typename: 'User', name: 'Ada' } } }
|
|
90
86
|
* ```
|
|
91
87
|
* @category Request Pipeline
|
|
92
88
|
*/
|
|
@@ -118,13 +114,11 @@ function graphql(args) {
|
|
|
118
114
|
* schema,
|
|
119
115
|
* source: 'query SayHello($name: String!) { greeting(name: $name) }',
|
|
120
116
|
* rootValue: {
|
|
121
|
-
* greeting: ({ name }) => `Hello, ${name}!`,
|
|
117
|
+
* greeting: ({ name }: { name: string }) => `Hello, ${name}!`,
|
|
122
118
|
* },
|
|
123
119
|
* variableValues: { name: 'Ada' },
|
|
124
120
|
* operationName: 'SayHello',
|
|
125
|
-
* });
|
|
126
|
-
*
|
|
127
|
-
* result; // => { data: { greeting: 'Hello, Ada!' } }
|
|
121
|
+
* }); // => { data: { greeting: 'Hello, Ada!' } }
|
|
128
122
|
* ```
|
|
129
123
|
* @example
|
|
130
124
|
* ```ts
|
|
@@ -144,9 +138,7 @@ function graphql(args) {
|
|
|
144
138
|
* return contextValue.defaultGreeting;
|
|
145
139
|
* },
|
|
146
140
|
* contextValue: { defaultGreeting: 'Hello' },
|
|
147
|
-
* });
|
|
148
|
-
*
|
|
149
|
-
* result; // => { data: { greeting: 'Hello' } }
|
|
141
|
+
* }); // => { data: { greeting: 'Hello' } }
|
|
150
142
|
* ```
|
|
151
143
|
* @category Request Pipeline
|
|
152
144
|
*/
|
|
@@ -177,6 +169,7 @@ function graphqlImpl(args) {
|
|
|
177
169
|
operationName,
|
|
178
170
|
fieldResolver,
|
|
179
171
|
typeResolver,
|
|
172
|
+
hideSuggestions,
|
|
180
173
|
} = args; // Validate Schema
|
|
181
174
|
|
|
182
175
|
const schemaValidationErrors = (0, _validate.validateSchema)(schema);
|
|
@@ -197,7 +190,14 @@ function graphqlImpl(args) {
|
|
|
197
190
|
};
|
|
198
191
|
} // Validate
|
|
199
192
|
|
|
200
|
-
const validationErrors = (0, _validate2.validate)(
|
|
193
|
+
const validationErrors = (0, _validate2.validate)(
|
|
194
|
+
schema,
|
|
195
|
+
document,
|
|
196
|
+
undefined,
|
|
197
|
+
{
|
|
198
|
+
hideSuggestions,
|
|
199
|
+
},
|
|
200
|
+
);
|
|
201
201
|
|
|
202
202
|
if (validationErrors.length > 0) {
|
|
203
203
|
return {
|
|
@@ -214,5 +214,6 @@ function graphqlImpl(args) {
|
|
|
214
214
|
operationName,
|
|
215
215
|
fieldResolver,
|
|
216
216
|
typeResolver,
|
|
217
|
+
hideSuggestions,
|
|
217
218
|
});
|
|
218
219
|
}
|
|
@@ -39,13 +39,11 @@ import { execute } from './execution/execute.mjs';
|
|
|
39
39
|
* schema,
|
|
40
40
|
* source: 'query SayHello($name: String!) { greeting(name: $name) }',
|
|
41
41
|
* rootValue: {
|
|
42
|
-
* greeting: ({ name }) => `Hello, ${name}!`,
|
|
42
|
+
* greeting: ({ name }: { name: string }) => `Hello, ${name}!`,
|
|
43
43
|
* },
|
|
44
44
|
* variableValues: { name: 'Ada' },
|
|
45
45
|
* operationName: 'SayHello',
|
|
46
|
-
* });
|
|
47
|
-
*
|
|
48
|
-
* result; // => { data: { greeting: 'Hello, Ada!' } }
|
|
46
|
+
* }); // => { data: { greeting: 'Hello, Ada!' } }
|
|
49
47
|
* ```
|
|
50
48
|
* @example
|
|
51
49
|
* ```ts
|
|
@@ -78,9 +76,7 @@ import { execute } from './execution/execute.mjs';
|
|
|
78
76
|
* typeResolver: (value) => {
|
|
79
77
|
* return value.kind === 'user' ? 'User' : undefined;
|
|
80
78
|
* },
|
|
81
|
-
* });
|
|
82
|
-
*
|
|
83
|
-
* result; // => { data: { viewer: { __typename: 'User', name: 'Ada' } } }
|
|
79
|
+
* }); // => { data: { viewer: { __typename: 'User', name: 'Ada' } } }
|
|
84
80
|
* ```
|
|
85
81
|
* @category Request Pipeline
|
|
86
82
|
*/
|
|
@@ -112,13 +108,11 @@ export function graphql(args) {
|
|
|
112
108
|
* schema,
|
|
113
109
|
* source: 'query SayHello($name: String!) { greeting(name: $name) }',
|
|
114
110
|
* rootValue: {
|
|
115
|
-
* greeting: ({ name }) => `Hello, ${name}!`,
|
|
111
|
+
* greeting: ({ name }: { name: string }) => `Hello, ${name}!`,
|
|
116
112
|
* },
|
|
117
113
|
* variableValues: { name: 'Ada' },
|
|
118
114
|
* operationName: 'SayHello',
|
|
119
|
-
* });
|
|
120
|
-
*
|
|
121
|
-
* result; // => { data: { greeting: 'Hello, Ada!' } }
|
|
115
|
+
* }); // => { data: { greeting: 'Hello, Ada!' } }
|
|
122
116
|
* ```
|
|
123
117
|
* @example
|
|
124
118
|
* ```ts
|
|
@@ -138,9 +132,7 @@ export function graphql(args) {
|
|
|
138
132
|
* return contextValue.defaultGreeting;
|
|
139
133
|
* },
|
|
140
134
|
* contextValue: { defaultGreeting: 'Hello' },
|
|
141
|
-
* });
|
|
142
|
-
*
|
|
143
|
-
* result; // => { data: { greeting: 'Hello' } }
|
|
135
|
+
* }); // => { data: { greeting: 'Hello' } }
|
|
144
136
|
* ```
|
|
145
137
|
* @category Request Pipeline
|
|
146
138
|
*/
|
|
@@ -171,6 +163,7 @@ function graphqlImpl(args) {
|
|
|
171
163
|
operationName,
|
|
172
164
|
fieldResolver,
|
|
173
165
|
typeResolver,
|
|
166
|
+
hideSuggestions,
|
|
174
167
|
} = args; // Validate Schema
|
|
175
168
|
|
|
176
169
|
const schemaValidationErrors = validateSchema(schema);
|
|
@@ -191,7 +184,9 @@ function graphqlImpl(args) {
|
|
|
191
184
|
};
|
|
192
185
|
} // Validate
|
|
193
186
|
|
|
194
|
-
const validationErrors = validate(schema, document
|
|
187
|
+
const validationErrors = validate(schema, document, undefined, {
|
|
188
|
+
hideSuggestions,
|
|
189
|
+
});
|
|
195
190
|
|
|
196
191
|
if (validationErrors.length > 0) {
|
|
197
192
|
return {
|
|
@@ -208,5 +203,6 @@ function graphqlImpl(args) {
|
|
|
208
203
|
operationName,
|
|
209
204
|
fieldResolver,
|
|
210
205
|
typeResolver,
|
|
206
|
+
hideSuggestions,
|
|
211
207
|
});
|
|
212
208
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps an order-independent set of member identities to a value.
|
|
3
|
+
* Each member receives a map-local ID; sorted IDs form the exact key.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare class SetMap<T, V> {
|
|
7
|
+
_entries: Map<string, V>;
|
|
8
|
+
_memberIds: Map<T, number>;
|
|
9
|
+
_nextMemberId: number;
|
|
10
|
+
constructor();
|
|
11
|
+
get(members: ReadonlySet<T>): V | undefined;
|
|
12
|
+
set(members: ReadonlySet<T>, value: V): void;
|
|
13
|
+
_key(members: ReadonlySet<T>): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true,
|
|
5
|
+
});
|
|
6
|
+
exports.SetMap = void 0;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Maps an order-independent set of member identities to a value.
|
|
10
|
+
* Each member receives a map-local ID; sorted IDs form the exact key.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
class SetMap {
|
|
14
|
+
constructor() {
|
|
15
|
+
this._entries = new Map();
|
|
16
|
+
this._memberIds = new Map();
|
|
17
|
+
this._nextMemberId = 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
get(members) {
|
|
21
|
+
return this._entries.get(this._key(members));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
set(members, value) {
|
|
25
|
+
this._entries.set(this._key(members), value);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
_key(members) {
|
|
29
|
+
const ids = [];
|
|
30
|
+
|
|
31
|
+
for (const member of members) {
|
|
32
|
+
let id = this._memberIds.get(member);
|
|
33
|
+
|
|
34
|
+
if (id === undefined) {
|
|
35
|
+
id = this._nextMemberId++;
|
|
36
|
+
|
|
37
|
+
this._memberIds.set(member, id);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
ids.push(id);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
ids.sort((id1, id2) => id1 - id2);
|
|
44
|
+
return ids.join(',');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
exports.SetMap = SetMap;
|