graphql 17.0.0-beta.2 → 17.0.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 (262) hide show
  1. package/README.md +3 -5
  2. package/__dev__/diagnostics.d.mts +1 -0
  3. package/__dev__/diagnostics.d.ts +1 -0
  4. package/__dev__/diagnostics.js +3 -0
  5. package/__dev__/diagnostics.mjs +3 -0
  6. package/diagnostics.d.mts +307 -0
  7. package/diagnostics.d.ts +307 -0
  8. package/diagnostics.js +75 -0
  9. package/diagnostics.js.map +1 -0
  10. package/diagnostics.mjs +70 -0
  11. package/diagnostics.mjs.map +1 -0
  12. package/error/GraphQLError.d.mts +3 -1
  13. package/error/GraphQLError.d.ts +3 -1
  14. package/error/GraphQLError.js +3 -3
  15. package/error/GraphQLError.js.map +1 -1
  16. package/error/GraphQLError.mjs +3 -3
  17. package/error/GraphQLError.mjs.map +1 -1
  18. package/error/locatedError.d.mts +1 -3
  19. package/error/locatedError.d.ts +1 -3
  20. package/error/locatedError.js.map +1 -1
  21. package/error/locatedError.mjs.map +1 -1
  22. package/execution/ExecutionArgs.d.mts +6 -0
  23. package/execution/ExecutionArgs.d.ts +6 -0
  24. package/execution/ExecutionArgs.js.map +1 -1
  25. package/execution/ExecutionArgs.mjs.map +1 -1
  26. package/execution/Executor.d.mts +19 -1
  27. package/execution/Executor.d.ts +19 -1
  28. package/execution/Executor.js +49 -4
  29. package/execution/Executor.js.map +1 -1
  30. package/execution/Executor.mjs +49 -4
  31. package/execution/Executor.mjs.map +1 -1
  32. package/execution/execute.d.mts +65 -44
  33. package/execution/execute.d.ts +65 -44
  34. package/execution/execute.js +73 -4
  35. package/execution/execute.js.map +1 -1
  36. package/execution/execute.mjs +73 -4
  37. package/execution/execute.mjs.map +1 -1
  38. package/execution/values.d.mts +17 -17
  39. package/execution/values.d.ts +17 -17
  40. package/execution/values.js.map +1 -1
  41. package/execution/values.mjs.map +1 -1
  42. package/index.d.mts +1 -0
  43. package/index.d.ts +1 -0
  44. package/index.js.map +1 -1
  45. package/index.mjs.map +1 -1
  46. package/language/parser.d.mts +20 -30
  47. package/language/parser.d.ts +20 -30
  48. package/language/parser.js +9 -9
  49. package/language/parser.js.map +1 -1
  50. package/language/parser.mjs +9 -9
  51. package/language/parser.mjs.map +1 -1
  52. package/language/predicates.d.mts +5 -1
  53. package/language/predicates.d.ts +5 -1
  54. package/language/predicates.js.map +1 -1
  55. package/language/predicates.mjs.map +1 -1
  56. package/language/source.d.mts +4 -5
  57. package/language/source.d.ts +4 -5
  58. package/language/source.js.map +1 -1
  59. package/language/source.mjs.map +1 -1
  60. package/language/visitor.d.mts +10 -2
  61. package/language/visitor.d.ts +10 -2
  62. package/language/visitor.js.map +1 -1
  63. package/language/visitor.mjs.map +1 -1
  64. package/package.json +2 -2
  65. package/type/definition.d.mts +96 -64
  66. package/type/definition.d.ts +96 -64
  67. package/type/definition.js.map +1 -1
  68. package/type/definition.mjs.map +1 -1
  69. package/type/directives.d.mts +3 -3
  70. package/type/directives.d.ts +3 -3
  71. package/type/directives.js.map +1 -1
  72. package/type/directives.mjs.map +1 -1
  73. package/type/schema.d.mts +4 -8
  74. package/type/schema.d.ts +4 -8
  75. package/type/schema.js.map +1 -1
  76. package/type/schema.mjs.map +1 -1
  77. package/type/validate.js +101 -30
  78. package/type/validate.js.map +1 -1
  79. package/type/validate.mjs +101 -30
  80. package/type/validate.mjs.map +1 -1
  81. package/utilities/TypeInfo.d.mts +1 -1
  82. package/utilities/TypeInfo.d.ts +1 -1
  83. package/utilities/TypeInfo.js.map +1 -1
  84. package/utilities/TypeInfo.mjs.map +1 -1
  85. package/utilities/buildASTSchema.d.mts +0 -1
  86. package/utilities/buildASTSchema.d.ts +0 -1
  87. package/utilities/buildASTSchema.js +0 -1
  88. package/utilities/buildASTSchema.js.map +1 -1
  89. package/utilities/buildASTSchema.mjs +0 -1
  90. package/utilities/buildASTSchema.mjs.map +1 -1
  91. package/utilities/buildClientSchema.d.mts +5 -1
  92. package/utilities/buildClientSchema.d.ts +5 -1
  93. package/utilities/buildClientSchema.js.map +1 -1
  94. package/utilities/buildClientSchema.mjs.map +1 -1
  95. package/utilities/coerceInputValue.d.mts +7 -6
  96. package/utilities/coerceInputValue.d.ts +7 -6
  97. package/utilities/coerceInputValue.js.map +1 -1
  98. package/utilities/coerceInputValue.mjs.map +1 -1
  99. package/utilities/concatAST.d.mts +4 -1
  100. package/utilities/concatAST.d.ts +4 -1
  101. package/utilities/concatAST.js.map +1 -1
  102. package/utilities/concatAST.mjs.map +1 -1
  103. package/utilities/extendSchema.d.mts +3 -3
  104. package/utilities/extendSchema.d.ts +3 -3
  105. package/utilities/extendSchema.js +5 -1
  106. package/utilities/extendSchema.js.map +1 -1
  107. package/utilities/extendSchema.mjs +5 -1
  108. package/utilities/extendSchema.mjs.map +1 -1
  109. package/utilities/introspectionFromSchema.d.mts +6 -2
  110. package/utilities/introspectionFromSchema.d.ts +6 -2
  111. package/utilities/introspectionFromSchema.js.map +1 -1
  112. package/utilities/introspectionFromSchema.mjs.map +1 -1
  113. package/utilities/lexicographicSortSchema.d.mts +5 -1
  114. package/utilities/lexicographicSortSchema.d.ts +5 -1
  115. package/utilities/lexicographicSortSchema.js.map +1 -1
  116. package/utilities/lexicographicSortSchema.mjs.map +1 -1
  117. package/utilities/printSchema.d.mts +5 -1
  118. package/utilities/printSchema.d.ts +5 -1
  119. package/utilities/printSchema.js.map +1 -1
  120. package/utilities/printSchema.mjs.map +1 -1
  121. package/utilities/replaceVariables.d.mts +4 -8
  122. package/utilities/replaceVariables.d.ts +4 -8
  123. package/utilities/replaceVariables.js.map +1 -1
  124. package/utilities/replaceVariables.mjs.map +1 -1
  125. package/utilities/stripIgnoredCharacters.d.mts +2 -2
  126. package/utilities/stripIgnoredCharacters.d.ts +2 -2
  127. package/utilities/stripIgnoredCharacters.js.map +1 -1
  128. package/utilities/stripIgnoredCharacters.mjs.map +1 -1
  129. package/utilities/typeComparators.d.mts +1 -5
  130. package/utilities/typeComparators.d.ts +1 -5
  131. package/utilities/typeComparators.js.map +1 -1
  132. package/utilities/typeComparators.mjs.map +1 -1
  133. package/utilities/validateInputValue.d.mts +10 -8
  134. package/utilities/validateInputValue.d.ts +10 -8
  135. package/utilities/validateInputValue.js.map +1 -1
  136. package/utilities/validateInputValue.mjs.map +1 -1
  137. package/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.mts +4 -1
  138. package/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.ts +4 -1
  139. package/validation/rules/DeferStreamDirectiveOnRootFieldRule.js +70 -17
  140. package/validation/rules/DeferStreamDirectiveOnRootFieldRule.js.map +1 -1
  141. package/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs +70 -17
  142. package/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs.map +1 -1
  143. package/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.mts +1 -1
  144. package/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.ts +1 -1
  145. package/validation/rules/DeferStreamDirectiveOnValidOperationsRule.js +90 -21
  146. package/validation/rules/DeferStreamDirectiveOnValidOperationsRule.js.map +1 -1
  147. package/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs +91 -22
  148. package/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs.map +1 -1
  149. package/validation/rules/ExecutableDefinitionsRule.d.mts +6 -2
  150. package/validation/rules/ExecutableDefinitionsRule.d.ts +6 -2
  151. package/validation/rules/ExecutableDefinitionsRule.js.map +1 -1
  152. package/validation/rules/ExecutableDefinitionsRule.mjs.map +1 -1
  153. package/validation/rules/FieldsOnCorrectTypeRule.d.mts +3 -1
  154. package/validation/rules/FieldsOnCorrectTypeRule.d.ts +3 -1
  155. package/validation/rules/FieldsOnCorrectTypeRule.js.map +1 -1
  156. package/validation/rules/FieldsOnCorrectTypeRule.mjs.map +1 -1
  157. package/validation/rules/FragmentsOnCompositeTypesRule.d.mts +6 -2
  158. package/validation/rules/FragmentsOnCompositeTypesRule.d.ts +6 -2
  159. package/validation/rules/FragmentsOnCompositeTypesRule.js.map +1 -1
  160. package/validation/rules/FragmentsOnCompositeTypesRule.mjs.map +1 -1
  161. package/validation/rules/KnownArgumentNamesRule.d.mts +3 -1
  162. package/validation/rules/KnownArgumentNamesRule.d.ts +3 -1
  163. package/validation/rules/KnownArgumentNamesRule.js.map +1 -1
  164. package/validation/rules/KnownArgumentNamesRule.mjs.map +1 -1
  165. package/validation/rules/KnownDirectivesRule.js +2 -1
  166. package/validation/rules/KnownDirectivesRule.js.map +1 -1
  167. package/validation/rules/KnownDirectivesRule.mjs +2 -1
  168. package/validation/rules/KnownDirectivesRule.mjs.map +1 -1
  169. package/validation/rules/KnownFragmentNamesRule.d.mts +3 -1
  170. package/validation/rules/KnownFragmentNamesRule.d.ts +3 -1
  171. package/validation/rules/KnownFragmentNamesRule.js.map +1 -1
  172. package/validation/rules/KnownFragmentNamesRule.mjs.map +1 -1
  173. package/validation/rules/LoneAnonymousOperationRule.d.mts +6 -2
  174. package/validation/rules/LoneAnonymousOperationRule.d.ts +6 -2
  175. package/validation/rules/LoneAnonymousOperationRule.js.map +1 -1
  176. package/validation/rules/LoneAnonymousOperationRule.mjs.map +1 -1
  177. package/validation/rules/MaxIntrospectionDepthRule.d.mts +6 -2
  178. package/validation/rules/MaxIntrospectionDepthRule.d.ts +6 -2
  179. package/validation/rules/MaxIntrospectionDepthRule.js.map +1 -1
  180. package/validation/rules/MaxIntrospectionDepthRule.mjs.map +1 -1
  181. package/validation/rules/NoUndefinedVariablesRule.d.mts +3 -1
  182. package/validation/rules/NoUndefinedVariablesRule.d.ts +3 -1
  183. package/validation/rules/NoUndefinedVariablesRule.js.map +1 -1
  184. package/validation/rules/NoUndefinedVariablesRule.mjs.map +1 -1
  185. package/validation/rules/NoUnusedFragmentsRule.d.mts +3 -1
  186. package/validation/rules/NoUnusedFragmentsRule.d.ts +3 -1
  187. package/validation/rules/NoUnusedFragmentsRule.js.map +1 -1
  188. package/validation/rules/NoUnusedFragmentsRule.mjs.map +1 -1
  189. package/validation/rules/NoUnusedVariablesRule.d.mts +3 -1
  190. package/validation/rules/NoUnusedVariablesRule.d.ts +3 -1
  191. package/validation/rules/NoUnusedVariablesRule.js.map +1 -1
  192. package/validation/rules/NoUnusedVariablesRule.mjs.map +1 -1
  193. package/validation/rules/OverlappingFieldsCanBeMergedRule.d.mts +6 -2
  194. package/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts +6 -2
  195. package/validation/rules/OverlappingFieldsCanBeMergedRule.js.map +1 -1
  196. package/validation/rules/OverlappingFieldsCanBeMergedRule.mjs.map +1 -1
  197. package/validation/rules/PossibleFragmentSpreadsRule.d.mts +6 -2
  198. package/validation/rules/PossibleFragmentSpreadsRule.d.ts +6 -2
  199. package/validation/rules/PossibleFragmentSpreadsRule.js.map +1 -1
  200. package/validation/rules/PossibleFragmentSpreadsRule.mjs.map +1 -1
  201. package/validation/rules/ProvidedRequiredArgumentsRule.d.mts +6 -2
  202. package/validation/rules/ProvidedRequiredArgumentsRule.d.ts +6 -2
  203. package/validation/rules/ProvidedRequiredArgumentsRule.js.map +1 -1
  204. package/validation/rules/ProvidedRequiredArgumentsRule.mjs.map +1 -1
  205. package/validation/rules/SingleFieldSubscriptionsRule.d.mts +6 -2
  206. package/validation/rules/SingleFieldSubscriptionsRule.d.ts +6 -2
  207. package/validation/rules/SingleFieldSubscriptionsRule.js.map +1 -1
  208. package/validation/rules/SingleFieldSubscriptionsRule.mjs.map +1 -1
  209. package/validation/rules/UniqueArgumentNamesRule.d.mts +3 -1
  210. package/validation/rules/UniqueArgumentNamesRule.d.ts +3 -1
  211. package/validation/rules/UniqueArgumentNamesRule.js.map +1 -1
  212. package/validation/rules/UniqueArgumentNamesRule.mjs.map +1 -1
  213. package/validation/rules/UniqueDirectivesPerLocationRule.d.mts +6 -2
  214. package/validation/rules/UniqueDirectivesPerLocationRule.d.ts +6 -2
  215. package/validation/rules/UniqueDirectivesPerLocationRule.js.map +1 -1
  216. package/validation/rules/UniqueDirectivesPerLocationRule.mjs.map +1 -1
  217. package/validation/rules/UniqueFragmentNamesRule.d.mts +3 -1
  218. package/validation/rules/UniqueFragmentNamesRule.d.ts +3 -1
  219. package/validation/rules/UniqueFragmentNamesRule.js.map +1 -1
  220. package/validation/rules/UniqueFragmentNamesRule.mjs.map +1 -1
  221. package/validation/rules/UniqueInputFieldNamesRule.d.mts +6 -2
  222. package/validation/rules/UniqueInputFieldNamesRule.d.ts +6 -2
  223. package/validation/rules/UniqueInputFieldNamesRule.js.map +1 -1
  224. package/validation/rules/UniqueInputFieldNamesRule.mjs.map +1 -1
  225. package/validation/rules/UniqueOperationNamesRule.d.mts +3 -1
  226. package/validation/rules/UniqueOperationNamesRule.d.ts +3 -1
  227. package/validation/rules/UniqueOperationNamesRule.js.map +1 -1
  228. package/validation/rules/UniqueOperationNamesRule.mjs.map +1 -1
  229. package/validation/rules/UniqueVariableNamesRule.d.mts +3 -1
  230. package/validation/rules/UniqueVariableNamesRule.d.ts +3 -1
  231. package/validation/rules/UniqueVariableNamesRule.js.map +1 -1
  232. package/validation/rules/UniqueVariableNamesRule.mjs.map +1 -1
  233. package/validation/rules/ValuesOfCorrectTypeRule.d.mts +3 -1
  234. package/validation/rules/ValuesOfCorrectTypeRule.d.ts +3 -1
  235. package/validation/rules/ValuesOfCorrectTypeRule.js.map +1 -1
  236. package/validation/rules/ValuesOfCorrectTypeRule.mjs.map +1 -1
  237. package/validation/rules/VariablesAreInputTypesRule.d.mts +6 -2
  238. package/validation/rules/VariablesAreInputTypesRule.d.ts +6 -2
  239. package/validation/rules/VariablesAreInputTypesRule.js.map +1 -1
  240. package/validation/rules/VariablesAreInputTypesRule.mjs.map +1 -1
  241. package/validation/rules/VariablesInAllowedPositionRule.d.mts +6 -2
  242. package/validation/rules/VariablesInAllowedPositionRule.d.ts +6 -2
  243. package/validation/rules/VariablesInAllowedPositionRule.js.map +1 -1
  244. package/validation/rules/VariablesInAllowedPositionRule.mjs.map +1 -1
  245. package/validation/rules/custom/NoDeprecatedCustomRule.d.mts +3 -1
  246. package/validation/rules/custom/NoDeprecatedCustomRule.d.ts +3 -1
  247. package/validation/rules/custom/NoDeprecatedCustomRule.js.map +1 -1
  248. package/validation/rules/custom/NoDeprecatedCustomRule.mjs.map +1 -1
  249. package/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.mts +6 -2
  250. package/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts +6 -2
  251. package/validation/rules/custom/NoSchemaIntrospectionCustomRule.js.map +1 -1
  252. package/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs.map +1 -1
  253. package/validation/validate.d.mts +3 -6
  254. package/validation/validate.d.ts +3 -6
  255. package/validation/validate.js +6 -0
  256. package/validation/validate.js.map +1 -1
  257. package/validation/validate.mjs +6 -0
  258. package/validation/validate.mjs.map +1 -1
  259. package/version.js +2 -2
  260. package/version.js.map +1 -1
  261. package/version.mjs +2 -2
  262. package/version.mjs.map +1 -1
@@ -14,8 +14,9 @@ export type RootSelectionSetExecutor = (validatedExecutionArgs: ValidatedSubscri
14
14
  * are synchronous), or a Promise of an ExecutionResult that will eventually be
15
15
  * resolved and never rejected.
16
16
  *
17
- * If the arguments to this function do not result in a legal execution context,
18
- * a GraphQLError will be thrown immediately explaining the invalid input.
17
+ * If the schema is invalid, an error will be thrown immediately. GraphQL
18
+ * request errors, including missing operations and variable coercion errors,
19
+ * are returned in an errors-only ExecutionResult.
19
20
  *
20
21
  * Field errors are collected into the response instead of rejecting the
21
22
  * returned promise. Only the field that produced the error and its descendants
@@ -62,8 +63,9 @@ export declare function execute(args: ExecutionArgs): PromiseOrValue<ExecutionRe
62
63
  * ExperimentalIncrementalExecutionResults object containing an `initialResult`
63
64
  * and a stream of `subsequentResults`.
64
65
  *
65
- * If the arguments to this function do not result in a legal execution context,
66
- * a GraphQLError will be thrown immediately explaining the invalid input.
66
+ * If the schema is invalid, an error will be thrown immediately. GraphQL
67
+ * request errors, including missing operations and variable coercion errors,
68
+ * are returned in an errors-only ExecutionResult.
67
69
  * @param args - Execution arguments for the GraphQL operation.
68
70
  * @returns A single execution result or incremental execution results.
69
71
  * @example
@@ -94,17 +96,18 @@ export declare function executeIgnoringIncremental(args: ExecutionArgs): Promise
94
96
  /**
95
97
  * Implements the "Executing operations" section of the spec.
96
98
  *
97
- * Returns a Promise that will eventually resolve to the data described by
98
- * The "Response" section of the GraphQL specification.
99
+ * Returns either a synchronous ExecutionResult, or a Promise for an
100
+ * ExecutionResult, described by the "Response" section of the GraphQL
101
+ * specification.
99
102
  *
100
- * If errors are encountered while executing a GraphQL field, only that
101
- * field and its descendants will be omitted, and sibling fields will still
102
- * be executed. An execution which encounters errors will still result in a
103
- * resolved Promise.
103
+ * If errors are encountered while executing a GraphQL field, only that field
104
+ * and its descendants will be omitted, and sibling fields will still be
105
+ * executed. These field errors are collected into the returned result instead
106
+ * of being thrown or rejecting the returned promise.
104
107
  *
105
- * Errors from sub-fields of a NonNull type may propagate to the top level,
106
- * at which point we still log the error and null the parent field, which
107
- * in this case is the entire response.
108
+ * Errors from sub-fields of a NonNull type may propagate to the top level, at
109
+ * which point we still collect the error and null the parent field, which in
110
+ * this case is the entire response.
108
111
  * @param validatedExecutionArgs - Validated execution arguments.
109
112
  * @returns Execution result for the operation root selection set.
110
113
  * @example
@@ -112,7 +115,10 @@ export declare function executeIgnoringIncremental(args: ExecutionArgs): Promise
112
115
  * import assert from 'node:assert';
113
116
  * import { parse } from 'graphql/language';
114
117
  * import { buildSchema } from 'graphql/utilities';
115
- * import { executeRootSelectionSet, validateExecutionArgs } from 'graphql/execution';
118
+ * import {
119
+ * executeRootSelectionSet,
120
+ * validateExecutionArgs,
121
+ * } from 'graphql/execution';
116
122
  *
117
123
  * const schema = buildSchema('type Query { greeting: String }');
118
124
  * const validatedArgs = validateExecutionArgs({
@@ -185,6 +191,9 @@ export declare function executeRootSelectionSetIgnoringIncremental(validatedExec
185
191
  export declare function executeSync(args: ExecutionArgs): ExecutionResult;
186
192
  /**
187
193
  * Executes a subscription operation once for a single source event.
194
+ *
195
+ * Field errors are collected into the returned result instead of being thrown
196
+ * or rejecting the returned promise.
188
197
  * @param validatedExecutionArgs - Validated subscription execution arguments.
189
198
  * @returns Execution result for the subscription event.
190
199
  * @example
@@ -192,7 +201,10 @@ export declare function executeSync(args: ExecutionArgs): ExecutionResult;
192
201
  * import assert from 'node:assert';
193
202
  * import { parse } from 'graphql/language';
194
203
  * import { buildSchema } from 'graphql/utilities';
195
- * import { executeSubscriptionEvent, validateSubscriptionArgs } from 'graphql/execution';
204
+ * import {
205
+ * executeSubscriptionEvent,
206
+ * validateSubscriptionArgs,
207
+ * } from 'graphql/execution';
196
208
  *
197
209
  * const schema = buildSchema(`
198
210
  * type Query {
@@ -219,21 +231,22 @@ export declare function executeSubscriptionEvent(validatedExecutionArgs: Validat
219
231
  /**
220
232
  * Implements the "Subscribe" algorithm described in the GraphQL specification.
221
233
  *
222
- * Returns a Promise that resolves to either an AsyncIterator (if successful)
223
- * or an ExecutionResult (error). The promise will be rejected if the schema or
224
- * other arguments to this function are invalid, or if the resolved event stream
225
- * is not an async iterable.
234
+ * Returns either an AsyncGenerator (if successful), an ExecutionResult (error),
235
+ * or a Promise for one of those results. The call will throw immediately if
236
+ * the schema is invalid or the selected operation is not a subscription.
226
237
  *
227
- * If the client-provided arguments to this function do not result in a
228
- * compliant subscription, a GraphQL Response (ExecutionResult) with descriptive
229
- * errors and no data will be returned.
238
+ * GraphQL request errors, including missing operations and variable coercion
239
+ * errors, return or resolve to a GraphQL Response (ExecutionResult) with
240
+ * descriptive errors and no data.
230
241
  *
231
242
  * If the source stream could not be created due to faulty subscription resolver
232
- * logic or underlying systems, the promise will resolve to a single
233
- * ExecutionResult containing `errors` and no `data`.
243
+ * logic, a non-async-iterable resolver result, or a system error, the
244
+ * function will return or resolve to a single ExecutionResult containing
245
+ * `errors` and no `data`.
234
246
  *
235
- * If the operation succeeded, the promise resolves to an AsyncIterator, which
236
- * yields a stream of ExecutionResults representing the response stream.
247
+ * If the operation succeeded, the function returns or resolves to an
248
+ * AsyncGenerator, which yields a stream of ExecutionResults representing the
249
+ * response stream.
237
250
  *
238
251
  * This function does not support incremental delivery (`@defer` and `@stream`).
239
252
  * If an operation which would defer or stream data is executed with this
@@ -335,21 +348,20 @@ export declare function subscribe(args: ExecutionArgs): PromiseOrValue<AsyncGene
335
348
  * GraphQL specification, resolving the subscription source event stream for a
336
349
  * previously validated subscription request.
337
350
  *
338
- * Returns a Promise that resolves to either an AsyncIterable (if successful)
339
- * or an ExecutionResult (error). The promise will be rejected if the validated
340
- * execution arguments are invalid, or if the resolved event stream is not an
341
- * async iterable.
351
+ * Returns either an AsyncIterable (if successful), an ExecutionResult (error),
352
+ * or a Promise for one of those results. The call will throw immediately if
353
+ * it is not passed validated execution arguments.
342
354
  *
343
- * If the client-provided arguments to this function do not result in a
344
- * compliant subscription, a GraphQL Response (ExecutionResult) with
345
- * descriptive errors and no data will be returned.
355
+ * If the validated arguments do not result in a compliant subscription, a
356
+ * GraphQL Response (ExecutionResult) with descriptive errors and no data will
357
+ * be returned.
346
358
  *
347
359
  * If the source stream could not be created due to faulty subscription
348
- * resolver logic or underlying systems, the promise will resolve to a single
349
- * ExecutionResult containing `errors` and no `data`.
360
+ * resolver logic or a system error, the function will return or
361
+ * resolve to a single ExecutionResult containing `errors` and no `data`.
350
362
  *
351
- * If the operation succeeded, the promise resolves to the AsyncIterable for the
352
- * event stream returned by the resolver.
363
+ * If the operation succeeded, the function returns or resolves to the
364
+ * AsyncIterable for the event stream returned by the resolver.
353
365
  *
354
366
  * A Source Event Stream represents a sequence of events, each of which triggers
355
367
  * a GraphQL execution for that event.
@@ -365,7 +377,10 @@ export declare function subscribe(args: ExecutionArgs): PromiseOrValue<AsyncGene
365
377
  * import assert from 'node:assert';
366
378
  * import { parse } from 'graphql/language';
367
379
  * import { buildSchema } from 'graphql/utilities';
368
- * import { createSourceEventStream, validateSubscriptionArgs } from 'graphql/execution';
380
+ * import {
381
+ * createSourceEventStream,
382
+ * validateSubscriptionArgs,
383
+ * } from 'graphql/execution';
369
384
  *
370
385
  * async function* greetings() {
371
386
  * yield { greeting: 'Hello' };
@@ -394,12 +409,11 @@ export declare function subscribe(args: ExecutionArgs): PromiseOrValue<AsyncGene
394
409
  */
395
410
  export declare function createSourceEventStream(validatedExecutionArgs: ValidatedSubscriptionArgs): PromiseOrValue<AsyncIterable<unknown> | ExecutionResult>;
396
411
  /**
397
- * Constructs a ExecutionContext object from the arguments passed to
398
- * execute, which we will pass throughout the other execution methods.
399
- *
400
- * Throws a GraphQLError if a valid execution context cannot be created.
412
+ * Validates the arguments passed to execute, subscribe, and their lower-level
413
+ * helpers.
401
414
  *
402
- * TODO: consider no longer exporting this function
415
+ * Throws if the schema is invalid. GraphQL request errors, including variable
416
+ * coercion errors, are returned as a GraphQLError array.
403
417
  * @param args - Execution arguments to validate.
404
418
  * @returns Validated execution arguments, or validation errors.
405
419
  * @example
@@ -454,6 +468,10 @@ export declare function createSourceEventStream(validatedExecutionArgs: Validate
454
468
  export declare function validateExecutionArgs(args: ExecutionArgs): ReadonlyArray<GraphQLError> | ValidatedExecutionArgs;
455
469
  /**
456
470
  * Validates execution arguments for a subscription operation.
471
+ *
472
+ * Throws if the schema is invalid or the selected operation is not a
473
+ * subscription. GraphQL request errors, including variable coercion errors, are
474
+ * returned as a GraphQLError array.
457
475
  * @param args - Execution arguments to validate.
458
476
  * @returns Validated subscription execution arguments, or validation errors.
459
477
  * @example
@@ -514,7 +532,10 @@ export declare const defaultFieldResolver: GraphQLFieldResolver<unknown, unknown
514
532
  * import assert from 'node:assert';
515
533
  * import { parse } from 'graphql/language';
516
534
  * import { buildSchema } from 'graphql/utilities';
517
- * import { mapSourceToResponseEvent, validateSubscriptionArgs } from 'graphql/execution';
535
+ * import {
536
+ * mapSourceToResponseEvent,
537
+ * validateSubscriptionArgs,
538
+ * } from 'graphql/execution';
518
539
  *
519
540
  * async function* events() {
520
541
  * yield { greeting: 'Hello' };
@@ -14,8 +14,9 @@ export type RootSelectionSetExecutor = (validatedExecutionArgs: ValidatedSubscri
14
14
  * are synchronous), or a Promise of an ExecutionResult that will eventually be
15
15
  * resolved and never rejected.
16
16
  *
17
- * If the arguments to this function do not result in a legal execution context,
18
- * a GraphQLError will be thrown immediately explaining the invalid input.
17
+ * If the schema is invalid, an error will be thrown immediately. GraphQL
18
+ * request errors, including missing operations and variable coercion errors,
19
+ * are returned in an errors-only ExecutionResult.
19
20
  *
20
21
  * Field errors are collected into the response instead of rejecting the
21
22
  * returned promise. Only the field that produced the error and its descendants
@@ -62,8 +63,9 @@ export declare function execute(args: ExecutionArgs): PromiseOrValue<ExecutionRe
62
63
  * ExperimentalIncrementalExecutionResults object containing an `initialResult`
63
64
  * and a stream of `subsequentResults`.
64
65
  *
65
- * If the arguments to this function do not result in a legal execution context,
66
- * a GraphQLError will be thrown immediately explaining the invalid input.
66
+ * If the schema is invalid, an error will be thrown immediately. GraphQL
67
+ * request errors, including missing operations and variable coercion errors,
68
+ * are returned in an errors-only ExecutionResult.
67
69
  * @param args - Execution arguments for the GraphQL operation.
68
70
  * @returns A single execution result or incremental execution results.
69
71
  * @example
@@ -94,17 +96,18 @@ export declare function executeIgnoringIncremental(args: ExecutionArgs): Promise
94
96
  /**
95
97
  * Implements the "Executing operations" section of the spec.
96
98
  *
97
- * Returns a Promise that will eventually resolve to the data described by
98
- * The "Response" section of the GraphQL specification.
99
+ * Returns either a synchronous ExecutionResult, or a Promise for an
100
+ * ExecutionResult, described by the "Response" section of the GraphQL
101
+ * specification.
99
102
  *
100
- * If errors are encountered while executing a GraphQL field, only that
101
- * field and its descendants will be omitted, and sibling fields will still
102
- * be executed. An execution which encounters errors will still result in a
103
- * resolved Promise.
103
+ * If errors are encountered while executing a GraphQL field, only that field
104
+ * and its descendants will be omitted, and sibling fields will still be
105
+ * executed. These field errors are collected into the returned result instead
106
+ * of being thrown or rejecting the returned promise.
104
107
  *
105
- * Errors from sub-fields of a NonNull type may propagate to the top level,
106
- * at which point we still log the error and null the parent field, which
107
- * in this case is the entire response.
108
+ * Errors from sub-fields of a NonNull type may propagate to the top level, at
109
+ * which point we still collect the error and null the parent field, which in
110
+ * this case is the entire response.
108
111
  * @param validatedExecutionArgs - Validated execution arguments.
109
112
  * @returns Execution result for the operation root selection set.
110
113
  * @example
@@ -112,7 +115,10 @@ export declare function executeIgnoringIncremental(args: ExecutionArgs): Promise
112
115
  * import assert from 'node:assert';
113
116
  * import { parse } from 'graphql/language';
114
117
  * import { buildSchema } from 'graphql/utilities';
115
- * import { executeRootSelectionSet, validateExecutionArgs } from 'graphql/execution';
118
+ * import {
119
+ * executeRootSelectionSet,
120
+ * validateExecutionArgs,
121
+ * } from 'graphql/execution';
116
122
  *
117
123
  * const schema = buildSchema('type Query { greeting: String }');
118
124
  * const validatedArgs = validateExecutionArgs({
@@ -185,6 +191,9 @@ export declare function executeRootSelectionSetIgnoringIncremental(validatedExec
185
191
  export declare function executeSync(args: ExecutionArgs): ExecutionResult;
186
192
  /**
187
193
  * Executes a subscription operation once for a single source event.
194
+ *
195
+ * Field errors are collected into the returned result instead of being thrown
196
+ * or rejecting the returned promise.
188
197
  * @param validatedExecutionArgs - Validated subscription execution arguments.
189
198
  * @returns Execution result for the subscription event.
190
199
  * @example
@@ -192,7 +201,10 @@ export declare function executeSync(args: ExecutionArgs): ExecutionResult;
192
201
  * import assert from 'node:assert';
193
202
  * import { parse } from 'graphql/language';
194
203
  * import { buildSchema } from 'graphql/utilities';
195
- * import { executeSubscriptionEvent, validateSubscriptionArgs } from 'graphql/execution';
204
+ * import {
205
+ * executeSubscriptionEvent,
206
+ * validateSubscriptionArgs,
207
+ * } from 'graphql/execution';
196
208
  *
197
209
  * const schema = buildSchema(`
198
210
  * type Query {
@@ -219,21 +231,22 @@ export declare function executeSubscriptionEvent(validatedExecutionArgs: Validat
219
231
  /**
220
232
  * Implements the "Subscribe" algorithm described in the GraphQL specification.
221
233
  *
222
- * Returns a Promise that resolves to either an AsyncIterator (if successful)
223
- * or an ExecutionResult (error). The promise will be rejected if the schema or
224
- * other arguments to this function are invalid, or if the resolved event stream
225
- * is not an async iterable.
234
+ * Returns either an AsyncGenerator (if successful), an ExecutionResult (error),
235
+ * or a Promise for one of those results. The call will throw immediately if
236
+ * the schema is invalid or the selected operation is not a subscription.
226
237
  *
227
- * If the client-provided arguments to this function do not result in a
228
- * compliant subscription, a GraphQL Response (ExecutionResult) with descriptive
229
- * errors and no data will be returned.
238
+ * GraphQL request errors, including missing operations and variable coercion
239
+ * errors, return or resolve to a GraphQL Response (ExecutionResult) with
240
+ * descriptive errors and no data.
230
241
  *
231
242
  * If the source stream could not be created due to faulty subscription resolver
232
- * logic or underlying systems, the promise will resolve to a single
233
- * ExecutionResult containing `errors` and no `data`.
243
+ * logic, a non-async-iterable resolver result, or a system error, the
244
+ * function will return or resolve to a single ExecutionResult containing
245
+ * `errors` and no `data`.
234
246
  *
235
- * If the operation succeeded, the promise resolves to an AsyncIterator, which
236
- * yields a stream of ExecutionResults representing the response stream.
247
+ * If the operation succeeded, the function returns or resolves to an
248
+ * AsyncGenerator, which yields a stream of ExecutionResults representing the
249
+ * response stream.
237
250
  *
238
251
  * This function does not support incremental delivery (`@defer` and `@stream`).
239
252
  * If an operation which would defer or stream data is executed with this
@@ -335,21 +348,20 @@ export declare function subscribe(args: ExecutionArgs): PromiseOrValue<AsyncGene
335
348
  * GraphQL specification, resolving the subscription source event stream for a
336
349
  * previously validated subscription request.
337
350
  *
338
- * Returns a Promise that resolves to either an AsyncIterable (if successful)
339
- * or an ExecutionResult (error). The promise will be rejected if the validated
340
- * execution arguments are invalid, or if the resolved event stream is not an
341
- * async iterable.
351
+ * Returns either an AsyncIterable (if successful), an ExecutionResult (error),
352
+ * or a Promise for one of those results. The call will throw immediately if
353
+ * it is not passed validated execution arguments.
342
354
  *
343
- * If the client-provided arguments to this function do not result in a
344
- * compliant subscription, a GraphQL Response (ExecutionResult) with
345
- * descriptive errors and no data will be returned.
355
+ * If the validated arguments do not result in a compliant subscription, a
356
+ * GraphQL Response (ExecutionResult) with descriptive errors and no data will
357
+ * be returned.
346
358
  *
347
359
  * If the source stream could not be created due to faulty subscription
348
- * resolver logic or underlying systems, the promise will resolve to a single
349
- * ExecutionResult containing `errors` and no `data`.
360
+ * resolver logic or a system error, the function will return or
361
+ * resolve to a single ExecutionResult containing `errors` and no `data`.
350
362
  *
351
- * If the operation succeeded, the promise resolves to the AsyncIterable for the
352
- * event stream returned by the resolver.
363
+ * If the operation succeeded, the function returns or resolves to the
364
+ * AsyncIterable for the event stream returned by the resolver.
353
365
  *
354
366
  * A Source Event Stream represents a sequence of events, each of which triggers
355
367
  * a GraphQL execution for that event.
@@ -365,7 +377,10 @@ export declare function subscribe(args: ExecutionArgs): PromiseOrValue<AsyncGene
365
377
  * import assert from 'node:assert';
366
378
  * import { parse } from 'graphql/language';
367
379
  * import { buildSchema } from 'graphql/utilities';
368
- * import { createSourceEventStream, validateSubscriptionArgs } from 'graphql/execution';
380
+ * import {
381
+ * createSourceEventStream,
382
+ * validateSubscriptionArgs,
383
+ * } from 'graphql/execution';
369
384
  *
370
385
  * async function* greetings() {
371
386
  * yield { greeting: 'Hello' };
@@ -394,12 +409,11 @@ export declare function subscribe(args: ExecutionArgs): PromiseOrValue<AsyncGene
394
409
  */
395
410
  export declare function createSourceEventStream(validatedExecutionArgs: ValidatedSubscriptionArgs): PromiseOrValue<AsyncIterable<unknown> | ExecutionResult>;
396
411
  /**
397
- * Constructs a ExecutionContext object from the arguments passed to
398
- * execute, which we will pass throughout the other execution methods.
399
- *
400
- * Throws a GraphQLError if a valid execution context cannot be created.
412
+ * Validates the arguments passed to execute, subscribe, and their lower-level
413
+ * helpers.
401
414
  *
402
- * TODO: consider no longer exporting this function
415
+ * Throws if the schema is invalid. GraphQL request errors, including variable
416
+ * coercion errors, are returned as a GraphQLError array.
403
417
  * @param args - Execution arguments to validate.
404
418
  * @returns Validated execution arguments, or validation errors.
405
419
  * @example
@@ -454,6 +468,10 @@ export declare function createSourceEventStream(validatedExecutionArgs: Validate
454
468
  export declare function validateExecutionArgs(args: ExecutionArgs): ReadonlyArray<GraphQLError> | ValidatedExecutionArgs;
455
469
  /**
456
470
  * Validates execution arguments for a subscription operation.
471
+ *
472
+ * Throws if the schema is invalid or the selected operation is not a
473
+ * subscription. GraphQL request errors, including variable coercion errors, are
474
+ * returned as a GraphQLError array.
457
475
  * @param args - Execution arguments to validate.
458
476
  * @returns Validated subscription execution arguments, or validation errors.
459
477
  * @example
@@ -514,7 +532,10 @@ export declare const defaultFieldResolver: GraphQLFieldResolver<unknown, unknown
514
532
  * import assert from 'node:assert';
515
533
  * import { parse } from 'graphql/language';
516
534
  * import { buildSchema } from 'graphql/utilities';
517
- * import { mapSourceToResponseEvent, validateSubscriptionArgs } from 'graphql/execution';
535
+ * import {
536
+ * mapSourceToResponseEvent,
537
+ * validateSubscriptionArgs,
538
+ * } from 'graphql/execution';
518
539
  *
519
540
  * async function* events() {
520
541
  * yield { greeting: 'Hello' };
@@ -26,6 +26,8 @@ const kinds_ts_1 = require("../language/kinds.js");
26
26
  const predicates_ts_1 = require("../language/predicates.js");
27
27
  const directives_ts_1 = require("../type/directives.js");
28
28
  const index_ts_1 = require("../type/index.js");
29
+ const getOperationAST_ts_1 = require("../utilities/getOperationAST.js");
30
+ const diagnostics_ts_1 = require("../diagnostics.js");
29
31
  const buildResolveInfo_ts_1 = require("./buildResolveInfo.js");
30
32
  const cancellablePromise_ts_1 = require("./cancellablePromise.js");
31
33
  const collectFields_ts_1 = require("./collectFields.js");
@@ -38,6 +40,32 @@ const mapAsyncIterable_ts_1 = require("./mapAsyncIterable.js");
38
40
  const values_ts_1 = require("./values.js");
39
41
  const UNEXPECTED_EXPERIMENTAL_DIRECTIVES = 'The provided schema unexpectedly contains experimental directives (@defer or @stream). These directives may only be utilized if experimental execution features are explicitly enabled.';
40
42
  function execute(args) {
43
+ if (!(0, diagnostics_ts_1.shouldTrace)(diagnostics_ts_1.executeChannel)) {
44
+ return executeImpl(args);
45
+ }
46
+ return (0, diagnostics_ts_1.traceMixed)(diagnostics_ts_1.executeChannel, buildOperationContextFromArgs(args), () => executeImpl(args));
47
+ }
48
+ function buildOperationContextFromArgs(args) {
49
+ let operation;
50
+ const resolveOperation = () => {
51
+ if (operation === undefined) {
52
+ operation = (0, getOperationAST_ts_1.getOperationAST)(args.document, args.operationName);
53
+ }
54
+ return operation;
55
+ };
56
+ return {
57
+ schema: args.schema,
58
+ document: args.document,
59
+ rawVariableValues: args.variableValues,
60
+ get operationName() {
61
+ return args.operationName ?? resolveOperation()?.name?.value;
62
+ },
63
+ get operationType() {
64
+ return resolveOperation()?.operation;
65
+ },
66
+ };
67
+ }
68
+ function executeImpl(args) {
41
69
  if (args.schema.getDirective('defer') || args.schema.getDirective('stream')) {
42
70
  throw new Error(UNEXPECTED_EXPERIMENTAL_DIRECTIVES);
43
71
  }
@@ -48,6 +76,12 @@ function execute(args) {
48
76
  return executeRootSelectionSet(validatedExecutionArgs);
49
77
  }
50
78
  function experimentalExecuteIncrementally(args) {
79
+ if (!(0, diagnostics_ts_1.shouldTrace)(diagnostics_ts_1.executeChannel)) {
80
+ return experimentalExecuteIncrementallyImpl(args);
81
+ }
82
+ return (0, diagnostics_ts_1.traceMixed)(diagnostics_ts_1.executeChannel, buildOperationContextFromArgs(args), () => experimentalExecuteIncrementallyImpl(args));
83
+ }
84
+ function experimentalExecuteIncrementallyImpl(args) {
51
85
  const validatedExecutionArgs = validateExecutionArgs(args);
52
86
  if (!('schema' in validatedExecutionArgs)) {
53
87
  return { errors: validatedExecutionArgs };
@@ -55,6 +89,12 @@ function experimentalExecuteIncrementally(args) {
55
89
  return experimentalExecuteRootSelectionSet(validatedExecutionArgs);
56
90
  }
57
91
  function executeIgnoringIncremental(args) {
92
+ if (!(0, diagnostics_ts_1.shouldTrace)(diagnostics_ts_1.executeChannel)) {
93
+ return executeIgnoringIncrementalImpl(args);
94
+ }
95
+ return (0, diagnostics_ts_1.traceMixed)(diagnostics_ts_1.executeChannel, buildOperationContextFromArgs(args), () => executeIgnoringIncrementalImpl(args));
96
+ }
97
+ function executeIgnoringIncrementalImpl(args) {
58
98
  const validatedExecutionArgs = validateExecutionArgs(args);
59
99
  if (!('schema' in validatedExecutionArgs)) {
60
100
  return { errors: validatedExecutionArgs };
@@ -81,6 +121,12 @@ function executeSubscriptionEvent(validatedExecutionArgs) {
81
121
  return new ExecutorThrowingOnIncremental_ts_1.ExecutorThrowingOnIncremental(validatedExecutionArgs).executeRootSelectionSet(false);
82
122
  }
83
123
  function subscribe(args) {
124
+ if (!(0, diagnostics_ts_1.shouldTrace)(diagnostics_ts_1.subscribeChannel)) {
125
+ return subscribeImpl(args);
126
+ }
127
+ return (0, diagnostics_ts_1.traceMixed)(diagnostics_ts_1.subscribeChannel, buildOperationContextFromArgs(args), () => subscribeImpl(args));
128
+ }
129
+ function subscribeImpl(args) {
84
130
  const validatedExecutionArgs = validateSubscriptionArgs(args);
85
131
  if (!('schema' in validatedExecutionArgs)) {
86
132
  return { errors: validatedExecutionArgs };
@@ -118,6 +164,7 @@ function validateExecutionArgs(args) {
118
164
  let operation;
119
165
  const fragmentDefinitions = Object.create(null);
120
166
  const fragments = Object.create(null);
167
+ const fragmentVariableSignatureErrors = [];
121
168
  for (const definition of document.definitions) {
122
169
  switch (definition.kind) {
123
170
  case kinds_ts_1.Kind.OPERATION_DEFINITION:
@@ -137,11 +184,16 @@ function validateExecutionArgs(args) {
137
184
  fragmentDefinitions[definition.name.value] = definition;
138
185
  let variableSignatures;
139
186
  if (definition.variableDefinitions) {
140
- variableSignatures = Object.create(null);
187
+ const signatures = Object.create(null);
141
188
  for (const varDef of definition.variableDefinitions) {
142
189
  const signature = (0, getVariableSignature_ts_1.getVariableSignature)(schema, varDef);
143
- variableSignatures[signature.name] = signature;
190
+ if (signature instanceof GraphQLError_ts_1.GraphQLError) {
191
+ fragmentVariableSignatureErrors.push(signature);
192
+ continue;
193
+ }
194
+ signatures[signature.name] = signature;
144
195
  }
196
+ variableSignatures = signatures;
145
197
  }
146
198
  fragments[definition.name.value] = { definition, variableSignatures };
147
199
  break;
@@ -155,18 +207,34 @@ function validateExecutionArgs(args) {
155
207
  }
156
208
  return [new GraphQLError_ts_1.GraphQLError('Must provide an operation.')];
157
209
  }
210
+ if (fragmentVariableSignatureErrors.length > 0) {
211
+ return fragmentVariableSignatureErrors;
212
+ }
158
213
  const variableDefinitions = operation.variableDefinitions ?? [];
159
214
  const hideSuggestions = args.hideSuggestions ?? false;
160
- const variableValuesOrErrors = (0, values_ts_1.getVariableValues)(schema, variableDefinitions, rawVariableValues ?? {}, {
215
+ const coercionInput = rawVariableValues ?? {};
216
+ const coercionOptions = {
161
217
  maxErrors: options?.maxCoercionErrors ?? 50,
162
218
  hideSuggestions,
163
- });
219
+ };
220
+ const coercionChannel = diagnostics_ts_1.executeVariableCoercionChannel;
221
+ const variableValuesOrErrors = (0, diagnostics_ts_1.shouldTrace)(coercionChannel)
222
+ ? (0, diagnostics_ts_1.traceMixed)(coercionChannel, {
223
+ schema,
224
+ document,
225
+ operation,
226
+ rawVariableValues,
227
+ operationName: operation.name?.value,
228
+ operationType: operation.operation,
229
+ }, () => (0, values_ts_1.getVariableValues)(schema, variableDefinitions, coercionInput, coercionOptions))
230
+ : (0, values_ts_1.getVariableValues)(schema, variableDefinitions, coercionInput, coercionOptions);
164
231
  if (variableValuesOrErrors.errors) {
165
232
  return variableValuesOrErrors.errors;
166
233
  }
167
234
  const errorPropagation = !operation.directives?.find((directive) => directive.name.value === directives_ts_1.GraphQLDisableErrorPropagationDirective.name);
168
235
  return {
169
236
  schema,
237
+ document,
170
238
  fragmentDefinitions,
171
239
  fragments,
172
240
  rootValue,
@@ -181,6 +249,7 @@ function validateExecutionArgs(args) {
181
249
  externalAbortSignal: externalAbortSignal ?? undefined,
182
250
  enableEarlyExecution: enableEarlyExecution === true,
183
251
  hooks: hooks ?? undefined,
252
+ rawVariableValues,
184
253
  };
185
254
  }
186
255
  function validateSubscriptionArgs(args) {