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.
Files changed (240) hide show
  1. package/error/GraphQLError.d.ts +5 -1
  2. package/error/GraphQLError.js +12 -7
  3. package/error/GraphQLError.mjs +13 -6
  4. package/error/locatedError.d.ts +6 -4
  5. package/error/locatedError.js +6 -4
  6. package/error/locatedError.mjs +6 -4
  7. package/execution/collectFields.d.ts +1 -0
  8. package/execution/collectFields.js +9 -0
  9. package/execution/collectFields.mjs +9 -0
  10. package/execution/execute.d.ts +9 -10
  11. package/execution/execute.js +44 -29
  12. package/execution/execute.mjs +44 -29
  13. package/execution/mapAsyncIterator.js +12 -11
  14. package/execution/mapAsyncIterator.mjs +12 -11
  15. package/execution/subscribe.d.ts +5 -2
  16. package/execution/subscribe.js +5 -2
  17. package/execution/subscribe.mjs +5 -2
  18. package/execution/values.d.ts +43 -21
  19. package/execution/values.js +52 -24
  20. package/execution/values.mjs +51 -23
  21. package/graphql.d.ts +8 -14
  22. package/graphql.js +16 -15
  23. package/graphql.mjs +11 -15
  24. package/jsutils/SetMap.d.ts +14 -0
  25. package/jsutils/SetMap.js +48 -0
  26. package/jsutils/SetMap.mjs +39 -0
  27. package/jsutils/isIterableObject.d.ts +2 -0
  28. package/jsutils/isIterableObject.js +2 -0
  29. package/jsutils/isIterableObject.mjs +2 -0
  30. package/jsutils/keyMap.d.ts +2 -0
  31. package/jsutils/keyMap.js +2 -0
  32. package/jsutils/keyMap.mjs +2 -0
  33. package/jsutils/keyValMap.d.ts +3 -3
  34. package/jsutils/keyValMap.js +3 -3
  35. package/jsutils/keyValMap.mjs +3 -3
  36. package/language/ast.d.ts +2 -6
  37. package/language/ast.js +2 -6
  38. package/language/ast.mjs +2 -6
  39. package/language/lexer.d.ts +6 -0
  40. package/language/lexer.js +22 -0
  41. package/language/lexer.mjs +22 -0
  42. package/language/location.d.ts +8 -3
  43. package/language/location.js +57 -17
  44. package/language/location.mjs +56 -16
  45. package/language/parser.d.ts +27 -13
  46. package/language/parser.js +31 -9
  47. package/language/parser.mjs +31 -9
  48. package/language/predicates.d.ts +10 -3
  49. package/language/predicates.js +10 -3
  50. package/language/predicates.mjs +10 -3
  51. package/language/printLocation.d.ts +2 -6
  52. package/language/printLocation.js +2 -6
  53. package/language/printLocation.mjs +2 -6
  54. package/language/printer.d.ts +22 -3
  55. package/language/printer.js +394 -308
  56. package/language/printer.mjs +394 -308
  57. package/language/reducer.d.ts +32 -0
  58. package/language/reducer.js +95 -0
  59. package/language/reducer.mjs +86 -0
  60. package/language/source.d.ts +4 -5
  61. package/language/source.js +4 -5
  62. package/language/source.mjs +4 -5
  63. package/language/visitor.d.ts +16 -10
  64. package/language/visitor.js +15 -7
  65. package/language/visitor.mjs +15 -7
  66. package/package.json +1 -4
  67. package/type/definition.d.ts +190 -122
  68. package/type/definition.js +175 -102
  69. package/type/definition.mjs +174 -101
  70. package/type/directives.d.ts +14 -8
  71. package/type/directives.js +13 -7
  72. package/type/directives.mjs +13 -7
  73. package/type/scalars.js +8 -11
  74. package/type/scalars.mjs +1 -1
  75. package/type/schema.d.ts +38 -13
  76. package/type/schema.js +36 -11
  77. package/type/schema.mjs +36 -11
  78. package/type/validate.d.ts +1 -3
  79. package/type/validate.js +1 -3
  80. package/type/validate.mjs +1 -3
  81. package/utilities/TypeInfo.d.ts +15 -11
  82. package/utilities/TypeInfo.js +15 -11
  83. package/utilities/TypeInfo.mjs +15 -11
  84. package/utilities/assertValidName.d.ts +1 -1
  85. package/utilities/assertValidName.js +1 -1
  86. package/utilities/assertValidName.mjs +1 -1
  87. package/utilities/astFromValue.d.ts +3 -1
  88. package/utilities/astFromValue.js +3 -1
  89. package/utilities/astFromValue.mjs +3 -1
  90. package/utilities/buildASTSchema.d.ts +8 -8
  91. package/utilities/buildASTSchema.js +9 -20
  92. package/utilities/buildASTSchema.mjs +9 -20
  93. package/utilities/buildClientSchema.d.ts +6 -2
  94. package/utilities/buildClientSchema.js +6 -2
  95. package/utilities/buildClientSchema.mjs +6 -2
  96. package/utilities/coerceInputValue.d.ts +9 -3
  97. package/utilities/coerceInputValue.js +60 -13
  98. package/utilities/coerceInputValue.mjs +58 -13
  99. package/utilities/concatAST.d.ts +4 -1
  100. package/utilities/concatAST.js +4 -1
  101. package/utilities/concatAST.mjs +4 -1
  102. package/utilities/extendSchema.d.ts +7 -4
  103. package/utilities/extendSchema.js +7 -4
  104. package/utilities/extendSchema.mjs +7 -4
  105. package/utilities/findBreakingChanges.d.ts +2 -2
  106. package/utilities/findBreakingChanges.js +2 -2
  107. package/utilities/findBreakingChanges.mjs +2 -2
  108. package/utilities/getIntrospectionQuery.d.ts +9 -9
  109. package/utilities/getIntrospectionQuery.js +8 -8
  110. package/utilities/getIntrospectionQuery.mjs +8 -8
  111. package/utilities/getOperationAST.d.ts +2 -2
  112. package/utilities/getOperationAST.js +2 -2
  113. package/utilities/getOperationAST.mjs +2 -2
  114. package/utilities/getOperationRootType.d.ts +3 -1
  115. package/utilities/getOperationRootType.js +3 -1
  116. package/utilities/getOperationRootType.mjs +3 -1
  117. package/utilities/introspectionFromSchema.d.ts +12 -4
  118. package/utilities/introspectionFromSchema.js +12 -4
  119. package/utilities/introspectionFromSchema.mjs +12 -4
  120. package/utilities/lexicographicSortSchema.d.ts +17 -13
  121. package/utilities/lexicographicSortSchema.js +17 -13
  122. package/utilities/lexicographicSortSchema.mjs +17 -13
  123. package/utilities/printSchema.d.ts +7 -4
  124. package/utilities/printSchema.js +7 -4
  125. package/utilities/printSchema.mjs +7 -4
  126. package/utilities/resolveSchemaCoordinate.d.ts +9 -8
  127. package/utilities/resolveSchemaCoordinate.js +9 -8
  128. package/utilities/resolveSchemaCoordinate.mjs +9 -8
  129. package/utilities/separateOperations.d.ts +2 -2
  130. package/utilities/separateOperations.js +2 -2
  131. package/utilities/separateOperations.mjs +2 -2
  132. package/utilities/stripIgnoredCharacters.d.ts +19 -5
  133. package/utilities/stripIgnoredCharacters.js +19 -5
  134. package/utilities/stripIgnoredCharacters.mjs +19 -5
  135. package/utilities/typeComparators.d.ts +1 -5
  136. package/utilities/typeComparators.js +1 -5
  137. package/utilities/typeComparators.mjs +1 -5
  138. package/utilities/valueFromAST.js +4 -4
  139. package/utilities/valueFromAST.mjs +4 -4
  140. package/utilities/valueFromASTUntyped.d.ts +1 -3
  141. package/utilities/valueFromASTUntyped.js +1 -3
  142. package/utilities/valueFromASTUntyped.mjs +1 -3
  143. package/validation/ValidationContext.d.ts +22 -3
  144. package/validation/ValidationContext.js +84 -27
  145. package/validation/ValidationContext.mjs +82 -27
  146. package/validation/rules/ExecutableDefinitionsRule.d.ts +6 -4
  147. package/validation/rules/ExecutableDefinitionsRule.js +6 -4
  148. package/validation/rules/ExecutableDefinitionsRule.mjs +6 -4
  149. package/validation/rules/FieldsOnCorrectTypeRule.d.ts +4 -4
  150. package/validation/rules/FieldsOnCorrectTypeRule.js +10 -6
  151. package/validation/rules/FieldsOnCorrectTypeRule.mjs +12 -6
  152. package/validation/rules/FragmentsOnCompositeTypesRule.d.ts +6 -4
  153. package/validation/rules/FragmentsOnCompositeTypesRule.js +6 -4
  154. package/validation/rules/FragmentsOnCompositeTypesRule.mjs +6 -4
  155. package/validation/rules/KnownArgumentNamesRule.d.ts +4 -4
  156. package/validation/rules/KnownArgumentNamesRule.js +26 -17
  157. package/validation/rules/KnownArgumentNamesRule.mjs +21 -11
  158. package/validation/rules/KnownDirectivesRule.d.ts +1 -3
  159. package/validation/rules/KnownDirectivesRule.js +1 -3
  160. package/validation/rules/KnownDirectivesRule.mjs +1 -3
  161. package/validation/rules/KnownFragmentNamesRule.d.ts +4 -4
  162. package/validation/rules/KnownFragmentNamesRule.js +4 -4
  163. package/validation/rules/KnownFragmentNamesRule.mjs +4 -4
  164. package/validation/rules/KnownTypeNamesRule.d.ts +1 -3
  165. package/validation/rules/KnownTypeNamesRule.js +7 -7
  166. package/validation/rules/KnownTypeNamesRule.mjs +7 -7
  167. package/validation/rules/LoneAnonymousOperationRule.d.ts +6 -4
  168. package/validation/rules/LoneAnonymousOperationRule.js +6 -4
  169. package/validation/rules/LoneAnonymousOperationRule.mjs +6 -4
  170. package/validation/rules/MaxIntrospectionDepthRule.d.ts +6 -4
  171. package/validation/rules/MaxIntrospectionDepthRule.js +44 -19
  172. package/validation/rules/MaxIntrospectionDepthRule.mjs +44 -19
  173. package/validation/rules/NoFragmentCyclesRule.d.ts +1 -3
  174. package/validation/rules/NoFragmentCyclesRule.js +1 -3
  175. package/validation/rules/NoFragmentCyclesRule.mjs +1 -3
  176. package/validation/rules/NoUndefinedVariablesRule.d.ts +4 -4
  177. package/validation/rules/NoUndefinedVariablesRule.js +4 -4
  178. package/validation/rules/NoUndefinedVariablesRule.mjs +4 -4
  179. package/validation/rules/NoUnusedFragmentsRule.d.ts +4 -4
  180. package/validation/rules/NoUnusedFragmentsRule.js +10 -14
  181. package/validation/rules/NoUnusedFragmentsRule.mjs +10 -14
  182. package/validation/rules/NoUnusedVariablesRule.d.ts +4 -4
  183. package/validation/rules/NoUnusedVariablesRule.js +4 -4
  184. package/validation/rules/NoUnusedVariablesRule.mjs +4 -4
  185. package/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts +8 -6
  186. package/validation/rules/OverlappingFieldsCanBeMergedRule.js +552 -354
  187. package/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +545 -352
  188. package/validation/rules/PossibleFragmentSpreadsRule.d.ts +6 -4
  189. package/validation/rules/PossibleFragmentSpreadsRule.js +6 -4
  190. package/validation/rules/PossibleFragmentSpreadsRule.mjs +6 -4
  191. package/validation/rules/ProvidedRequiredArgumentsRule.d.ts +6 -4
  192. package/validation/rules/ProvidedRequiredArgumentsRule.js +6 -4
  193. package/validation/rules/ProvidedRequiredArgumentsRule.mjs +6 -4
  194. package/validation/rules/ScalarLeafsRule.d.ts +1 -3
  195. package/validation/rules/ScalarLeafsRule.js +1 -3
  196. package/validation/rules/ScalarLeafsRule.mjs +1 -3
  197. package/validation/rules/SingleFieldSubscriptionsRule.d.ts +6 -4
  198. package/validation/rules/SingleFieldSubscriptionsRule.js +50 -9
  199. package/validation/rules/SingleFieldSubscriptionsRule.mjs +50 -9
  200. package/validation/rules/UniqueArgumentNamesRule.d.ts +4 -4
  201. package/validation/rules/UniqueArgumentNamesRule.js +4 -4
  202. package/validation/rules/UniqueArgumentNamesRule.mjs +4 -4
  203. package/validation/rules/UniqueDirectivesPerLocationRule.d.ts +6 -4
  204. package/validation/rules/UniqueDirectivesPerLocationRule.js +6 -4
  205. package/validation/rules/UniqueDirectivesPerLocationRule.mjs +6 -4
  206. package/validation/rules/UniqueFragmentNamesRule.d.ts +4 -4
  207. package/validation/rules/UniqueFragmentNamesRule.js +4 -4
  208. package/validation/rules/UniqueFragmentNamesRule.mjs +4 -4
  209. package/validation/rules/UniqueInputFieldNamesRule.d.ts +6 -4
  210. package/validation/rules/UniqueInputFieldNamesRule.js +6 -4
  211. package/validation/rules/UniqueInputFieldNamesRule.mjs +6 -4
  212. package/validation/rules/UniqueOperationNamesRule.d.ts +4 -4
  213. package/validation/rules/UniqueOperationNamesRule.js +4 -4
  214. package/validation/rules/UniqueOperationNamesRule.mjs +4 -4
  215. package/validation/rules/UniqueVariableNamesRule.d.ts +4 -4
  216. package/validation/rules/UniqueVariableNamesRule.js +4 -4
  217. package/validation/rules/UniqueVariableNamesRule.mjs +4 -4
  218. package/validation/rules/ValuesOfCorrectTypeRule.d.ts +4 -4
  219. package/validation/rules/ValuesOfCorrectTypeRule.js +29 -23
  220. package/validation/rules/ValuesOfCorrectTypeRule.mjs +24 -14
  221. package/validation/rules/VariablesAreInputTypesRule.d.ts +6 -4
  222. package/validation/rules/VariablesAreInputTypesRule.js +6 -4
  223. package/validation/rules/VariablesAreInputTypesRule.mjs +6 -4
  224. package/validation/rules/VariablesInAllowedPositionRule.d.ts +6 -4
  225. package/validation/rules/VariablesInAllowedPositionRule.js +6 -4
  226. package/validation/rules/VariablesInAllowedPositionRule.mjs +6 -4
  227. package/validation/rules/custom/NoDeprecatedCustomRule.d.ts +4 -4
  228. package/validation/rules/custom/NoDeprecatedCustomRule.js +4 -4
  229. package/validation/rules/custom/NoDeprecatedCustomRule.mjs +4 -4
  230. package/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts +7 -5
  231. package/validation/rules/custom/NoSchemaIntrospectionCustomRule.js +7 -5
  232. package/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs +7 -5
  233. package/validation/validate.d.ts +2 -0
  234. package/validation/validate.js +14 -2
  235. package/validation/validate.mjs +13 -2
  236. package/validation/validationAbortedError.d.ts +3 -0
  237. package/validation/validationAbortedError.js +14 -0
  238. package/validation/validationAbortedError.mjs +4 -0
  239. package/version.js +3 -3
  240. package/version.mjs +3 -3
@@ -0,0 +1,32 @@
1
+ /** @category Visiting */
2
+ import type { ASTNode } from './ast';
3
+ /** @internal */
4
+ export declare type ASTReducer<R> = {
5
+ readonly [NodeT in ASTNode as NodeT['kind']]?: (node: {
6
+ [K in keyof NodeT]: ReducedField<NodeT[K], R>;
7
+ }) => R;
8
+ };
9
+ declare type ReducedField<T, R> = T extends ASTNode
10
+ ? R
11
+ : T extends ReadonlyArray<ASTNode>
12
+ ? ReadonlyArray<R>
13
+ : T;
14
+ /** @internal */
15
+ export declare function reduce<R>(
16
+ root: ASTNode,
17
+ reducer: Required<ASTReducer<R>>,
18
+ ): R;
19
+ /**
20
+ * Reduces children before their parents without changing the input AST.
21
+ * Missing callbacks produce undefined; returned values are not revisited.
22
+ * @param root - The AST node to reduce.
23
+ * @param reducer - Callbacks receiving nodes with their children reduced.
24
+ * @returns The reduced root value, or undefined if it has no callback.
25
+ * @typeParam R - The result produced for each node.
26
+ * @internal
27
+ */
28
+ export declare function reduce<R>(
29
+ root: ASTNode,
30
+ reducer: ASTReducer<R | undefined>,
31
+ ): R | undefined;
32
+ export {};
@@ -0,0 +1,95 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true,
5
+ });
6
+ exports.reduce = reduce;
7
+
8
+ var _inspect = require('../jsutils/inspect.js');
9
+
10
+ var _ast = require('./ast.js');
11
+
12
+ /** @category Visiting */
13
+
14
+ /** @internal */
15
+ function reduce(root, reducer) {
16
+ const stack = [];
17
+ let frame = {
18
+ parent: [root],
19
+ keys: undefined,
20
+ results: [],
21
+ index: -1,
22
+ };
23
+ let node;
24
+
25
+ do {
26
+ let kind;
27
+ frame.index++;
28
+ const length =
29
+ frame.keys === undefined ? frame.parent.length : frame.keys.length;
30
+
31
+ if (frame.index === length) {
32
+ node = frame.results;
33
+ kind = frame.keys === undefined ? undefined : frame.results.kind;
34
+ frame = stack.pop();
35
+ } else {
36
+ node =
37
+ frame.keys === undefined
38
+ ? frame.parent[frame.index]
39
+ : frame.parent[frame.keys[frame.index]];
40
+
41
+ if (node == null && stack.length !== 0) {
42
+ continue;
43
+ }
44
+
45
+ if (Array.isArray(node)) {
46
+ if (node.length !== 0) {
47
+ stack.push(frame);
48
+ frame = {
49
+ parent: node,
50
+ keys: undefined,
51
+ results: [],
52
+ index: -1,
53
+ };
54
+ continue;
55
+ }
56
+ } else {
57
+ const parent = node;
58
+ kind = parent === null || parent === void 0 ? void 0 : parent.kind;
59
+ const keys =
60
+ typeof kind === 'string' ? _ast.QueryDocumentKeys[kind] : undefined;
61
+
62
+ if (!Array.isArray(keys)) {
63
+ throw new Error(`Invalid AST Node: ${(0, _inspect.inspect)(node)}.`);
64
+ }
65
+
66
+ if (keys.length !== 0) {
67
+ stack.push(frame);
68
+ frame = {
69
+ parent,
70
+ keys,
71
+ results: { ...parent },
72
+ index: -1,
73
+ };
74
+ continue;
75
+ }
76
+ }
77
+ }
78
+
79
+ if (kind !== undefined) {
80
+ const reduceNode = reducer[kind];
81
+ node =
82
+ reduceNode === null || reduceNode === void 0
83
+ ? void 0
84
+ : reduceNode(node);
85
+ }
86
+
87
+ if (frame.keys === undefined) {
88
+ frame.results.push(node);
89
+ } else {
90
+ frame.results[frame.keys[frame.index]] = node;
91
+ }
92
+ } while (stack.length !== 0);
93
+
94
+ return node;
95
+ }
@@ -0,0 +1,86 @@
1
+ /** @category Visiting */
2
+ import { inspect } from '../jsutils/inspect.mjs';
3
+ import { QueryDocumentKeys } from './ast.mjs';
4
+
5
+ /** @internal */
6
+ export function reduce(root, reducer) {
7
+ const stack = [];
8
+ let frame = {
9
+ parent: [root],
10
+ keys: undefined,
11
+ results: [],
12
+ index: -1,
13
+ };
14
+ let node;
15
+
16
+ do {
17
+ let kind;
18
+ frame.index++;
19
+ const length =
20
+ frame.keys === undefined ? frame.parent.length : frame.keys.length;
21
+
22
+ if (frame.index === length) {
23
+ node = frame.results;
24
+ kind = frame.keys === undefined ? undefined : frame.results.kind;
25
+ frame = stack.pop();
26
+ } else {
27
+ node =
28
+ frame.keys === undefined
29
+ ? frame.parent[frame.index]
30
+ : frame.parent[frame.keys[frame.index]];
31
+
32
+ if (node == null && stack.length !== 0) {
33
+ continue;
34
+ }
35
+
36
+ if (Array.isArray(node)) {
37
+ if (node.length !== 0) {
38
+ stack.push(frame);
39
+ frame = {
40
+ parent: node,
41
+ keys: undefined,
42
+ results: [],
43
+ index: -1,
44
+ };
45
+ continue;
46
+ }
47
+ } else {
48
+ const parent = node;
49
+ kind = parent === null || parent === void 0 ? void 0 : parent.kind;
50
+ const keys =
51
+ typeof kind === 'string' ? QueryDocumentKeys[kind] : undefined;
52
+
53
+ if (!Array.isArray(keys)) {
54
+ throw new Error(`Invalid AST Node: ${inspect(node)}.`);
55
+ }
56
+
57
+ if (keys.length !== 0) {
58
+ stack.push(frame);
59
+ frame = {
60
+ parent,
61
+ keys,
62
+ results: { ...parent },
63
+ index: -1,
64
+ };
65
+ continue;
66
+ }
67
+ }
68
+ }
69
+
70
+ if (kind !== undefined) {
71
+ const reduceNode = reducer[kind];
72
+ node =
73
+ reduceNode === null || reduceNode === void 0
74
+ ? void 0
75
+ : reduceNode(node);
76
+ }
77
+
78
+ if (frame.keys === undefined) {
79
+ frame.results.push(node);
80
+ } else {
81
+ frame.results[frame.keys[frame.index]] = node;
82
+ }
83
+ } while (stack.length !== 0);
84
+
85
+ return node;
86
+ }
@@ -26,11 +26,10 @@ export declare class Source {
26
26
  * ```ts
27
27
  * import { Source } from 'graphql/language';
28
28
  *
29
- * const source = new Source(
30
- * 'type Query { greeting: String }',
31
- * 'schema.graphql',
32
- * { line: 10, column: 1 },
33
- * );
29
+ * const source = new Source('type Query { greeting: String }', 'schema.graphql', {
30
+ * line: 10,
31
+ * column: 1,
32
+ * });
34
33
  *
35
34
  * source.body; // => 'type Query { greeting: String }'
36
35
  * source.name; // => 'schema.graphql'
@@ -37,11 +37,10 @@ class Source {
37
37
  * ```ts
38
38
  * import { Source } from 'graphql/language';
39
39
  *
40
- * const source = new Source(
41
- * 'type Query { greeting: String }',
42
- * 'schema.graphql',
43
- * { line: 10, column: 1 },
44
- * );
40
+ * const source = new Source('type Query { greeting: String }', 'schema.graphql', {
41
+ * line: 10,
42
+ * column: 1,
43
+ * });
45
44
  *
46
45
  * source.body; // => 'type Query { greeting: String }'
47
46
  * source.name; // => 'schema.graphql'
@@ -26,11 +26,10 @@ export class Source {
26
26
  * ```ts
27
27
  * import { Source } from 'graphql/language';
28
28
  *
29
- * const source = new Source(
30
- * 'type Query { greeting: String }',
31
- * 'schema.graphql',
32
- * { line: 10, column: 1 },
33
- * );
29
+ * const source = new Source('type Query { greeting: String }', 'schema.graphql', {
30
+ * line: 10,
31
+ * column: 1,
32
+ * });
34
33
  *
35
34
  * source.body; // => 'type Query { greeting: String }'
36
35
  * source.name; // => 'schema.graphql'
@@ -134,7 +134,7 @@ export declare const BREAK: unknown;
134
134
  * import { parse, visit } from 'graphql/language';
135
135
  *
136
136
  * const document = parse('{ hero { name } }');
137
- * const fieldNames = [];
137
+ * const fieldNames: Array<string> = [];
138
138
  *
139
139
  * visit(document, {
140
140
  * Field: (node) => {
@@ -151,7 +151,7 @@ export declare const BREAK: unknown;
151
151
  * import { parse, visit } from 'graphql/language';
152
152
  *
153
153
  * const document = parse('{ hero { name } }');
154
- * const events = [];
154
+ * const events: Array<string> = [];
155
155
  *
156
156
  * visit(document, {
157
157
  * Field: {
@@ -176,10 +176,10 @@ export declare const BREAK: unknown;
176
176
  * let leaveCount = 0;
177
177
  *
178
178
  * visit(document, {
179
- * enter: (node) => {
179
+ * enter: () => {
180
180
  * enterCount += 1;
181
181
  * },
182
- * leave: (node) => {
182
+ * leave: () => {
183
183
  * leaveCount += 1;
184
184
  * },
185
185
  * });
@@ -235,9 +235,7 @@ export declare function visit<N extends ASTNode>(
235
235
  * return node.definitions.join('\n');
236
236
  * },
237
237
  * },
238
- * });
239
- *
240
- * printed; // => 'hero { name }'
238
+ * }); // => 'hero { name }'
241
239
  * ```
242
240
  */
243
241
  export declare function visit<R>(
@@ -257,13 +255,21 @@ export declare function visit<R>(
257
255
  * import { parse, visit, visitInParallel } from 'graphql/language';
258
256
  *
259
257
  * const document = parse('{ hero { name } }');
260
- * const events = [];
258
+ * const events: Array<string> = [];
261
259
  *
262
260
  * visit(
263
261
  * document,
264
262
  * visitInParallel([
265
- * { Field: (node) => { events.push(`field:${node.name.value}`); } },
266
- * { Name: (node) => { events.push(`name:${node.value}`); } },
263
+ * {
264
+ * Field: (node) => {
265
+ * events.push(`field:${node.name.value}`);
266
+ * },
267
+ * },
268
+ * {
269
+ * Name: (node) => {
270
+ * events.push(`name:${node.value}`);
271
+ * },
272
+ * },
267
273
  * ]),
268
274
  * );
269
275
  *
@@ -66,7 +66,7 @@ const BREAK = Object.freeze({});
66
66
  * import { parse, visit } from 'graphql/language';
67
67
  *
68
68
  * const document = parse('{ hero { name } }');
69
- * const fieldNames = [];
69
+ * const fieldNames: Array<string> = [];
70
70
  *
71
71
  * visit(document, {
72
72
  * Field: (node) => {
@@ -83,7 +83,7 @@ const BREAK = Object.freeze({});
83
83
  * import { parse, visit } from 'graphql/language';
84
84
  *
85
85
  * const document = parse('{ hero { name } }');
86
- * const events = [];
86
+ * const events: Array<string> = [];
87
87
  *
88
88
  * visit(document, {
89
89
  * Field: {
@@ -108,10 +108,10 @@ const BREAK = Object.freeze({});
108
108
  * let leaveCount = 0;
109
109
  *
110
110
  * visit(document, {
111
- * enter: (node) => {
111
+ * enter: () => {
112
112
  * enterCount += 1;
113
113
  * },
114
- * leave: (node) => {
114
+ * leave: () => {
115
115
  * leaveCount += 1;
116
116
  * },
117
117
  * });
@@ -294,13 +294,21 @@ function visit(root, visitor, visitorKeys = _ast.QueryDocumentKeys) {
294
294
  * import { parse, visit, visitInParallel } from 'graphql/language';
295
295
  *
296
296
  * const document = parse('{ hero { name } }');
297
- * const events = [];
297
+ * const events: Array<string> = [];
298
298
  *
299
299
  * visit(
300
300
  * document,
301
301
  * visitInParallel([
302
- * { Field: (node) => { events.push(`field:${node.name.value}`); } },
303
- * { Name: (node) => { events.push(`name:${node.value}`); } },
302
+ * {
303
+ * Field: (node) => {
304
+ * events.push(`field:${node.name.value}`);
305
+ * },
306
+ * },
307
+ * {
308
+ * Name: (node) => {
309
+ * events.push(`name:${node.value}`);
310
+ * },
311
+ * },
304
312
  * ]),
305
313
  * );
306
314
  *
@@ -52,7 +52,7 @@ export const BREAK = Object.freeze({});
52
52
  * import { parse, visit } from 'graphql/language';
53
53
  *
54
54
  * const document = parse('{ hero { name } }');
55
- * const fieldNames = [];
55
+ * const fieldNames: Array<string> = [];
56
56
  *
57
57
  * visit(document, {
58
58
  * Field: (node) => {
@@ -69,7 +69,7 @@ export const BREAK = Object.freeze({});
69
69
  * import { parse, visit } from 'graphql/language';
70
70
  *
71
71
  * const document = parse('{ hero { name } }');
72
- * const events = [];
72
+ * const events: Array<string> = [];
73
73
  *
74
74
  * visit(document, {
75
75
  * Field: {
@@ -94,10 +94,10 @@ export const BREAK = Object.freeze({});
94
94
  * let leaveCount = 0;
95
95
  *
96
96
  * visit(document, {
97
- * enter: (node) => {
97
+ * enter: () => {
98
98
  * enterCount += 1;
99
99
  * },
100
- * leave: (node) => {
100
+ * leave: () => {
101
101
  * leaveCount += 1;
102
102
  * },
103
103
  * });
@@ -274,13 +274,21 @@ export function visit(root, visitor, visitorKeys = QueryDocumentKeys) {
274
274
  * import { parse, visit, visitInParallel } from 'graphql/language';
275
275
  *
276
276
  * const document = parse('{ hero { name } }');
277
- * const events = [];
277
+ * const events: Array<string> = [];
278
278
  *
279
279
  * visit(
280
280
  * document,
281
281
  * visitInParallel([
282
- * { Field: (node) => { events.push(`field:${node.name.value}`); } },
283
- * { Name: (node) => { events.push(`name:${node.value}`); } },
282
+ * {
283
+ * Field: (node) => {
284
+ * events.push(`field:${node.name.value}`);
285
+ * },
286
+ * },
287
+ * {
288
+ * Name: (node) => {
289
+ * events.push(`name:${node.value}`);
290
+ * },
291
+ * },
284
292
  * ]),
285
293
  * );
286
294
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphql",
3
- "version": "16.14.1",
3
+ "version": "16.15.0",
4
4
  "description": "A Query Language and Runtime which can target any service.",
5
5
  "license": "MIT",
6
6
  "main": "index",
@@ -32,8 +32,5 @@
32
32
  ],
33
33
  "engines": {
34
34
  "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0"
35
- },
36
- "publishConfig": {
37
- "tag": "latest"
38
35
  }
39
36
  }