@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
|
@@ -0,0 +1,39 @@
|
|
|
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 class SetMap {
|
|
7
|
+
constructor() {
|
|
8
|
+
this._entries = new Map();
|
|
9
|
+
this._memberIds = new Map();
|
|
10
|
+
this._nextMemberId = 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
get(members) {
|
|
14
|
+
return this._entries.get(this._key(members));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
set(members, value) {
|
|
18
|
+
this._entries.set(this._key(members), value);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
_key(members) {
|
|
22
|
+
const ids = [];
|
|
23
|
+
|
|
24
|
+
for (const member of members) {
|
|
25
|
+
let id = this._memberIds.get(member);
|
|
26
|
+
|
|
27
|
+
if (id === undefined) {
|
|
28
|
+
id = this._nextMemberId++;
|
|
29
|
+
|
|
30
|
+
this._memberIds.set(member, id);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
ids.push(id);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
ids.sort((id1, id2) => id1 - id2);
|
|
37
|
+
return ids.join(',');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -16,6 +16,8 @@ exports.isIterableObject = isIterableObject;
|
|
|
16
16
|
* @internal
|
|
17
17
|
* @example
|
|
18
18
|
* ```ts
|
|
19
|
+
* import { isIterableObject } from 'graphql/jsutils/isIterableObject';
|
|
20
|
+
*
|
|
19
21
|
* isIterableObject([1, 2, 3]); // => true
|
|
20
22
|
* isIterableObject(new Map()); // => true
|
|
21
23
|
* isIterableObject('ABC'); // => false
|
|
@@ -5,6 +5,8 @@ import type { ObjMap } from './ObjMap';
|
|
|
5
5
|
* @internal
|
|
6
6
|
* @example
|
|
7
7
|
* ```ts
|
|
8
|
+
* import { keyValMap } from 'graphql/jsutils/keyValMap';
|
|
9
|
+
*
|
|
8
10
|
* const phoneBook = [
|
|
9
11
|
* { name: 'Jon', num: '555-1234' },
|
|
10
12
|
* { name: 'Jenny', num: '867-5309' },
|
|
@@ -14,9 +16,7 @@ import type { ObjMap } from './ObjMap';
|
|
|
14
16
|
* phoneBook,
|
|
15
17
|
* (entry) => entry.name,
|
|
16
18
|
* (entry) => entry.num,
|
|
17
|
-
* );
|
|
18
|
-
*
|
|
19
|
-
* phonesByName; // => { Jon: '555-1234', Jenny: '867-5309' }
|
|
19
|
+
* ); // => { Jon: '555-1234', Jenny: '867-5309' }
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
export declare function keyValMap<T, V>(
|
|
@@ -11,6 +11,8 @@ exports.keyValMap = keyValMap;
|
|
|
11
11
|
* @internal
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
14
|
+
* import { keyValMap } from 'graphql/jsutils/keyValMap';
|
|
15
|
+
*
|
|
14
16
|
* const phoneBook = [
|
|
15
17
|
* { name: 'Jon', num: '555-1234' },
|
|
16
18
|
* { name: 'Jenny', num: '867-5309' },
|
|
@@ -20,9 +22,7 @@ exports.keyValMap = keyValMap;
|
|
|
20
22
|
* phoneBook,
|
|
21
23
|
* (entry) => entry.name,
|
|
22
24
|
* (entry) => entry.num,
|
|
23
|
-
* );
|
|
24
|
-
*
|
|
25
|
-
* phonesByName; // => { Jon: '555-1234', Jenny: '867-5309' }
|
|
25
|
+
* ); // => { Jon: '555-1234', Jenny: '867-5309' }
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
28
|
function keyValMap(list, keyFn, valFn) {
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* @internal
|
|
5
5
|
* @example
|
|
6
6
|
* ```ts
|
|
7
|
+
* import { keyValMap } from 'graphql/jsutils/keyValMap';
|
|
8
|
+
*
|
|
7
9
|
* const phoneBook = [
|
|
8
10
|
* { name: 'Jon', num: '555-1234' },
|
|
9
11
|
* { name: 'Jenny', num: '867-5309' },
|
|
@@ -13,9 +15,7 @@
|
|
|
13
15
|
* phoneBook,
|
|
14
16
|
* (entry) => entry.name,
|
|
15
17
|
* (entry) => entry.num,
|
|
16
|
-
* );
|
|
17
|
-
*
|
|
18
|
-
* phonesByName; // => { Jon: '555-1234', Jenny: '867-5309' }
|
|
18
|
+
* ); // => { Jon: '555-1234', Jenny: '867-5309' }
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
21
|
export function keyValMap(list, keyFn, valFn) {
|
|
@@ -50,9 +50,7 @@ export declare class Location {
|
|
|
50
50
|
* import { parse } from 'graphql/language';
|
|
51
51
|
*
|
|
52
52
|
* const document = parse('{ hello }');
|
|
53
|
-
* const location = document.loc?.toJSON();
|
|
54
|
-
*
|
|
55
|
-
* location; // => { start: 0, end: 9 }
|
|
53
|
+
* const location = document.loc?.toJSON(); // => { start: 0, end: 9 }
|
|
56
54
|
* ```
|
|
57
55
|
*/
|
|
58
56
|
toJSON(): {
|
|
@@ -130,9 +128,7 @@ export declare class Token {
|
|
|
130
128
|
* import { Lexer, Source } from 'graphql/language';
|
|
131
129
|
*
|
|
132
130
|
* const lexer = new Lexer(new Source('{ hello }'));
|
|
133
|
-
* const token = lexer.advance().toJSON();
|
|
134
|
-
*
|
|
135
|
-
* token; // => { kind: '{', value: undefined, line: 1, column: 1 }
|
|
131
|
+
* const token = lexer.advance().toJSON(); // => { kind: '{', value: undefined, line: 1, column: 1 }
|
|
136
132
|
* ```
|
|
137
133
|
*/
|
|
138
134
|
toJSON(): {
|
|
@@ -69,9 +69,7 @@ class Location {
|
|
|
69
69
|
* import { parse } from 'graphql/language';
|
|
70
70
|
*
|
|
71
71
|
* const document = parse('{ hello }');
|
|
72
|
-
* const location = document.loc?.toJSON();
|
|
73
|
-
*
|
|
74
|
-
* location; // => { start: 0, end: 9 }
|
|
72
|
+
* const location = document.loc?.toJSON(); // => { start: 0, end: 9 }
|
|
75
73
|
* ```
|
|
76
74
|
*/
|
|
77
75
|
|
|
@@ -161,9 +159,7 @@ class Token {
|
|
|
161
159
|
* import { Lexer, Source } from 'graphql/language';
|
|
162
160
|
*
|
|
163
161
|
* const lexer = new Lexer(new Source('{ hello }'));
|
|
164
|
-
* const token = lexer.advance().toJSON();
|
|
165
|
-
*
|
|
166
|
-
* token; // => { kind: '{', value: undefined, line: 1, column: 1 }
|
|
162
|
+
* const token = lexer.advance().toJSON(); // => { kind: '{', value: undefined, line: 1, column: 1 }
|
|
167
163
|
* ```
|
|
168
164
|
*/
|
|
169
165
|
|
|
@@ -57,9 +57,7 @@ export class Location {
|
|
|
57
57
|
* import { parse } from 'graphql/language';
|
|
58
58
|
*
|
|
59
59
|
* const document = parse('{ hello }');
|
|
60
|
-
* const location = document.loc?.toJSON();
|
|
61
|
-
*
|
|
62
|
-
* location; // => { start: 0, end: 9 }
|
|
60
|
+
* const location = document.loc?.toJSON(); // => { start: 0, end: 9 }
|
|
63
61
|
* ```
|
|
64
62
|
*/
|
|
65
63
|
|
|
@@ -147,9 +145,7 @@ export class Token {
|
|
|
147
145
|
* import { Lexer, Source } from 'graphql/language';
|
|
148
146
|
*
|
|
149
147
|
* const lexer = new Lexer(new Source('{ hello }'));
|
|
150
|
-
* const token = lexer.advance().toJSON();
|
|
151
|
-
*
|
|
152
|
-
* token; // => { kind: '{', value: undefined, line: 1, column: 1 }
|
|
148
|
+
* const token = lexer.advance().toJSON(); // => { kind: '{', value: undefined, line: 1, column: 1 }
|
|
153
149
|
* ```
|
|
154
150
|
*/
|
|
155
151
|
|
|
@@ -14,6 +14,8 @@ export interface LexerInterface {
|
|
|
14
14
|
token: Token;
|
|
15
15
|
line: number;
|
|
16
16
|
lineStart: number;
|
|
17
|
+
_maxComments?: number | undefined;
|
|
18
|
+
_commentCount?: number | undefined;
|
|
17
19
|
advance: () => Token;
|
|
18
20
|
lookahead: () => Token;
|
|
19
21
|
}
|
|
@@ -36,6 +38,10 @@ export declare class Lexer implements LexerInterface {
|
|
|
36
38
|
line: number;
|
|
37
39
|
/** Character offset where the current line starts. */
|
|
38
40
|
lineStart: number;
|
|
41
|
+
/** @internal */
|
|
42
|
+
_maxComments: number | undefined;
|
|
43
|
+
/** @internal */
|
|
44
|
+
_commentCount: number;
|
|
39
45
|
/**
|
|
40
46
|
* Creates a Lexer instance.
|
|
41
47
|
* @param source - Source document used to derive error locations.
|
|
@@ -40,6 +40,10 @@ class Lexer {
|
|
|
40
40
|
|
|
41
41
|
/** Character offset where the current line starts. */
|
|
42
42
|
|
|
43
|
+
/** @internal */
|
|
44
|
+
|
|
45
|
+
/** @internal */
|
|
46
|
+
|
|
43
47
|
/**
|
|
44
48
|
* Creates a Lexer instance.
|
|
45
49
|
* @param source - Source document used to derive error locations.
|
|
@@ -68,6 +72,8 @@ class Lexer {
|
|
|
68
72
|
this.token = startOfFileToken;
|
|
69
73
|
this.line = 1;
|
|
70
74
|
this.lineStart = 0;
|
|
75
|
+
this._maxComments = undefined;
|
|
76
|
+
this._commentCount = 0;
|
|
71
77
|
}
|
|
72
78
|
/**
|
|
73
79
|
* Returns the value used by `Object.prototype.toString`.
|
|
@@ -493,6 +499,22 @@ function readNextToken(lexer, start) {
|
|
|
493
499
|
*/
|
|
494
500
|
|
|
495
501
|
function readComment(lexer, start) {
|
|
502
|
+
const maxComments = lexer._maxComments;
|
|
503
|
+
|
|
504
|
+
if (maxComments !== undefined) {
|
|
505
|
+
const nextCommentCount = lexer._commentCount + 1;
|
|
506
|
+
|
|
507
|
+
if (nextCommentCount > maxComments) {
|
|
508
|
+
throw (0, _syntaxError.syntaxError)(
|
|
509
|
+
lexer.source,
|
|
510
|
+
start,
|
|
511
|
+
`Document contains more than ${maxComments} comments. Parsing aborted.`,
|
|
512
|
+
);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
lexer._commentCount = nextCommentCount;
|
|
516
|
+
}
|
|
517
|
+
|
|
496
518
|
const body = lexer.source.body;
|
|
497
519
|
const bodyLength = body.length;
|
|
498
520
|
let position = start + 1;
|
|
@@ -30,6 +30,10 @@ export class Lexer {
|
|
|
30
30
|
|
|
31
31
|
/** Character offset where the current line starts. */
|
|
32
32
|
|
|
33
|
+
/** @internal */
|
|
34
|
+
|
|
35
|
+
/** @internal */
|
|
36
|
+
|
|
33
37
|
/**
|
|
34
38
|
* Creates a Lexer instance.
|
|
35
39
|
* @param source - Source document used to derive error locations.
|
|
@@ -52,6 +56,8 @@ export class Lexer {
|
|
|
52
56
|
this.token = startOfFileToken;
|
|
53
57
|
this.line = 1;
|
|
54
58
|
this.lineStart = 0;
|
|
59
|
+
this._maxComments = undefined;
|
|
60
|
+
this._commentCount = 0;
|
|
55
61
|
}
|
|
56
62
|
/**
|
|
57
63
|
* Returns the value used by `Object.prototype.toString`.
|
|
@@ -405,6 +411,22 @@ function readNextToken(lexer, start) {
|
|
|
405
411
|
*/
|
|
406
412
|
|
|
407
413
|
function readComment(lexer, start) {
|
|
414
|
+
const maxComments = lexer._maxComments;
|
|
415
|
+
|
|
416
|
+
if (maxComments !== undefined) {
|
|
417
|
+
const nextCommentCount = lexer._commentCount + 1;
|
|
418
|
+
|
|
419
|
+
if (nextCommentCount > maxComments) {
|
|
420
|
+
throw syntaxError(
|
|
421
|
+
lexer.source,
|
|
422
|
+
start,
|
|
423
|
+
`Document contains more than ${maxComments} comments. Parsing aborted.`,
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
lexer._commentCount = nextCommentCount;
|
|
428
|
+
}
|
|
429
|
+
|
|
408
430
|
const body = lexer.source.body;
|
|
409
431
|
const bodyLength = body.length;
|
|
410
432
|
let position = start + 1;
|
|
@@ -18,12 +18,17 @@ export interface SourceLocation {
|
|
|
18
18
|
* import { Source, getLocation } from 'graphql/language';
|
|
19
19
|
*
|
|
20
20
|
* const source = new Source('type Query { hello: String }');
|
|
21
|
-
* const location = getLocation(source, 13);
|
|
22
|
-
*
|
|
23
|
-
* location; // => { line: 1, column: 14 }
|
|
21
|
+
* const location = getLocation(source, 13); // => { line: 1, column: 14 }
|
|
24
22
|
* ```
|
|
25
23
|
*/
|
|
26
24
|
export declare function getLocation(
|
|
27
25
|
source: Source,
|
|
28
26
|
position: number,
|
|
29
27
|
): SourceLocation;
|
|
28
|
+
/** @internal */
|
|
29
|
+
export declare function getLocations(
|
|
30
|
+
locations: ReadonlyArray<{
|
|
31
|
+
source: Source;
|
|
32
|
+
start: number;
|
|
33
|
+
}>,
|
|
34
|
+
): Array<SourceLocation>;
|
|
@@ -4,11 +4,10 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
4
4
|
value: true,
|
|
5
5
|
});
|
|
6
6
|
exports.getLocation = getLocation;
|
|
7
|
-
|
|
8
|
-
var _invariant = require('../jsutils/invariant.js');
|
|
7
|
+
exports.getLocations = getLocations;
|
|
9
8
|
|
|
10
9
|
/** @category Source */
|
|
11
|
-
|
|
10
|
+
|
|
12
11
|
/** Represents a location in a Source. */
|
|
13
12
|
|
|
14
13
|
/**
|
|
@@ -22,28 +21,69 @@ const LineRegExp = /\r\n|[\n\r]/g;
|
|
|
22
21
|
* import { Source, getLocation } from 'graphql/language';
|
|
23
22
|
*
|
|
24
23
|
* const source = new Source('type Query { hello: String }');
|
|
25
|
-
* const location = getLocation(source, 13);
|
|
26
|
-
*
|
|
27
|
-
* location; // => { line: 1, column: 14 }
|
|
24
|
+
* const location = getLocation(source, 13); // => { line: 1, column: 14 }
|
|
28
25
|
* ```
|
|
29
26
|
*/
|
|
30
27
|
function getLocation(source, position) {
|
|
31
|
-
|
|
28
|
+
const lineRegexp = /\r\n|[\n\r]/g;
|
|
32
29
|
let line = 1;
|
|
30
|
+
let column = position + 1;
|
|
31
|
+
let match;
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (match.index >= position) {
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
lastLineStart = match.index + match[0].length;
|
|
42
|
-
line += 1;
|
|
33
|
+
while ((match = lineRegexp.exec(source.body)) && match.index < position) {
|
|
34
|
+
line++;
|
|
35
|
+
column = position + 1 - (match.index + match[0].length);
|
|
43
36
|
}
|
|
44
37
|
|
|
45
38
|
return {
|
|
46
39
|
line,
|
|
47
|
-
column
|
|
40
|
+
column,
|
|
48
41
|
};
|
|
49
42
|
}
|
|
43
|
+
/** @internal */
|
|
44
|
+
|
|
45
|
+
function getLocations(locations) {
|
|
46
|
+
if (locations.length < 2) {
|
|
47
|
+
return locations.map(({ source, start }) => getLocation(source, start));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const bySource = new Map();
|
|
51
|
+
locations.forEach(({ source, start }, index) => {
|
|
52
|
+
let positions = bySource.get(source);
|
|
53
|
+
|
|
54
|
+
if (positions === undefined) {
|
|
55
|
+
positions = [];
|
|
56
|
+
bySource.set(source, positions);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
positions.push({
|
|
60
|
+
position: start,
|
|
61
|
+
index,
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
const result = new Array(locations.length);
|
|
65
|
+
|
|
66
|
+
for (const [source, positions] of bySource) {
|
|
67
|
+
const lineRegexp = /\r\n|[\n\r]/g;
|
|
68
|
+
let match = lineRegexp.exec(source.body);
|
|
69
|
+
let line = 1;
|
|
70
|
+
let lastLineStart = 0; // These arrays are local; sorting never changes the caller's input.
|
|
71
|
+
|
|
72
|
+
positions.sort((a, b) => a.position - b.position);
|
|
73
|
+
|
|
74
|
+
for (const { position, index } of positions) {
|
|
75
|
+
while (match !== null && match.index < position) {
|
|
76
|
+
lastLineStart = match.index + match[0].length;
|
|
77
|
+
line++;
|
|
78
|
+
match = lineRegexp.exec(source.body);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
result[index] = {
|
|
82
|
+
line,
|
|
83
|
+
column: position + 1 - lastLineStart,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return result;
|
|
89
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/** @category Source */
|
|
2
|
-
|
|
3
|
-
const LineRegExp = /\r\n|[\n\r]/g;
|
|
2
|
+
|
|
4
3
|
/** Represents a location in a Source. */
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -14,28 +13,69 @@ const LineRegExp = /\r\n|[\n\r]/g;
|
|
|
14
13
|
* import { Source, getLocation } from 'graphql/language';
|
|
15
14
|
*
|
|
16
15
|
* const source = new Source('type Query { hello: String }');
|
|
17
|
-
* const location = getLocation(source, 13);
|
|
18
|
-
*
|
|
19
|
-
* location; // => { line: 1, column: 14 }
|
|
16
|
+
* const location = getLocation(source, 13); // => { line: 1, column: 14 }
|
|
20
17
|
* ```
|
|
21
18
|
*/
|
|
22
19
|
export function getLocation(source, position) {
|
|
23
|
-
|
|
20
|
+
const lineRegexp = /\r\n|[\n\r]/g;
|
|
24
21
|
let line = 1;
|
|
22
|
+
let column = position + 1;
|
|
23
|
+
let match;
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (match.index >= position) {
|
|
30
|
-
break;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
lastLineStart = match.index + match[0].length;
|
|
34
|
-
line += 1;
|
|
25
|
+
while ((match = lineRegexp.exec(source.body)) && match.index < position) {
|
|
26
|
+
line++;
|
|
27
|
+
column = position + 1 - (match.index + match[0].length);
|
|
35
28
|
}
|
|
36
29
|
|
|
37
30
|
return {
|
|
38
31
|
line,
|
|
39
|
-
column
|
|
32
|
+
column,
|
|
40
33
|
};
|
|
41
34
|
}
|
|
35
|
+
/** @internal */
|
|
36
|
+
|
|
37
|
+
export function getLocations(locations) {
|
|
38
|
+
if (locations.length < 2) {
|
|
39
|
+
return locations.map(({ source, start }) => getLocation(source, start));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const bySource = new Map();
|
|
43
|
+
locations.forEach(({ source, start }, index) => {
|
|
44
|
+
let positions = bySource.get(source);
|
|
45
|
+
|
|
46
|
+
if (positions === undefined) {
|
|
47
|
+
positions = [];
|
|
48
|
+
bySource.set(source, positions);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
positions.push({
|
|
52
|
+
position: start,
|
|
53
|
+
index,
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
const result = new Array(locations.length);
|
|
57
|
+
|
|
58
|
+
for (const [source, positions] of bySource) {
|
|
59
|
+
const lineRegexp = /\r\n|[\n\r]/g;
|
|
60
|
+
let match = lineRegexp.exec(source.body);
|
|
61
|
+
let line = 1;
|
|
62
|
+
let lastLineStart = 0; // These arrays are local; sorting never changes the caller's input.
|
|
63
|
+
|
|
64
|
+
positions.sort((a, b) => a.position - b.position);
|
|
65
|
+
|
|
66
|
+
for (const { position, index } of positions) {
|
|
67
|
+
while (match !== null && match.index < position) {
|
|
68
|
+
lastLineStart = match.index + match[0].length;
|
|
69
|
+
line++;
|
|
70
|
+
match = lineRegexp.exec(source.body);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
result[index] = {
|
|
74
|
+
line,
|
|
75
|
+
column: position + 1 - lastLineStart,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
@@ -66,11 +66,22 @@ export interface ParseOptions {
|
|
|
66
66
|
*/
|
|
67
67
|
noLocation?: boolean;
|
|
68
68
|
/**
|
|
69
|
-
* Parser CPU and memory usage is linear to the number of tokens in a
|
|
70
|
-
* however in extreme cases it becomes quadratic due to memory
|
|
71
|
-
* Parsing happens before validation so even invalid queries can
|
|
72
|
-
* CPU time and memory.
|
|
73
|
-
*
|
|
69
|
+
* Parser CPU and memory usage is linear to the number of lexical tokens in a
|
|
70
|
+
* document; however, in extreme cases it becomes quadratic due to memory
|
|
71
|
+
* exhaustion. Parsing happens before validation, so even invalid queries can
|
|
72
|
+
* consume significant CPU time and memory.
|
|
73
|
+
*
|
|
74
|
+
* Use this option to limit the number of lexical tokens allowed in a document.
|
|
75
|
+
* This does not limit the length of the source text or of an individual token.
|
|
76
|
+
*/
|
|
77
|
+
maxLexicalTokens?: number | undefined;
|
|
78
|
+
/** Maximum number of comments. */
|
|
79
|
+
maxComments?: number | undefined;
|
|
80
|
+
/** Maximum source length in UTF-16 code units. */
|
|
81
|
+
maxSourceLength?: number | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Deprecated alias for `maxLexicalTokens`.
|
|
84
|
+
* @deprecated Use `maxLexicalTokens` instead. Will be removed in v18.
|
|
74
85
|
*/
|
|
75
86
|
maxTokens?: number | undefined;
|
|
76
87
|
/**
|
|
@@ -82,7 +93,7 @@ export interface ParseOptions {
|
|
|
82
93
|
* @example
|
|
83
94
|
* The syntax is identical to normal, query-defined variables.
|
|
84
95
|
*
|
|
85
|
-
* ```graphql
|
|
96
|
+
* ```graphql prettier-ignore
|
|
86
97
|
* fragment A($var: Boolean = false) on T {
|
|
87
98
|
* ...
|
|
88
99
|
* }
|
|
@@ -100,7 +111,7 @@ export interface ParseOptions {
|
|
|
100
111
|
* If enabled, the parser will parse directives on directive definitions.
|
|
101
112
|
* This syntax is not part of the GraphQL specification and may change.
|
|
102
113
|
* @example
|
|
103
|
-
* ```graphql
|
|
114
|
+
* ```graphql prettier-ignore
|
|
104
115
|
* directive @foo @bar on FIELD
|
|
105
116
|
* ```
|
|
106
117
|
*/
|
|
@@ -134,7 +145,7 @@ export interface ParseOptions {
|
|
|
134
145
|
*
|
|
135
146
|
* const document = parse('fragment A($var: Boolean) on Query { field }', {
|
|
136
147
|
* allowLegacyFragmentVariables: true,
|
|
137
|
-
*
|
|
148
|
+
* maxLexicalTokens: 20,
|
|
138
149
|
* noLocation: true,
|
|
139
150
|
* });
|
|
140
151
|
* const directiveDocument = parse('directive @foo @bar on FIELD', {
|
|
@@ -720,15 +731,18 @@ export declare class Parser {
|
|
|
720
731
|
* @returns Parsed schema coordinate AST.
|
|
721
732
|
* @example
|
|
722
733
|
* ```ts
|
|
723
|
-
* import
|
|
734
|
+
* import assert from 'node:assert/strict';
|
|
735
|
+
* import { Kind, parseSchemaCoordinate } from 'graphql/language';
|
|
724
736
|
*
|
|
725
|
-
* const typeCoordinate =
|
|
726
|
-
* const directiveCoordinate =
|
|
737
|
+
* const typeCoordinate = parseSchemaCoordinate('User.name');
|
|
738
|
+
* const directiveCoordinate = parseSchemaCoordinate('@include(if:)');
|
|
739
|
+
* assert(typeCoordinate.kind === Kind.MEMBER_COORDINATE);
|
|
740
|
+
* assert(directiveCoordinate.kind === Kind.DIRECTIVE_ARGUMENT_COORDINATE);
|
|
727
741
|
*
|
|
728
742
|
* typeCoordinate.name.value; // => 'User'
|
|
729
743
|
* typeCoordinate.memberName?.value; // => 'name'
|
|
730
|
-
* directiveCoordinate.name.value; // => '
|
|
731
|
-
* directiveCoordinate.argumentName?.value; // => '
|
|
744
|
+
* directiveCoordinate.name.value; // => 'include'
|
|
745
|
+
* directiveCoordinate.argumentName?.value; // => 'if'
|
|
732
746
|
* ```
|
|
733
747
|
*/
|
|
734
748
|
parseSchemaCoordinate(): SchemaCoordinateNode;
|