@zuplo/cli 7.14.2 → 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.
Files changed (258) hide show
  1. package/node_modules/@posthog/types/dist/posthog-config.d.ts +16 -0
  2. package/node_modules/@posthog/types/dist/posthog-config.d.ts.map +1 -1
  3. package/node_modules/@posthog/types/package.json +1 -1
  4. package/node_modules/@posthog/types/src/posthog-config.ts +16 -0
  5. package/node_modules/@zuplo/core/package.json +1 -1
  6. package/node_modules/@zuplo/graphql/package.json +1 -1
  7. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  8. package/node_modules/@zuplo/otel/package.json +1 -1
  9. package/node_modules/@zuplo/runtime/out/esm/{chunk-MUDGPSWL.js → chunk-ADPB2ZMZ.js} +80 -80
  10. package/node_modules/@zuplo/runtime/out/esm/chunk-ADPB2ZMZ.js.map +1 -0
  11. package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
  12. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +11 -11
  13. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js.map +1 -1
  14. package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
  15. package/node_modules/@zuplo/runtime/package.json +1 -1
  16. package/node_modules/graphql/error/GraphQLError.d.ts +5 -1
  17. package/node_modules/graphql/error/GraphQLError.js +12 -7
  18. package/node_modules/graphql/error/GraphQLError.mjs +13 -6
  19. package/node_modules/graphql/error/locatedError.d.ts +6 -4
  20. package/node_modules/graphql/error/locatedError.js +6 -4
  21. package/node_modules/graphql/error/locatedError.mjs +6 -4
  22. package/node_modules/graphql/execution/collectFields.d.ts +1 -0
  23. package/node_modules/graphql/execution/collectFields.js +9 -0
  24. package/node_modules/graphql/execution/collectFields.mjs +9 -0
  25. package/node_modules/graphql/execution/execute.d.ts +9 -10
  26. package/node_modules/graphql/execution/execute.js +44 -29
  27. package/node_modules/graphql/execution/execute.mjs +44 -29
  28. package/node_modules/graphql/execution/mapAsyncIterator.js +12 -11
  29. package/node_modules/graphql/execution/mapAsyncIterator.mjs +12 -11
  30. package/node_modules/graphql/execution/subscribe.d.ts +5 -2
  31. package/node_modules/graphql/execution/subscribe.js +5 -2
  32. package/node_modules/graphql/execution/subscribe.mjs +5 -2
  33. package/node_modules/graphql/execution/values.d.ts +43 -21
  34. package/node_modules/graphql/execution/values.js +52 -24
  35. package/node_modules/graphql/execution/values.mjs +51 -23
  36. package/node_modules/graphql/graphql.d.ts +8 -14
  37. package/node_modules/graphql/graphql.js +16 -15
  38. package/node_modules/graphql/graphql.mjs +11 -15
  39. package/node_modules/graphql/jsutils/SetMap.d.ts +14 -0
  40. package/node_modules/graphql/jsutils/SetMap.js +48 -0
  41. package/node_modules/graphql/jsutils/SetMap.mjs +39 -0
  42. package/node_modules/graphql/jsutils/isIterableObject.d.ts +2 -0
  43. package/node_modules/graphql/jsutils/isIterableObject.js +2 -0
  44. package/node_modules/graphql/jsutils/isIterableObject.mjs +2 -0
  45. package/node_modules/graphql/jsutils/keyMap.d.ts +2 -0
  46. package/node_modules/graphql/jsutils/keyMap.js +2 -0
  47. package/node_modules/graphql/jsutils/keyMap.mjs +2 -0
  48. package/node_modules/graphql/jsutils/keyValMap.d.ts +3 -3
  49. package/node_modules/graphql/jsutils/keyValMap.js +3 -3
  50. package/node_modules/graphql/jsutils/keyValMap.mjs +3 -3
  51. package/node_modules/graphql/language/ast.d.ts +2 -6
  52. package/node_modules/graphql/language/ast.js +2 -6
  53. package/node_modules/graphql/language/ast.mjs +2 -6
  54. package/node_modules/graphql/language/lexer.d.ts +6 -0
  55. package/node_modules/graphql/language/lexer.js +22 -0
  56. package/node_modules/graphql/language/lexer.mjs +22 -0
  57. package/node_modules/graphql/language/location.d.ts +8 -3
  58. package/node_modules/graphql/language/location.js +57 -17
  59. package/node_modules/graphql/language/location.mjs +56 -16
  60. package/node_modules/graphql/language/parser.d.ts +27 -13
  61. package/node_modules/graphql/language/parser.js +31 -9
  62. package/node_modules/graphql/language/parser.mjs +31 -9
  63. package/node_modules/graphql/language/predicates.d.ts +10 -3
  64. package/node_modules/graphql/language/predicates.js +10 -3
  65. package/node_modules/graphql/language/predicates.mjs +10 -3
  66. package/node_modules/graphql/language/printLocation.d.ts +2 -6
  67. package/node_modules/graphql/language/printLocation.js +2 -6
  68. package/node_modules/graphql/language/printLocation.mjs +2 -6
  69. package/node_modules/graphql/language/printer.d.ts +22 -3
  70. package/node_modules/graphql/language/printer.js +394 -308
  71. package/node_modules/graphql/language/printer.mjs +394 -308
  72. package/node_modules/graphql/language/reducer.d.ts +32 -0
  73. package/node_modules/graphql/language/reducer.js +95 -0
  74. package/node_modules/graphql/language/reducer.mjs +86 -0
  75. package/node_modules/graphql/language/source.d.ts +4 -5
  76. package/node_modules/graphql/language/source.js +4 -5
  77. package/node_modules/graphql/language/source.mjs +4 -5
  78. package/node_modules/graphql/language/visitor.d.ts +16 -10
  79. package/node_modules/graphql/language/visitor.js +15 -7
  80. package/node_modules/graphql/language/visitor.mjs +15 -7
  81. package/node_modules/graphql/package.json +1 -4
  82. package/node_modules/graphql/type/definition.d.ts +170 -102
  83. package/node_modules/graphql/type/definition.js +169 -96
  84. package/node_modules/graphql/type/definition.mjs +168 -95
  85. package/node_modules/graphql/type/directives.d.ts +12 -6
  86. package/node_modules/graphql/type/directives.js +12 -6
  87. package/node_modules/graphql/type/directives.mjs +12 -6
  88. package/node_modules/graphql/type/scalars.js +8 -11
  89. package/node_modules/graphql/type/scalars.mjs +1 -1
  90. package/node_modules/graphql/type/schema.d.ts +36 -11
  91. package/node_modules/graphql/type/schema.js +35 -10
  92. package/node_modules/graphql/type/schema.mjs +35 -10
  93. package/node_modules/graphql/type/validate.d.ts +1 -3
  94. package/node_modules/graphql/type/validate.js +1 -3
  95. package/node_modules/graphql/type/validate.mjs +1 -3
  96. package/node_modules/graphql/utilities/TypeInfo.d.ts +15 -11
  97. package/node_modules/graphql/utilities/TypeInfo.js +15 -11
  98. package/node_modules/graphql/utilities/TypeInfo.mjs +15 -11
  99. package/node_modules/graphql/utilities/assertValidName.d.ts +1 -1
  100. package/node_modules/graphql/utilities/assertValidName.js +1 -1
  101. package/node_modules/graphql/utilities/assertValidName.mjs +1 -1
  102. package/node_modules/graphql/utilities/astFromValue.d.ts +3 -1
  103. package/node_modules/graphql/utilities/astFromValue.js +3 -1
  104. package/node_modules/graphql/utilities/astFromValue.mjs +3 -1
  105. package/node_modules/graphql/utilities/buildASTSchema.d.ts +8 -8
  106. package/node_modules/graphql/utilities/buildASTSchema.js +9 -20
  107. package/node_modules/graphql/utilities/buildASTSchema.mjs +9 -20
  108. package/node_modules/graphql/utilities/buildClientSchema.d.ts +6 -2
  109. package/node_modules/graphql/utilities/buildClientSchema.js +6 -2
  110. package/node_modules/graphql/utilities/buildClientSchema.mjs +6 -2
  111. package/node_modules/graphql/utilities/coerceInputValue.d.ts +9 -3
  112. package/node_modules/graphql/utilities/coerceInputValue.js +60 -13
  113. package/node_modules/graphql/utilities/coerceInputValue.mjs +58 -13
  114. package/node_modules/graphql/utilities/concatAST.d.ts +4 -1
  115. package/node_modules/graphql/utilities/concatAST.js +4 -1
  116. package/node_modules/graphql/utilities/concatAST.mjs +4 -1
  117. package/node_modules/graphql/utilities/extendSchema.d.ts +7 -4
  118. package/node_modules/graphql/utilities/extendSchema.js +7 -4
  119. package/node_modules/graphql/utilities/extendSchema.mjs +7 -4
  120. package/node_modules/graphql/utilities/findBreakingChanges.d.ts +2 -2
  121. package/node_modules/graphql/utilities/findBreakingChanges.js +2 -2
  122. package/node_modules/graphql/utilities/findBreakingChanges.mjs +2 -2
  123. package/node_modules/graphql/utilities/getIntrospectionQuery.d.ts +9 -9
  124. package/node_modules/graphql/utilities/getIntrospectionQuery.js +8 -8
  125. package/node_modules/graphql/utilities/getIntrospectionQuery.mjs +8 -8
  126. package/node_modules/graphql/utilities/getOperationAST.d.ts +2 -2
  127. package/node_modules/graphql/utilities/getOperationAST.js +2 -2
  128. package/node_modules/graphql/utilities/getOperationAST.mjs +2 -2
  129. package/node_modules/graphql/utilities/getOperationRootType.d.ts +3 -1
  130. package/node_modules/graphql/utilities/getOperationRootType.js +3 -1
  131. package/node_modules/graphql/utilities/getOperationRootType.mjs +3 -1
  132. package/node_modules/graphql/utilities/introspectionFromSchema.d.ts +12 -4
  133. package/node_modules/graphql/utilities/introspectionFromSchema.js +12 -4
  134. package/node_modules/graphql/utilities/introspectionFromSchema.mjs +12 -4
  135. package/node_modules/graphql/utilities/lexicographicSortSchema.d.ts +17 -13
  136. package/node_modules/graphql/utilities/lexicographicSortSchema.js +17 -13
  137. package/node_modules/graphql/utilities/lexicographicSortSchema.mjs +17 -13
  138. package/node_modules/graphql/utilities/printSchema.d.ts +7 -4
  139. package/node_modules/graphql/utilities/printSchema.js +7 -4
  140. package/node_modules/graphql/utilities/printSchema.mjs +7 -4
  141. package/node_modules/graphql/utilities/resolveSchemaCoordinate.d.ts +9 -8
  142. package/node_modules/graphql/utilities/resolveSchemaCoordinate.js +9 -8
  143. package/node_modules/graphql/utilities/resolveSchemaCoordinate.mjs +9 -8
  144. package/node_modules/graphql/utilities/separateOperations.d.ts +2 -2
  145. package/node_modules/graphql/utilities/separateOperations.js +2 -2
  146. package/node_modules/graphql/utilities/separateOperations.mjs +2 -2
  147. package/node_modules/graphql/utilities/stripIgnoredCharacters.d.ts +19 -5
  148. package/node_modules/graphql/utilities/stripIgnoredCharacters.js +19 -5
  149. package/node_modules/graphql/utilities/stripIgnoredCharacters.mjs +19 -5
  150. package/node_modules/graphql/utilities/typeComparators.d.ts +1 -5
  151. package/node_modules/graphql/utilities/typeComparators.js +1 -5
  152. package/node_modules/graphql/utilities/typeComparators.mjs +1 -5
  153. package/node_modules/graphql/utilities/valueFromAST.js +4 -4
  154. package/node_modules/graphql/utilities/valueFromAST.mjs +4 -4
  155. package/node_modules/graphql/utilities/valueFromASTUntyped.d.ts +1 -3
  156. package/node_modules/graphql/utilities/valueFromASTUntyped.js +1 -3
  157. package/node_modules/graphql/utilities/valueFromASTUntyped.mjs +1 -3
  158. package/node_modules/graphql/validation/ValidationContext.d.ts +22 -3
  159. package/node_modules/graphql/validation/ValidationContext.js +84 -27
  160. package/node_modules/graphql/validation/ValidationContext.mjs +82 -27
  161. package/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.d.ts +6 -4
  162. package/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js +6 -4
  163. package/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs +6 -4
  164. package/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.d.ts +4 -4
  165. package/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js +10 -6
  166. package/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs +12 -6
  167. package/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.d.ts +6 -4
  168. package/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js +6 -4
  169. package/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs +6 -4
  170. package/node_modules/graphql/validation/rules/KnownArgumentNamesRule.d.ts +4 -4
  171. package/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js +26 -17
  172. package/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs +21 -11
  173. package/node_modules/graphql/validation/rules/KnownDirectivesRule.d.ts +1 -3
  174. package/node_modules/graphql/validation/rules/KnownDirectivesRule.js +1 -3
  175. package/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs +1 -3
  176. package/node_modules/graphql/validation/rules/KnownFragmentNamesRule.d.ts +4 -4
  177. package/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js +4 -4
  178. package/node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs +4 -4
  179. package/node_modules/graphql/validation/rules/KnownTypeNamesRule.d.ts +1 -3
  180. package/node_modules/graphql/validation/rules/KnownTypeNamesRule.js +7 -7
  181. package/node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs +7 -7
  182. package/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.d.ts +6 -4
  183. package/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js +6 -4
  184. package/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs +6 -4
  185. package/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.d.ts +6 -4
  186. package/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.js +44 -19
  187. package/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs +44 -19
  188. package/node_modules/graphql/validation/rules/NoFragmentCyclesRule.d.ts +1 -3
  189. package/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js +1 -3
  190. package/node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs +1 -3
  191. package/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.d.ts +4 -4
  192. package/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js +4 -4
  193. package/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs +4 -4
  194. package/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.d.ts +4 -4
  195. package/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js +10 -14
  196. package/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs +10 -14
  197. package/node_modules/graphql/validation/rules/NoUnusedVariablesRule.d.ts +4 -4
  198. package/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js +4 -4
  199. package/node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs +4 -4
  200. package/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts +8 -6
  201. package/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js +552 -354
  202. package/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +545 -352
  203. package/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.d.ts +6 -4
  204. package/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js +6 -4
  205. package/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs +6 -4
  206. package/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.d.ts +6 -4
  207. package/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js +6 -4
  208. package/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs +6 -4
  209. package/node_modules/graphql/validation/rules/ScalarLeafsRule.d.ts +1 -3
  210. package/node_modules/graphql/validation/rules/ScalarLeafsRule.js +1 -3
  211. package/node_modules/graphql/validation/rules/ScalarLeafsRule.mjs +1 -3
  212. package/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.d.ts +6 -4
  213. package/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js +50 -9
  214. package/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs +50 -9
  215. package/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.d.ts +4 -4
  216. package/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js +4 -4
  217. package/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs +4 -4
  218. package/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.d.ts +6 -4
  219. package/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js +6 -4
  220. package/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs +6 -4
  221. package/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.d.ts +4 -4
  222. package/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js +4 -4
  223. package/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs +4 -4
  224. package/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.d.ts +6 -4
  225. package/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js +6 -4
  226. package/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs +6 -4
  227. package/node_modules/graphql/validation/rules/UniqueOperationNamesRule.d.ts +4 -4
  228. package/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js +4 -4
  229. package/node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs +4 -4
  230. package/node_modules/graphql/validation/rules/UniqueVariableNamesRule.d.ts +4 -4
  231. package/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js +4 -4
  232. package/node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs +4 -4
  233. package/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.d.ts +4 -4
  234. package/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js +29 -23
  235. package/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs +24 -14
  236. package/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.d.ts +6 -4
  237. package/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js +6 -4
  238. package/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs +6 -4
  239. package/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.d.ts +6 -4
  240. package/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js +6 -4
  241. package/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs +6 -4
  242. package/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.ts +4 -4
  243. package/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js +4 -4
  244. package/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs +4 -4
  245. package/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts +7 -5
  246. package/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js +7 -5
  247. package/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs +7 -5
  248. package/node_modules/graphql/validation/validate.d.ts +2 -0
  249. package/node_modules/graphql/validation/validate.js +14 -2
  250. package/node_modules/graphql/validation/validate.mjs +13 -2
  251. package/node_modules/graphql/validation/validationAbortedError.d.ts +3 -0
  252. package/node_modules/graphql/validation/validationAbortedError.js +14 -0
  253. package/node_modules/graphql/validation/validationAbortedError.mjs +4 -0
  254. package/node_modules/graphql/version.js +3 -3
  255. package/node_modules/graphql/version.mjs +3 -3
  256. package/package.json +11 -11
  257. package/node_modules/@zuplo/runtime/out/esm/chunk-MUDGPSWL.js.map +0 -1
  258. /package/node_modules/@zuplo/runtime/out/esm/{chunk-MUDGPSWL.js.LEGAL.txt → chunk-ADPB2ZMZ.js.LEGAL.txt} +0 -0
@@ -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
  *
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphql",
3
- "version": "16.14.2",
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
  }