graphql 16.14.1 → 16.15.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/error/GraphQLError.d.ts +5 -1
- package/error/GraphQLError.js +12 -7
- package/error/GraphQLError.mjs +13 -6
- package/error/locatedError.d.ts +6 -4
- package/error/locatedError.js +6 -4
- package/error/locatedError.mjs +6 -4
- package/execution/collectFields.d.ts +1 -0
- package/execution/collectFields.js +9 -0
- package/execution/collectFields.mjs +9 -0
- package/execution/execute.d.ts +9 -10
- package/execution/execute.js +44 -29
- package/execution/execute.mjs +44 -29
- package/execution/mapAsyncIterator.js +12 -11
- package/execution/mapAsyncIterator.mjs +12 -11
- package/execution/subscribe.d.ts +5 -2
- package/execution/subscribe.js +5 -2
- package/execution/subscribe.mjs +5 -2
- package/execution/values.d.ts +43 -21
- package/execution/values.js +52 -24
- package/execution/values.mjs +51 -23
- package/graphql.d.ts +8 -14
- package/graphql.js +16 -15
- package/graphql.mjs +11 -15
- package/jsutils/SetMap.d.ts +14 -0
- package/jsutils/SetMap.js +48 -0
- package/jsutils/SetMap.mjs +39 -0
- package/jsutils/isIterableObject.d.ts +2 -0
- package/jsutils/isIterableObject.js +2 -0
- package/jsutils/isIterableObject.mjs +2 -0
- package/jsutils/keyMap.d.ts +2 -0
- package/jsutils/keyMap.js +2 -0
- package/jsutils/keyMap.mjs +2 -0
- package/jsutils/keyValMap.d.ts +3 -3
- package/jsutils/keyValMap.js +3 -3
- package/jsutils/keyValMap.mjs +3 -3
- package/language/ast.d.ts +2 -6
- package/language/ast.js +2 -6
- package/language/ast.mjs +2 -6
- package/language/lexer.d.ts +6 -0
- package/language/lexer.js +22 -0
- package/language/lexer.mjs +22 -0
- package/language/location.d.ts +8 -3
- package/language/location.js +57 -17
- package/language/location.mjs +56 -16
- package/language/parser.d.ts +27 -13
- package/language/parser.js +31 -9
- package/language/parser.mjs +31 -9
- package/language/predicates.d.ts +10 -3
- package/language/predicates.js +10 -3
- package/language/predicates.mjs +10 -3
- package/language/printLocation.d.ts +2 -6
- package/language/printLocation.js +2 -6
- package/language/printLocation.mjs +2 -6
- package/language/printer.d.ts +22 -3
- package/language/printer.js +394 -308
- package/language/printer.mjs +394 -308
- package/language/reducer.d.ts +32 -0
- package/language/reducer.js +95 -0
- package/language/reducer.mjs +86 -0
- package/language/source.d.ts +4 -5
- package/language/source.js +4 -5
- package/language/source.mjs +4 -5
- package/language/visitor.d.ts +16 -10
- package/language/visitor.js +15 -7
- package/language/visitor.mjs +15 -7
- package/package.json +1 -4
- package/type/definition.d.ts +190 -122
- package/type/definition.js +175 -102
- package/type/definition.mjs +174 -101
- package/type/directives.d.ts +14 -8
- package/type/directives.js +13 -7
- package/type/directives.mjs +13 -7
- package/type/scalars.js +8 -11
- package/type/scalars.mjs +1 -1
- package/type/schema.d.ts +38 -13
- package/type/schema.js +36 -11
- package/type/schema.mjs +36 -11
- package/type/validate.d.ts +1 -3
- package/type/validate.js +1 -3
- package/type/validate.mjs +1 -3
- package/utilities/TypeInfo.d.ts +15 -11
- package/utilities/TypeInfo.js +15 -11
- package/utilities/TypeInfo.mjs +15 -11
- package/utilities/assertValidName.d.ts +1 -1
- package/utilities/assertValidName.js +1 -1
- package/utilities/assertValidName.mjs +1 -1
- package/utilities/astFromValue.d.ts +3 -1
- package/utilities/astFromValue.js +3 -1
- package/utilities/astFromValue.mjs +3 -1
- package/utilities/buildASTSchema.d.ts +8 -8
- package/utilities/buildASTSchema.js +9 -20
- package/utilities/buildASTSchema.mjs +9 -20
- package/utilities/buildClientSchema.d.ts +6 -2
- package/utilities/buildClientSchema.js +6 -2
- package/utilities/buildClientSchema.mjs +6 -2
- package/utilities/coerceInputValue.d.ts +9 -3
- package/utilities/coerceInputValue.js +60 -13
- package/utilities/coerceInputValue.mjs +58 -13
- package/utilities/concatAST.d.ts +4 -1
- package/utilities/concatAST.js +4 -1
- package/utilities/concatAST.mjs +4 -1
- package/utilities/extendSchema.d.ts +7 -4
- package/utilities/extendSchema.js +7 -4
- package/utilities/extendSchema.mjs +7 -4
- package/utilities/findBreakingChanges.d.ts +2 -2
- package/utilities/findBreakingChanges.js +2 -2
- package/utilities/findBreakingChanges.mjs +2 -2
- package/utilities/getIntrospectionQuery.d.ts +9 -9
- package/utilities/getIntrospectionQuery.js +8 -8
- package/utilities/getIntrospectionQuery.mjs +8 -8
- package/utilities/getOperationAST.d.ts +2 -2
- package/utilities/getOperationAST.js +2 -2
- package/utilities/getOperationAST.mjs +2 -2
- package/utilities/getOperationRootType.d.ts +3 -1
- package/utilities/getOperationRootType.js +3 -1
- package/utilities/getOperationRootType.mjs +3 -1
- package/utilities/introspectionFromSchema.d.ts +12 -4
- package/utilities/introspectionFromSchema.js +12 -4
- package/utilities/introspectionFromSchema.mjs +12 -4
- package/utilities/lexicographicSortSchema.d.ts +17 -13
- package/utilities/lexicographicSortSchema.js +17 -13
- package/utilities/lexicographicSortSchema.mjs +17 -13
- package/utilities/printSchema.d.ts +7 -4
- package/utilities/printSchema.js +7 -4
- package/utilities/printSchema.mjs +7 -4
- package/utilities/resolveSchemaCoordinate.d.ts +9 -8
- package/utilities/resolveSchemaCoordinate.js +9 -8
- package/utilities/resolveSchemaCoordinate.mjs +9 -8
- package/utilities/separateOperations.d.ts +2 -2
- package/utilities/separateOperations.js +2 -2
- package/utilities/separateOperations.mjs +2 -2
- package/utilities/stripIgnoredCharacters.d.ts +19 -5
- package/utilities/stripIgnoredCharacters.js +19 -5
- package/utilities/stripIgnoredCharacters.mjs +19 -5
- package/utilities/typeComparators.d.ts +1 -5
- package/utilities/typeComparators.js +1 -5
- package/utilities/typeComparators.mjs +1 -5
- package/utilities/valueFromAST.js +4 -4
- package/utilities/valueFromAST.mjs +4 -4
- package/utilities/valueFromASTUntyped.d.ts +1 -3
- package/utilities/valueFromASTUntyped.js +1 -3
- package/utilities/valueFromASTUntyped.mjs +1 -3
- package/validation/ValidationContext.d.ts +22 -3
- package/validation/ValidationContext.js +84 -27
- package/validation/ValidationContext.mjs +82 -27
- package/validation/rules/ExecutableDefinitionsRule.d.ts +6 -4
- package/validation/rules/ExecutableDefinitionsRule.js +6 -4
- package/validation/rules/ExecutableDefinitionsRule.mjs +6 -4
- package/validation/rules/FieldsOnCorrectTypeRule.d.ts +4 -4
- package/validation/rules/FieldsOnCorrectTypeRule.js +10 -6
- package/validation/rules/FieldsOnCorrectTypeRule.mjs +12 -6
- package/validation/rules/FragmentsOnCompositeTypesRule.d.ts +6 -4
- package/validation/rules/FragmentsOnCompositeTypesRule.js +6 -4
- package/validation/rules/FragmentsOnCompositeTypesRule.mjs +6 -4
- package/validation/rules/KnownArgumentNamesRule.d.ts +4 -4
- package/validation/rules/KnownArgumentNamesRule.js +26 -17
- package/validation/rules/KnownArgumentNamesRule.mjs +21 -11
- package/validation/rules/KnownDirectivesRule.d.ts +1 -3
- package/validation/rules/KnownDirectivesRule.js +1 -3
- package/validation/rules/KnownDirectivesRule.mjs +1 -3
- package/validation/rules/KnownFragmentNamesRule.d.ts +4 -4
- package/validation/rules/KnownFragmentNamesRule.js +4 -4
- package/validation/rules/KnownFragmentNamesRule.mjs +4 -4
- package/validation/rules/KnownTypeNamesRule.d.ts +1 -3
- package/validation/rules/KnownTypeNamesRule.js +7 -7
- package/validation/rules/KnownTypeNamesRule.mjs +7 -7
- package/validation/rules/LoneAnonymousOperationRule.d.ts +6 -4
- package/validation/rules/LoneAnonymousOperationRule.js +6 -4
- package/validation/rules/LoneAnonymousOperationRule.mjs +6 -4
- package/validation/rules/MaxIntrospectionDepthRule.d.ts +6 -4
- package/validation/rules/MaxIntrospectionDepthRule.js +44 -19
- package/validation/rules/MaxIntrospectionDepthRule.mjs +44 -19
- package/validation/rules/NoFragmentCyclesRule.d.ts +1 -3
- package/validation/rules/NoFragmentCyclesRule.js +1 -3
- package/validation/rules/NoFragmentCyclesRule.mjs +1 -3
- package/validation/rules/NoUndefinedVariablesRule.d.ts +4 -4
- package/validation/rules/NoUndefinedVariablesRule.js +4 -4
- package/validation/rules/NoUndefinedVariablesRule.mjs +4 -4
- package/validation/rules/NoUnusedFragmentsRule.d.ts +4 -4
- package/validation/rules/NoUnusedFragmentsRule.js +10 -14
- package/validation/rules/NoUnusedFragmentsRule.mjs +10 -14
- package/validation/rules/NoUnusedVariablesRule.d.ts +4 -4
- package/validation/rules/NoUnusedVariablesRule.js +4 -4
- package/validation/rules/NoUnusedVariablesRule.mjs +4 -4
- package/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts +8 -6
- package/validation/rules/OverlappingFieldsCanBeMergedRule.js +552 -354
- package/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +545 -352
- package/validation/rules/PossibleFragmentSpreadsRule.d.ts +6 -4
- package/validation/rules/PossibleFragmentSpreadsRule.js +6 -4
- package/validation/rules/PossibleFragmentSpreadsRule.mjs +6 -4
- package/validation/rules/ProvidedRequiredArgumentsRule.d.ts +6 -4
- package/validation/rules/ProvidedRequiredArgumentsRule.js +6 -4
- package/validation/rules/ProvidedRequiredArgumentsRule.mjs +6 -4
- package/validation/rules/ScalarLeafsRule.d.ts +1 -3
- package/validation/rules/ScalarLeafsRule.js +1 -3
- package/validation/rules/ScalarLeafsRule.mjs +1 -3
- package/validation/rules/SingleFieldSubscriptionsRule.d.ts +6 -4
- package/validation/rules/SingleFieldSubscriptionsRule.js +50 -9
- package/validation/rules/SingleFieldSubscriptionsRule.mjs +50 -9
- package/validation/rules/UniqueArgumentNamesRule.d.ts +4 -4
- package/validation/rules/UniqueArgumentNamesRule.js +4 -4
- package/validation/rules/UniqueArgumentNamesRule.mjs +4 -4
- package/validation/rules/UniqueDirectivesPerLocationRule.d.ts +6 -4
- package/validation/rules/UniqueDirectivesPerLocationRule.js +6 -4
- package/validation/rules/UniqueDirectivesPerLocationRule.mjs +6 -4
- package/validation/rules/UniqueFragmentNamesRule.d.ts +4 -4
- package/validation/rules/UniqueFragmentNamesRule.js +4 -4
- package/validation/rules/UniqueFragmentNamesRule.mjs +4 -4
- package/validation/rules/UniqueInputFieldNamesRule.d.ts +6 -4
- package/validation/rules/UniqueInputFieldNamesRule.js +6 -4
- package/validation/rules/UniqueInputFieldNamesRule.mjs +6 -4
- package/validation/rules/UniqueOperationNamesRule.d.ts +4 -4
- package/validation/rules/UniqueOperationNamesRule.js +4 -4
- package/validation/rules/UniqueOperationNamesRule.mjs +4 -4
- package/validation/rules/UniqueVariableNamesRule.d.ts +4 -4
- package/validation/rules/UniqueVariableNamesRule.js +4 -4
- package/validation/rules/UniqueVariableNamesRule.mjs +4 -4
- package/validation/rules/ValuesOfCorrectTypeRule.d.ts +4 -4
- package/validation/rules/ValuesOfCorrectTypeRule.js +29 -23
- package/validation/rules/ValuesOfCorrectTypeRule.mjs +24 -14
- package/validation/rules/VariablesAreInputTypesRule.d.ts +6 -4
- package/validation/rules/VariablesAreInputTypesRule.js +6 -4
- package/validation/rules/VariablesAreInputTypesRule.mjs +6 -4
- package/validation/rules/VariablesInAllowedPositionRule.d.ts +6 -4
- package/validation/rules/VariablesInAllowedPositionRule.js +6 -4
- package/validation/rules/VariablesInAllowedPositionRule.mjs +6 -4
- package/validation/rules/custom/NoDeprecatedCustomRule.d.ts +4 -4
- package/validation/rules/custom/NoDeprecatedCustomRule.js +4 -4
- package/validation/rules/custom/NoDeprecatedCustomRule.mjs +4 -4
- package/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts +7 -5
- package/validation/rules/custom/NoSchemaIntrospectionCustomRule.js +7 -5
- package/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs +7 -5
- package/validation/validate.d.ts +2 -0
- package/validation/validate.js +14 -2
- package/validation/validate.mjs +13 -2
- package/validation/validationAbortedError.d.ts +3 -0
- package/validation/validationAbortedError.js +14 -0
- package/validation/validationAbortedError.mjs +4 -0
- package/version.js +3 -3
- package/version.mjs +3 -3
|
@@ -19,11 +19,13 @@ var _GraphQLError = require('../error/GraphQLError.js');
|
|
|
19
19
|
* @returns The resolved operation root type.
|
|
20
20
|
* @example
|
|
21
21
|
* ```ts
|
|
22
|
+
* import assert from 'node:assert/strict';
|
|
22
23
|
* import { buildSchema, getOperationRootType } from 'graphql/utilities';
|
|
23
|
-
* import { parse } from 'graphql/language';
|
|
24
|
+
* import { parse, Kind } from 'graphql/language';
|
|
24
25
|
*
|
|
25
26
|
* const schema = buildSchema('type Query { name: String }');
|
|
26
27
|
* const operation = parse('{ name }').definitions[0];
|
|
28
|
+
* assert(operation.kind === Kind.OPERATION_DEFINITION);
|
|
27
29
|
* const rootType = getOperationRootType(schema, operation);
|
|
28
30
|
*
|
|
29
31
|
* rootType.name; // => 'Query'
|
|
@@ -11,11 +11,13 @@ import { GraphQLError } from '../error/GraphQLError.mjs';
|
|
|
11
11
|
* @returns The resolved operation root type.
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
14
|
+
* import assert from 'node:assert/strict';
|
|
14
15
|
* import { buildSchema, getOperationRootType } from 'graphql/utilities';
|
|
15
|
-
* import { parse } from 'graphql/language';
|
|
16
|
+
* import { parse, Kind } from 'graphql/language';
|
|
16
17
|
*
|
|
17
18
|
* const schema = buildSchema('type Query { name: String }');
|
|
18
19
|
* const operation = parse('{ name }').definitions[0];
|
|
20
|
+
* assert(operation.kind === Kind.OPERATION_DEFINITION);
|
|
19
21
|
* const rootType = getOperationRootType(schema, operation);
|
|
20
22
|
*
|
|
21
23
|
* rootType.name; // => 'Query'
|
|
@@ -17,6 +17,7 @@ import type {
|
|
|
17
17
|
* @returns Introspection result data for the schema.
|
|
18
18
|
* @example
|
|
19
19
|
* ```ts
|
|
20
|
+
* import assert from 'node:assert/strict';
|
|
20
21
|
* // Include schema metadata using the default introspection options.
|
|
21
22
|
* import { buildSchema, introspectionFromSchema } from 'graphql/utilities';
|
|
22
23
|
*
|
|
@@ -29,12 +30,16 @@ import type {
|
|
|
29
30
|
* `);
|
|
30
31
|
*
|
|
31
32
|
* const introspection = introspectionFromSchema(schema);
|
|
32
|
-
* const urlType = introspection.__schema.types.find(
|
|
33
|
+
* const urlType = introspection.__schema.types.find(
|
|
34
|
+
* (type) => type.name === 'Url',
|
|
35
|
+
* );
|
|
36
|
+
* assert(urlType?.kind === 'SCALAR');
|
|
33
37
|
*
|
|
34
38
|
* urlType.specifiedByURL; // => 'https://url.spec.whatwg.org/'
|
|
35
39
|
* ```
|
|
36
40
|
* @example
|
|
37
41
|
* ```ts
|
|
42
|
+
* import assert from 'node:assert/strict';
|
|
38
43
|
* // This variant disables optional introspection metadata.
|
|
39
44
|
* import { buildSchema, introspectionFromSchema } from 'graphql/utilities';
|
|
40
45
|
*
|
|
@@ -55,15 +60,18 @@ import type {
|
|
|
55
60
|
* experimentalDirectiveDeprecation: false,
|
|
56
61
|
* oneOf: false,
|
|
57
62
|
* });
|
|
58
|
-
* const urlType = introspection.__schema.types.find(
|
|
63
|
+
* const urlType = introspection.__schema.types.find(
|
|
64
|
+
* (type) => type.name === 'Url',
|
|
65
|
+
* );
|
|
66
|
+
* assert(urlType?.kind === 'SCALAR');
|
|
59
67
|
* const deprecatedDirective = introspection.__schema.directives.find(
|
|
60
68
|
* (directive) => directive.name === 'deprecated',
|
|
61
69
|
* );
|
|
62
70
|
*
|
|
63
|
-
* urlType.specifiedByURL; // => undefined
|
|
64
71
|
* urlType.description; // => undefined
|
|
72
|
+
* urlType.specifiedByURL; // => undefined
|
|
73
|
+
* deprecatedDirective?.isRepeatable; // => undefined
|
|
65
74
|
* introspection.__schema.description; // => undefined
|
|
66
|
-
* deprecatedDirective.isRepeatable; // => undefined
|
|
67
75
|
* ```
|
|
68
76
|
*/
|
|
69
77
|
export declare function introspectionFromSchema(
|
|
@@ -28,6 +28,7 @@ var _getIntrospectionQuery = require('./getIntrospectionQuery.js');
|
|
|
28
28
|
* @returns Introspection result data for the schema.
|
|
29
29
|
* @example
|
|
30
30
|
* ```ts
|
|
31
|
+
* import assert from 'node:assert/strict';
|
|
31
32
|
* // Include schema metadata using the default introspection options.
|
|
32
33
|
* import { buildSchema, introspectionFromSchema } from 'graphql/utilities';
|
|
33
34
|
*
|
|
@@ -40,12 +41,16 @@ var _getIntrospectionQuery = require('./getIntrospectionQuery.js');
|
|
|
40
41
|
* `);
|
|
41
42
|
*
|
|
42
43
|
* const introspection = introspectionFromSchema(schema);
|
|
43
|
-
* const urlType = introspection.__schema.types.find(
|
|
44
|
+
* const urlType = introspection.__schema.types.find(
|
|
45
|
+
* (type) => type.name === 'Url',
|
|
46
|
+
* );
|
|
47
|
+
* assert(urlType?.kind === 'SCALAR');
|
|
44
48
|
*
|
|
45
49
|
* urlType.specifiedByURL; // => 'https://url.spec.whatwg.org/'
|
|
46
50
|
* ```
|
|
47
51
|
* @example
|
|
48
52
|
* ```ts
|
|
53
|
+
* import assert from 'node:assert/strict';
|
|
49
54
|
* // This variant disables optional introspection metadata.
|
|
50
55
|
* import { buildSchema, introspectionFromSchema } from 'graphql/utilities';
|
|
51
56
|
*
|
|
@@ -66,15 +71,18 @@ var _getIntrospectionQuery = require('./getIntrospectionQuery.js');
|
|
|
66
71
|
* experimentalDirectiveDeprecation: false,
|
|
67
72
|
* oneOf: false,
|
|
68
73
|
* });
|
|
69
|
-
* const urlType = introspection.__schema.types.find(
|
|
74
|
+
* const urlType = introspection.__schema.types.find(
|
|
75
|
+
* (type) => type.name === 'Url',
|
|
76
|
+
* );
|
|
77
|
+
* assert(urlType?.kind === 'SCALAR');
|
|
70
78
|
* const deprecatedDirective = introspection.__schema.directives.find(
|
|
71
79
|
* (directive) => directive.name === 'deprecated',
|
|
72
80
|
* );
|
|
73
81
|
*
|
|
74
|
-
* urlType.specifiedByURL; // => undefined
|
|
75
82
|
* urlType.description; // => undefined
|
|
83
|
+
* urlType.specifiedByURL; // => undefined
|
|
84
|
+
* deprecatedDirective?.isRepeatable; // => undefined
|
|
76
85
|
* introspection.__schema.description; // => undefined
|
|
77
|
-
* deprecatedDirective.isRepeatable; // => undefined
|
|
78
86
|
* ```
|
|
79
87
|
*/
|
|
80
88
|
function introspectionFromSchema(schema, options) {
|
|
@@ -16,6 +16,7 @@ import { getIntrospectionQuery } from './getIntrospectionQuery.mjs';
|
|
|
16
16
|
* @returns Introspection result data for the schema.
|
|
17
17
|
* @example
|
|
18
18
|
* ```ts
|
|
19
|
+
* import assert from 'node:assert/strict';
|
|
19
20
|
* // Include schema metadata using the default introspection options.
|
|
20
21
|
* import { buildSchema, introspectionFromSchema } from 'graphql/utilities';
|
|
21
22
|
*
|
|
@@ -28,12 +29,16 @@ import { getIntrospectionQuery } from './getIntrospectionQuery.mjs';
|
|
|
28
29
|
* `);
|
|
29
30
|
*
|
|
30
31
|
* const introspection = introspectionFromSchema(schema);
|
|
31
|
-
* const urlType = introspection.__schema.types.find(
|
|
32
|
+
* const urlType = introspection.__schema.types.find(
|
|
33
|
+
* (type) => type.name === 'Url',
|
|
34
|
+
* );
|
|
35
|
+
* assert(urlType?.kind === 'SCALAR');
|
|
32
36
|
*
|
|
33
37
|
* urlType.specifiedByURL; // => 'https://url.spec.whatwg.org/'
|
|
34
38
|
* ```
|
|
35
39
|
* @example
|
|
36
40
|
* ```ts
|
|
41
|
+
* import assert from 'node:assert/strict';
|
|
37
42
|
* // This variant disables optional introspection metadata.
|
|
38
43
|
* import { buildSchema, introspectionFromSchema } from 'graphql/utilities';
|
|
39
44
|
*
|
|
@@ -54,15 +59,18 @@ import { getIntrospectionQuery } from './getIntrospectionQuery.mjs';
|
|
|
54
59
|
* experimentalDirectiveDeprecation: false,
|
|
55
60
|
* oneOf: false,
|
|
56
61
|
* });
|
|
57
|
-
* const urlType = introspection.__schema.types.find(
|
|
62
|
+
* const urlType = introspection.__schema.types.find(
|
|
63
|
+
* (type) => type.name === 'Url',
|
|
64
|
+
* );
|
|
65
|
+
* assert(urlType?.kind === 'SCALAR');
|
|
58
66
|
* const deprecatedDirective = introspection.__schema.directives.find(
|
|
59
67
|
* (directive) => directive.name === 'deprecated',
|
|
60
68
|
* );
|
|
61
69
|
*
|
|
62
|
-
* urlType.specifiedByURL; // => undefined
|
|
63
70
|
* urlType.description; // => undefined
|
|
71
|
+
* urlType.specifiedByURL; // => undefined
|
|
72
|
+
* deprecatedDirective?.isRepeatable; // => undefined
|
|
64
73
|
* introspection.__schema.description; // => undefined
|
|
65
|
-
* deprecatedDirective.isRepeatable; // => undefined
|
|
66
74
|
* ```
|
|
67
75
|
*/
|
|
68
76
|
|
|
@@ -8,7 +8,11 @@ import { GraphQLSchema } from '../type/schema';
|
|
|
8
8
|
* @returns A copy of the schema with types, fields, arguments, and values sorted lexicographically.
|
|
9
9
|
* @example
|
|
10
10
|
* ```ts
|
|
11
|
-
* import {
|
|
11
|
+
* import {
|
|
12
|
+
* buildSchema,
|
|
13
|
+
* lexicographicSortSchema,
|
|
14
|
+
* printSchema,
|
|
15
|
+
* } from 'graphql/utilities';
|
|
12
16
|
*
|
|
13
17
|
* const schema = buildSchema(`
|
|
14
18
|
* type Query {
|
|
@@ -25,18 +29,18 @@ import { GraphQLSchema } from '../type/schema';
|
|
|
25
29
|
*
|
|
26
30
|
* const sortedSchema = lexicographicSortSchema(schema);
|
|
27
31
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* //
|
|
32
|
+
* const expectedSDL = `enum Episode {
|
|
33
|
+
* EMPIRE
|
|
34
|
+
* JEDI
|
|
35
|
+
* NEW_HOPE
|
|
36
|
+
* }
|
|
37
|
+
*
|
|
38
|
+
* type Query {
|
|
39
|
+
* apple: String
|
|
40
|
+
* zebra: String
|
|
41
|
+
* }`;
|
|
42
|
+
*
|
|
43
|
+
* printSchema(sortedSchema); // => expectedSDL
|
|
40
44
|
* ```
|
|
41
45
|
*/
|
|
42
46
|
export declare function lexicographicSortSchema(
|
|
@@ -31,7 +31,11 @@ var _schema = require('../type/schema.js');
|
|
|
31
31
|
* @returns A copy of the schema with types, fields, arguments, and values sorted lexicographically.
|
|
32
32
|
* @example
|
|
33
33
|
* ```ts
|
|
34
|
-
* import {
|
|
34
|
+
* import {
|
|
35
|
+
* buildSchema,
|
|
36
|
+
* lexicographicSortSchema,
|
|
37
|
+
* printSchema,
|
|
38
|
+
* } from 'graphql/utilities';
|
|
35
39
|
*
|
|
36
40
|
* const schema = buildSchema(`
|
|
37
41
|
* type Query {
|
|
@@ -48,18 +52,18 @@ var _schema = require('../type/schema.js');
|
|
|
48
52
|
*
|
|
49
53
|
* const sortedSchema = lexicographicSortSchema(schema);
|
|
50
54
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* //
|
|
55
|
+
* const expectedSDL = `enum Episode {
|
|
56
|
+
* EMPIRE
|
|
57
|
+
* JEDI
|
|
58
|
+
* NEW_HOPE
|
|
59
|
+
* }
|
|
60
|
+
*
|
|
61
|
+
* type Query {
|
|
62
|
+
* apple: String
|
|
63
|
+
* zebra: String
|
|
64
|
+
* }`;
|
|
65
|
+
*
|
|
66
|
+
* printSchema(sortedSchema); // => expectedSDL
|
|
63
67
|
* ```
|
|
64
68
|
*/
|
|
65
69
|
function lexicographicSortSchema(schema) {
|
|
@@ -31,7 +31,11 @@ import { GraphQLSchema } from '../type/schema.mjs';
|
|
|
31
31
|
* @returns A copy of the schema with types, fields, arguments, and values sorted lexicographically.
|
|
32
32
|
* @example
|
|
33
33
|
* ```ts
|
|
34
|
-
* import {
|
|
34
|
+
* import {
|
|
35
|
+
* buildSchema,
|
|
36
|
+
* lexicographicSortSchema,
|
|
37
|
+
* printSchema,
|
|
38
|
+
* } from 'graphql/utilities';
|
|
35
39
|
*
|
|
36
40
|
* const schema = buildSchema(`
|
|
37
41
|
* type Query {
|
|
@@ -48,18 +52,18 @@ import { GraphQLSchema } from '../type/schema.mjs';
|
|
|
48
52
|
*
|
|
49
53
|
* const sortedSchema = lexicographicSortSchema(schema);
|
|
50
54
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* //
|
|
55
|
+
* const expectedSDL = `enum Episode {
|
|
56
|
+
* EMPIRE
|
|
57
|
+
* JEDI
|
|
58
|
+
* NEW_HOPE
|
|
59
|
+
* }
|
|
60
|
+
*
|
|
61
|
+
* type Query {
|
|
62
|
+
* apple: String
|
|
63
|
+
* zebra: String
|
|
64
|
+
* }`;
|
|
65
|
+
*
|
|
66
|
+
* printSchema(sortedSchema); // => expectedSDL
|
|
63
67
|
* ```
|
|
64
68
|
*/
|
|
65
69
|
|
|
@@ -37,9 +37,9 @@ export declare function printSchema(schema: GraphQLSchema): string;
|
|
|
37
37
|
*
|
|
38
38
|
* const printed = printIntrospectionSchema(schema);
|
|
39
39
|
*
|
|
40
|
-
* printed; //
|
|
41
|
-
* printed; //
|
|
42
|
-
* printed; //
|
|
40
|
+
* printed.includes('type __Schema'); // => true
|
|
41
|
+
* printed.includes('enum __TypeKind'); // => true
|
|
42
|
+
* printed.includes('type Query'); // => false
|
|
43
43
|
* ```
|
|
44
44
|
*/
|
|
45
45
|
export declare function printIntrospectionSchema(schema: GraphQLSchema): string;
|
|
@@ -49,6 +49,7 @@ export declare function printIntrospectionSchema(schema: GraphQLSchema): string;
|
|
|
49
49
|
* @returns The printed string representation.
|
|
50
50
|
* @example
|
|
51
51
|
* ```ts
|
|
52
|
+
* import assert from 'node:assert/strict';
|
|
52
53
|
* import { buildSchema, printType } from 'graphql/utilities';
|
|
53
54
|
*
|
|
54
55
|
* const schema = buildSchema(`
|
|
@@ -62,7 +63,9 @@ export declare function printIntrospectionSchema(schema: GraphQLSchema): string;
|
|
|
62
63
|
* }
|
|
63
64
|
* `);
|
|
64
65
|
*
|
|
65
|
-
*
|
|
66
|
+
* const userType = schema.getType('User');
|
|
67
|
+
* assert(userType);
|
|
68
|
+
* printType(userType); // => ['type User {', ' id: ID!', ' name: String', '}'].join('\n')
|
|
66
69
|
* ```
|
|
67
70
|
*/
|
|
68
71
|
export declare function printType(type: GraphQLNamedType): string;
|
package/utilities/printSchema.js
CHANGED
|
@@ -71,9 +71,9 @@ function printSchema(schema) {
|
|
|
71
71
|
*
|
|
72
72
|
* const printed = printIntrospectionSchema(schema);
|
|
73
73
|
*
|
|
74
|
-
* printed; //
|
|
75
|
-
* printed; //
|
|
76
|
-
* printed; //
|
|
74
|
+
* printed.includes('type __Schema'); // => true
|
|
75
|
+
* printed.includes('enum __TypeKind'); // => true
|
|
76
|
+
* printed.includes('type Query'); // => false
|
|
77
77
|
* ```
|
|
78
78
|
*/
|
|
79
79
|
|
|
@@ -175,6 +175,7 @@ function isSchemaOfCommonNames(schema) {
|
|
|
175
175
|
* @returns The printed string representation.
|
|
176
176
|
* @example
|
|
177
177
|
* ```ts
|
|
178
|
+
* import assert from 'node:assert/strict';
|
|
178
179
|
* import { buildSchema, printType } from 'graphql/utilities';
|
|
179
180
|
*
|
|
180
181
|
* const schema = buildSchema(`
|
|
@@ -188,7 +189,9 @@ function isSchemaOfCommonNames(schema) {
|
|
|
188
189
|
* }
|
|
189
190
|
* `);
|
|
190
191
|
*
|
|
191
|
-
*
|
|
192
|
+
* const userType = schema.getType('User');
|
|
193
|
+
* assert(userType);
|
|
194
|
+
* printType(userType); // => ['type User {', ' id: ID!', ' name: String', '}'].join('\n')
|
|
192
195
|
* ```
|
|
193
196
|
*/
|
|
194
197
|
|
|
@@ -62,9 +62,9 @@ export function printSchema(schema) {
|
|
|
62
62
|
*
|
|
63
63
|
* const printed = printIntrospectionSchema(schema);
|
|
64
64
|
*
|
|
65
|
-
* printed; //
|
|
66
|
-
* printed; //
|
|
67
|
-
* printed; //
|
|
65
|
+
* printed.includes('type __Schema'); // => true
|
|
66
|
+
* printed.includes('enum __TypeKind'); // => true
|
|
67
|
+
* printed.includes('type Query'); // => false
|
|
68
68
|
* ```
|
|
69
69
|
*/
|
|
70
70
|
|
|
@@ -159,6 +159,7 @@ function isSchemaOfCommonNames(schema) {
|
|
|
159
159
|
* @returns The printed string representation.
|
|
160
160
|
* @example
|
|
161
161
|
* ```ts
|
|
162
|
+
* import assert from 'node:assert/strict';
|
|
162
163
|
* import { buildSchema, printType } from 'graphql/utilities';
|
|
163
164
|
*
|
|
164
165
|
* const schema = buildSchema(`
|
|
@@ -172,7 +173,9 @@ function isSchemaOfCommonNames(schema) {
|
|
|
172
173
|
* }
|
|
173
174
|
* `);
|
|
174
175
|
*
|
|
175
|
-
*
|
|
176
|
+
* const userType = schema.getType('User');
|
|
177
|
+
* assert(userType);
|
|
178
|
+
* printType(userType); // => ['type User {', ' id: ID!', ' name: String', '}'].join('\n')
|
|
176
179
|
* ```
|
|
177
180
|
*/
|
|
178
181
|
|
|
@@ -99,13 +99,13 @@ export declare type ResolvedSchemaElement =
|
|
|
99
99
|
* }
|
|
100
100
|
* `);
|
|
101
101
|
*
|
|
102
|
-
* resolveSchemaCoordinate(schema, 'Query')
|
|
103
|
-
* resolveSchemaCoordinate(schema, 'Query.reviews')
|
|
104
|
-
* resolveSchemaCoordinate(schema, 'Query.reviews(input:)')
|
|
105
|
-
* resolveSchemaCoordinate(schema, 'ReviewInput.stars')
|
|
106
|
-
* resolveSchemaCoordinate(schema, 'Episode.NEW_HOPE')
|
|
107
|
-
* resolveSchemaCoordinate(schema, '@tag')
|
|
108
|
-
* resolveSchemaCoordinate(schema, '@tag(name:)')
|
|
102
|
+
* resolveSchemaCoordinate(schema, 'Query')?.kind; // => 'NamedType'
|
|
103
|
+
* resolveSchemaCoordinate(schema, 'Query.reviews')?.kind; // => 'Field'
|
|
104
|
+
* resolveSchemaCoordinate(schema, 'Query.reviews(input:)')?.kind; // => 'FieldArgument'
|
|
105
|
+
* resolveSchemaCoordinate(schema, 'ReviewInput.stars')?.kind; // => 'InputField'
|
|
106
|
+
* resolveSchemaCoordinate(schema, 'Episode.NEW_HOPE')?.kind; // => 'EnumValue'
|
|
107
|
+
* resolveSchemaCoordinate(schema, '@tag')?.kind; // => 'Directive'
|
|
108
|
+
* resolveSchemaCoordinate(schema, '@tag(name:)')?.kind; // => 'DirectiveArgument'
|
|
109
109
|
* resolveSchemaCoordinate(schema, 'Query.missing'); // => undefined
|
|
110
110
|
* ```
|
|
111
111
|
*/
|
|
@@ -120,6 +120,7 @@ export declare function resolveSchemaCoordinate(
|
|
|
120
120
|
* @returns The schema element identified by the parsed coordinate, or undefined if none exists.
|
|
121
121
|
* @example
|
|
122
122
|
* ```ts
|
|
123
|
+
* import assert from 'node:assert/strict';
|
|
123
124
|
* import { parseSchemaCoordinate } from 'graphql/language';
|
|
124
125
|
* import { buildSchema, resolveASTSchemaCoordinate } from 'graphql/utilities';
|
|
125
126
|
*
|
|
@@ -131,7 +132,7 @@ export declare function resolveSchemaCoordinate(
|
|
|
131
132
|
* const coordinate = parseSchemaCoordinate('Query.greeting(name:)');
|
|
132
133
|
* const resolved = resolveASTSchemaCoordinate(schema, coordinate);
|
|
133
134
|
*
|
|
134
|
-
* resolved
|
|
135
|
+
* assert(resolved?.kind === 'FieldArgument');
|
|
135
136
|
* resolved.field.name; // => 'greeting'
|
|
136
137
|
* resolved.fieldArgument.name; // => 'name'
|
|
137
138
|
* ```
|
|
@@ -47,13 +47,13 @@ var _definition = require('../type/definition.js');
|
|
|
47
47
|
* }
|
|
48
48
|
* `);
|
|
49
49
|
*
|
|
50
|
-
* resolveSchemaCoordinate(schema, 'Query')
|
|
51
|
-
* resolveSchemaCoordinate(schema, 'Query.reviews')
|
|
52
|
-
* resolveSchemaCoordinate(schema, 'Query.reviews(input:)')
|
|
53
|
-
* resolveSchemaCoordinate(schema, 'ReviewInput.stars')
|
|
54
|
-
* resolveSchemaCoordinate(schema, 'Episode.NEW_HOPE')
|
|
55
|
-
* resolveSchemaCoordinate(schema, '@tag')
|
|
56
|
-
* resolveSchemaCoordinate(schema, '@tag(name:)')
|
|
50
|
+
* resolveSchemaCoordinate(schema, 'Query')?.kind; // => 'NamedType'
|
|
51
|
+
* resolveSchemaCoordinate(schema, 'Query.reviews')?.kind; // => 'Field'
|
|
52
|
+
* resolveSchemaCoordinate(schema, 'Query.reviews(input:)')?.kind; // => 'FieldArgument'
|
|
53
|
+
* resolveSchemaCoordinate(schema, 'ReviewInput.stars')?.kind; // => 'InputField'
|
|
54
|
+
* resolveSchemaCoordinate(schema, 'Episode.NEW_HOPE')?.kind; // => 'EnumValue'
|
|
55
|
+
* resolveSchemaCoordinate(schema, '@tag')?.kind; // => 'Directive'
|
|
56
|
+
* resolveSchemaCoordinate(schema, '@tag(name:)')?.kind; // => 'DirectiveArgument'
|
|
57
57
|
* resolveSchemaCoordinate(schema, 'Query.missing'); // => undefined
|
|
58
58
|
* ```
|
|
59
59
|
*/
|
|
@@ -287,6 +287,7 @@ function resolveDirectiveArgumentCoordinate(schema, schemaCoordinate) {
|
|
|
287
287
|
* @returns The schema element identified by the parsed coordinate, or undefined if none exists.
|
|
288
288
|
* @example
|
|
289
289
|
* ```ts
|
|
290
|
+
* import assert from 'node:assert/strict';
|
|
290
291
|
* import { parseSchemaCoordinate } from 'graphql/language';
|
|
291
292
|
* import { buildSchema, resolveASTSchemaCoordinate } from 'graphql/utilities';
|
|
292
293
|
*
|
|
@@ -298,7 +299,7 @@ function resolveDirectiveArgumentCoordinate(schema, schemaCoordinate) {
|
|
|
298
299
|
* const coordinate = parseSchemaCoordinate('Query.greeting(name:)');
|
|
299
300
|
* const resolved = resolveASTSchemaCoordinate(schema, coordinate);
|
|
300
301
|
*
|
|
301
|
-
* resolved
|
|
302
|
+
* assert(resolved?.kind === 'FieldArgument');
|
|
302
303
|
* resolved.field.name; // => 'greeting'
|
|
303
304
|
* resolved.fieldArgument.name; // => 'name'
|
|
304
305
|
* ```
|
|
@@ -40,13 +40,13 @@ import {
|
|
|
40
40
|
* }
|
|
41
41
|
* `);
|
|
42
42
|
*
|
|
43
|
-
* resolveSchemaCoordinate(schema, 'Query')
|
|
44
|
-
* resolveSchemaCoordinate(schema, 'Query.reviews')
|
|
45
|
-
* resolveSchemaCoordinate(schema, 'Query.reviews(input:)')
|
|
46
|
-
* resolveSchemaCoordinate(schema, 'ReviewInput.stars')
|
|
47
|
-
* resolveSchemaCoordinate(schema, 'Episode.NEW_HOPE')
|
|
48
|
-
* resolveSchemaCoordinate(schema, '@tag')
|
|
49
|
-
* resolveSchemaCoordinate(schema, '@tag(name:)')
|
|
43
|
+
* resolveSchemaCoordinate(schema, 'Query')?.kind; // => 'NamedType'
|
|
44
|
+
* resolveSchemaCoordinate(schema, 'Query.reviews')?.kind; // => 'Field'
|
|
45
|
+
* resolveSchemaCoordinate(schema, 'Query.reviews(input:)')?.kind; // => 'FieldArgument'
|
|
46
|
+
* resolveSchemaCoordinate(schema, 'ReviewInput.stars')?.kind; // => 'InputField'
|
|
47
|
+
* resolveSchemaCoordinate(schema, 'Episode.NEW_HOPE')?.kind; // => 'EnumValue'
|
|
48
|
+
* resolveSchemaCoordinate(schema, '@tag')?.kind; // => 'Directive'
|
|
49
|
+
* resolveSchemaCoordinate(schema, '@tag(name:)')?.kind; // => 'DirectiveArgument'
|
|
50
50
|
* resolveSchemaCoordinate(schema, 'Query.missing'); // => undefined
|
|
51
51
|
* ```
|
|
52
52
|
*/
|
|
@@ -269,6 +269,7 @@ function resolveDirectiveArgumentCoordinate(schema, schemaCoordinate) {
|
|
|
269
269
|
* @returns The schema element identified by the parsed coordinate, or undefined if none exists.
|
|
270
270
|
* @example
|
|
271
271
|
* ```ts
|
|
272
|
+
* import assert from 'node:assert/strict';
|
|
272
273
|
* import { parseSchemaCoordinate } from 'graphql/language';
|
|
273
274
|
* import { buildSchema, resolveASTSchemaCoordinate } from 'graphql/utilities';
|
|
274
275
|
*
|
|
@@ -280,7 +281,7 @@ function resolveDirectiveArgumentCoordinate(schema, schemaCoordinate) {
|
|
|
280
281
|
* const coordinate = parseSchemaCoordinate('Query.greeting(name:)');
|
|
281
282
|
* const resolved = resolveASTSchemaCoordinate(schema, coordinate);
|
|
282
283
|
*
|
|
283
|
-
* resolved
|
|
284
|
+
* assert(resolved?.kind === 'FieldArgument');
|
|
284
285
|
* resolved.field.name; // => 'greeting'
|
|
285
286
|
* resolved.fieldArgument.name; // => 'name'
|
|
286
287
|
* ```
|
|
@@ -32,8 +32,8 @@ import type { DocumentNode } from '../language/ast';
|
|
|
32
32
|
* const separated = separateOperations(document);
|
|
33
33
|
*
|
|
34
34
|
* Object.keys(separated); // => ['GetUser', 'GetStatus']
|
|
35
|
-
* print(separated.GetUser); //
|
|
36
|
-
* print(separated.GetStatus); //
|
|
35
|
+
* print(separated.GetUser).includes('fragment UserFields'); // => true
|
|
36
|
+
* print(separated.GetStatus).includes('fragment UserFields'); // => false
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
39
|
export declare function separateOperations(
|
|
@@ -42,8 +42,8 @@ var _visitor = require('../language/visitor.js');
|
|
|
42
42
|
* const separated = separateOperations(document);
|
|
43
43
|
*
|
|
44
44
|
* Object.keys(separated); // => ['GetUser', 'GetStatus']
|
|
45
|
-
* print(separated.GetUser); //
|
|
46
|
-
* print(separated.GetStatus); //
|
|
45
|
+
* print(separated.GetUser).includes('fragment UserFields'); // => true
|
|
46
|
+
* print(separated.GetStatus).includes('fragment UserFields'); // => false
|
|
47
47
|
* ```
|
|
48
48
|
*/
|
|
49
49
|
function separateOperations(documentAST) {
|
|
@@ -32,8 +32,8 @@ import { visit } from '../language/visitor.mjs';
|
|
|
32
32
|
* const separated = separateOperations(document);
|
|
33
33
|
*
|
|
34
34
|
* Object.keys(separated); // => ['GetUser', 'GetStatus']
|
|
35
|
-
* print(separated.GetUser); //
|
|
36
|
-
* print(separated.GetStatus); //
|
|
35
|
+
* print(separated.GetUser).includes('fragment UserFields'); // => true
|
|
36
|
+
* print(separated.GetStatus).includes('fragment UserFields'); // => false
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
39
|
|
|
@@ -37,7 +37,15 @@ import { Source } from '../language/source';
|
|
|
37
37
|
* Becomes:
|
|
38
38
|
*
|
|
39
39
|
* ```graphql
|
|
40
|
-
* query SomeQuery($foo:String
|
|
40
|
+
* query SomeQuery($foo: String!, $bar: String) {
|
|
41
|
+
* someField(foo: $foo, bar: $bar) {
|
|
42
|
+
* a
|
|
43
|
+
* b {
|
|
44
|
+
* c
|
|
45
|
+
* d
|
|
46
|
+
* }
|
|
47
|
+
* }
|
|
48
|
+
* }
|
|
41
49
|
* ```
|
|
42
50
|
* @example SDL source
|
|
43
51
|
* ```graphql
|
|
@@ -55,15 +63,21 @@ import { Source } from '../language/source';
|
|
|
55
63
|
* Becomes:
|
|
56
64
|
*
|
|
57
65
|
* ```graphql
|
|
58
|
-
* """
|
|
66
|
+
* """
|
|
67
|
+
* Type description
|
|
68
|
+
* """
|
|
69
|
+
* type Foo {
|
|
70
|
+
* """
|
|
71
|
+
* Field description
|
|
72
|
+
* """
|
|
73
|
+
* bar: String
|
|
74
|
+
* }
|
|
59
75
|
* ```
|
|
60
76
|
* @example
|
|
61
77
|
* ```ts
|
|
62
78
|
* import { stripIgnoredCharacters } from 'graphql/utilities';
|
|
63
79
|
*
|
|
64
|
-
* const source = stripIgnoredCharacters('query Example { name }');
|
|
65
|
-
*
|
|
66
|
-
* source; // => 'query Example{name}'
|
|
80
|
+
* const source = stripIgnoredCharacters('query Example { name }'); // => 'query Example{name}'
|
|
67
81
|
* ```
|
|
68
82
|
*/
|
|
69
83
|
export declare function stripIgnoredCharacters(source: string | Source): string;
|
|
@@ -52,7 +52,15 @@ var _tokenKind = require('../language/tokenKind.js');
|
|
|
52
52
|
* Becomes:
|
|
53
53
|
*
|
|
54
54
|
* ```graphql
|
|
55
|
-
* query SomeQuery($foo:String
|
|
55
|
+
* query SomeQuery($foo: String!, $bar: String) {
|
|
56
|
+
* someField(foo: $foo, bar: $bar) {
|
|
57
|
+
* a
|
|
58
|
+
* b {
|
|
59
|
+
* c
|
|
60
|
+
* d
|
|
61
|
+
* }
|
|
62
|
+
* }
|
|
63
|
+
* }
|
|
56
64
|
* ```
|
|
57
65
|
* @example SDL source
|
|
58
66
|
* ```graphql
|
|
@@ -70,15 +78,21 @@ var _tokenKind = require('../language/tokenKind.js');
|
|
|
70
78
|
* Becomes:
|
|
71
79
|
*
|
|
72
80
|
* ```graphql
|
|
73
|
-
* """
|
|
81
|
+
* """
|
|
82
|
+
* Type description
|
|
83
|
+
* """
|
|
84
|
+
* type Foo {
|
|
85
|
+
* """
|
|
86
|
+
* Field description
|
|
87
|
+
* """
|
|
88
|
+
* bar: String
|
|
89
|
+
* }
|
|
74
90
|
* ```
|
|
75
91
|
* @example
|
|
76
92
|
* ```ts
|
|
77
93
|
* import { stripIgnoredCharacters } from 'graphql/utilities';
|
|
78
94
|
*
|
|
79
|
-
* const source = stripIgnoredCharacters('query Example { name }');
|
|
80
|
-
*
|
|
81
|
-
* source; // => 'query Example{name}'
|
|
95
|
+
* const source = stripIgnoredCharacters('query Example { name }'); // => 'query Example{name}'
|
|
82
96
|
* ```
|
|
83
97
|
*/
|
|
84
98
|
function stripIgnoredCharacters(source) {
|