graphql 17.0.0-alpha.8 → 17.0.0-beta.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 (1267) hide show
  1. package/README.md +54 -10
  2. package/__dev__/devMode.d.mts +1 -0
  3. package/__dev__/devMode.d.ts +1 -0
  4. package/__dev__/devMode.js +3 -0
  5. package/__dev__/devMode.mjs +3 -0
  6. package/__dev__/error/GraphQLError.d.mts +1 -0
  7. package/__dev__/error/GraphQLError.d.ts +1 -0
  8. package/__dev__/error/GraphQLError.js +3 -0
  9. package/__dev__/error/GraphQLError.mjs +3 -0
  10. package/__dev__/error/ensureGraphQLError.d.mts +1 -0
  11. package/__dev__/error/ensureGraphQLError.d.ts +1 -0
  12. package/__dev__/error/ensureGraphQLError.js +3 -0
  13. package/__dev__/error/ensureGraphQLError.mjs +3 -0
  14. package/__dev__/error/index.d.mts +1 -0
  15. package/__dev__/error/index.d.ts +1 -0
  16. package/__dev__/error/index.js +3 -0
  17. package/__dev__/error/index.mjs +3 -0
  18. package/__dev__/error/locatedError.d.mts +1 -0
  19. package/__dev__/error/locatedError.d.ts +1 -0
  20. package/__dev__/error/locatedError.js +3 -0
  21. package/__dev__/error/locatedError.mjs +3 -0
  22. package/__dev__/error/syntaxError.d.mts +1 -0
  23. package/__dev__/error/syntaxError.d.ts +1 -0
  24. package/__dev__/error/syntaxError.js +3 -0
  25. package/__dev__/error/syntaxError.mjs +3 -0
  26. package/__dev__/execution/AbortedGraphQLExecutionError.d.mts +1 -0
  27. package/__dev__/execution/AbortedGraphQLExecutionError.d.ts +1 -0
  28. package/__dev__/execution/AbortedGraphQLExecutionError.js +3 -0
  29. package/__dev__/execution/AbortedGraphQLExecutionError.mjs +3 -0
  30. package/__dev__/execution/AsyncWorkTracker.d.mts +1 -0
  31. package/__dev__/execution/AsyncWorkTracker.d.ts +1 -0
  32. package/__dev__/execution/AsyncWorkTracker.js +3 -0
  33. package/__dev__/execution/AsyncWorkTracker.mjs +3 -0
  34. package/__dev__/execution/Executor.d.mts +1 -0
  35. package/__dev__/execution/Executor.d.ts +1 -0
  36. package/__dev__/execution/Executor.js +3 -0
  37. package/__dev__/execution/Executor.mjs +3 -0
  38. package/__dev__/execution/ExecutorThrowingOnIncremental.d.mts +1 -0
  39. package/__dev__/execution/ExecutorThrowingOnIncremental.d.ts +1 -0
  40. package/__dev__/execution/ExecutorThrowingOnIncremental.js +3 -0
  41. package/__dev__/execution/ExecutorThrowingOnIncremental.mjs +3 -0
  42. package/__dev__/execution/cancellablePromise.d.mts +1 -0
  43. package/__dev__/execution/cancellablePromise.d.ts +1 -0
  44. package/__dev__/execution/cancellablePromise.js +3 -0
  45. package/__dev__/execution/cancellablePromise.mjs +3 -0
  46. package/__dev__/execution/collectFields.d.mts +1 -0
  47. package/__dev__/execution/collectFields.d.ts +1 -0
  48. package/__dev__/execution/collectFields.js +3 -0
  49. package/__dev__/execution/collectFields.mjs +3 -0
  50. package/__dev__/execution/collectIteratorPromises.d.mts +1 -0
  51. package/__dev__/execution/collectIteratorPromises.d.ts +1 -0
  52. package/__dev__/execution/collectIteratorPromises.js +3 -0
  53. package/__dev__/execution/collectIteratorPromises.mjs +3 -0
  54. package/__dev__/execution/createSharedExecutionContext.d.mts +1 -0
  55. package/__dev__/execution/createSharedExecutionContext.d.ts +1 -0
  56. package/__dev__/execution/createSharedExecutionContext.js +3 -0
  57. package/__dev__/execution/createSharedExecutionContext.mjs +3 -0
  58. package/__dev__/execution/execute.d.mts +1 -0
  59. package/__dev__/execution/execute.d.ts +1 -0
  60. package/__dev__/execution/execute.js +3 -0
  61. package/__dev__/execution/execute.mjs +3 -0
  62. package/__dev__/execution/getStreamUsage.d.mts +1 -0
  63. package/__dev__/execution/getStreamUsage.d.ts +1 -0
  64. package/__dev__/execution/getStreamUsage.js +3 -0
  65. package/__dev__/execution/getStreamUsage.mjs +3 -0
  66. package/__dev__/execution/getVariableSignature.d.mts +1 -0
  67. package/__dev__/execution/getVariableSignature.d.ts +1 -0
  68. package/__dev__/execution/getVariableSignature.js +3 -0
  69. package/__dev__/execution/getVariableSignature.mjs +3 -0
  70. package/__dev__/execution/hooks.d.mts +1 -0
  71. package/__dev__/execution/hooks.d.ts +1 -0
  72. package/__dev__/execution/hooks.js +3 -0
  73. package/__dev__/execution/hooks.mjs +3 -0
  74. package/__dev__/execution/incremental/Computation.d.mts +1 -0
  75. package/__dev__/execution/incremental/Computation.d.ts +1 -0
  76. package/__dev__/execution/incremental/Computation.js +3 -0
  77. package/__dev__/execution/incremental/Computation.mjs +3 -0
  78. package/__dev__/execution/incremental/IncrementalExecutor.d.mts +1 -0
  79. package/__dev__/execution/incremental/IncrementalExecutor.d.ts +1 -0
  80. package/__dev__/execution/incremental/IncrementalExecutor.js +3 -0
  81. package/__dev__/execution/incremental/IncrementalExecutor.mjs +3 -0
  82. package/__dev__/execution/incremental/IncrementalPublisher.d.mts +1 -0
  83. package/__dev__/execution/incremental/IncrementalPublisher.d.ts +1 -0
  84. package/__dev__/execution/incremental/IncrementalPublisher.js +3 -0
  85. package/__dev__/execution/incremental/IncrementalPublisher.mjs +3 -0
  86. package/__dev__/execution/incremental/Queue.d.mts +1 -0
  87. package/__dev__/execution/incremental/Queue.d.ts +1 -0
  88. package/__dev__/execution/incremental/Queue.js +3 -0
  89. package/__dev__/execution/incremental/Queue.mjs +3 -0
  90. package/__dev__/execution/incremental/WorkQueue.d.mts +1 -0
  91. package/__dev__/execution/incremental/WorkQueue.d.ts +1 -0
  92. package/__dev__/execution/incremental/WorkQueue.js +3 -0
  93. package/__dev__/execution/incremental/WorkQueue.mjs +3 -0
  94. package/__dev__/execution/incremental/buildExecutionPlan.d.mts +1 -0
  95. package/__dev__/execution/incremental/buildExecutionPlan.d.ts +1 -0
  96. package/__dev__/execution/incremental/buildExecutionPlan.js +3 -0
  97. package/__dev__/execution/incremental/buildExecutionPlan.mjs +3 -0
  98. package/__dev__/execution/index.d.mts +1 -0
  99. package/__dev__/execution/index.d.ts +1 -0
  100. package/__dev__/execution/index.js +3 -0
  101. package/__dev__/execution/index.mjs +3 -0
  102. package/__dev__/execution/mapAsyncIterable.d.mts +1 -0
  103. package/__dev__/execution/mapAsyncIterable.d.ts +1 -0
  104. package/__dev__/execution/mapAsyncIterable.js +3 -0
  105. package/__dev__/execution/mapAsyncIterable.mjs +3 -0
  106. package/__dev__/execution/returnIteratorCatchingErrors.d.mts +1 -0
  107. package/__dev__/execution/returnIteratorCatchingErrors.d.ts +1 -0
  108. package/__dev__/execution/returnIteratorCatchingErrors.js +3 -0
  109. package/__dev__/execution/returnIteratorCatchingErrors.mjs +3 -0
  110. package/__dev__/execution/values.d.mts +1 -0
  111. package/__dev__/execution/values.d.ts +1 -0
  112. package/__dev__/execution/values.js +3 -0
  113. package/__dev__/execution/values.mjs +3 -0
  114. package/__dev__/execution/withConcurrentAbruptClose.d.mts +1 -0
  115. package/__dev__/execution/withConcurrentAbruptClose.d.ts +1 -0
  116. package/__dev__/execution/withConcurrentAbruptClose.js +3 -0
  117. package/__dev__/execution/withConcurrentAbruptClose.mjs +3 -0
  118. package/__dev__/graphql.d.mts +1 -0
  119. package/__dev__/graphql.d.ts +1 -0
  120. package/__dev__/graphql.js +3 -0
  121. package/__dev__/graphql.mjs +3 -0
  122. package/__dev__/harness.d.mts +1 -0
  123. package/__dev__/harness.d.ts +1 -0
  124. package/__dev__/harness.js +3 -0
  125. package/__dev__/harness.mjs +3 -0
  126. package/__dev__/index.d.mts +1 -0
  127. package/__dev__/index.d.ts +1 -0
  128. package/__dev__/index.js +3 -0
  129. package/__dev__/index.mjs +3 -0
  130. package/__dev__/jsutils/AccumulatorMap.d.mts +1 -0
  131. package/__dev__/jsutils/AccumulatorMap.d.ts +1 -0
  132. package/__dev__/jsutils/AccumulatorMap.js +3 -0
  133. package/__dev__/jsutils/AccumulatorMap.mjs +3 -0
  134. package/__dev__/jsutils/Maybe.d.mts +1 -0
  135. package/__dev__/jsutils/Maybe.d.ts +1 -0
  136. package/__dev__/jsutils/Maybe.js +3 -0
  137. package/__dev__/jsutils/Maybe.mjs +3 -0
  138. package/__dev__/jsutils/ObjMap.d.mts +1 -0
  139. package/__dev__/jsutils/ObjMap.d.ts +1 -0
  140. package/__dev__/jsutils/ObjMap.js +3 -0
  141. package/__dev__/jsutils/ObjMap.mjs +3 -0
  142. package/__dev__/jsutils/Path.d.mts +1 -0
  143. package/__dev__/jsutils/Path.d.ts +1 -0
  144. package/__dev__/jsutils/Path.js +3 -0
  145. package/__dev__/jsutils/Path.mjs +3 -0
  146. package/__dev__/jsutils/PromiseOrValue.d.mts +1 -0
  147. package/__dev__/jsutils/PromiseOrValue.d.ts +1 -0
  148. package/__dev__/jsutils/PromiseOrValue.js +3 -0
  149. package/__dev__/jsutils/PromiseOrValue.mjs +3 -0
  150. package/__dev__/jsutils/capitalize.d.mts +1 -0
  151. package/__dev__/jsutils/capitalize.d.ts +1 -0
  152. package/__dev__/jsutils/capitalize.js +3 -0
  153. package/__dev__/jsutils/capitalize.mjs +3 -0
  154. package/__dev__/jsutils/devAssert.d.mts +1 -0
  155. package/__dev__/jsutils/devAssert.d.ts +1 -0
  156. package/__dev__/jsutils/devAssert.js +3 -0
  157. package/__dev__/jsutils/devAssert.mjs +3 -0
  158. package/__dev__/jsutils/didYouMean.d.mts +1 -0
  159. package/__dev__/jsutils/didYouMean.d.ts +1 -0
  160. package/__dev__/jsutils/didYouMean.js +3 -0
  161. package/__dev__/jsutils/didYouMean.mjs +3 -0
  162. package/__dev__/jsutils/formatList.d.mts +1 -0
  163. package/__dev__/jsutils/formatList.d.ts +1 -0
  164. package/__dev__/jsutils/formatList.js +3 -0
  165. package/__dev__/jsutils/formatList.mjs +3 -0
  166. package/__dev__/jsutils/getBySet.d.mts +1 -0
  167. package/__dev__/jsutils/getBySet.d.ts +1 -0
  168. package/__dev__/jsutils/getBySet.js +3 -0
  169. package/__dev__/jsutils/getBySet.mjs +3 -0
  170. package/__dev__/jsutils/groupBy.d.mts +1 -0
  171. package/__dev__/jsutils/groupBy.d.ts +1 -0
  172. package/__dev__/jsutils/groupBy.js +3 -0
  173. package/__dev__/jsutils/groupBy.mjs +3 -0
  174. package/__dev__/jsutils/identityFunc.d.mts +1 -0
  175. package/__dev__/jsutils/identityFunc.d.ts +1 -0
  176. package/__dev__/jsutils/identityFunc.js +3 -0
  177. package/__dev__/jsutils/identityFunc.mjs +3 -0
  178. package/__dev__/jsutils/inspect.d.mts +1 -0
  179. package/__dev__/jsutils/inspect.d.ts +1 -0
  180. package/__dev__/jsutils/inspect.js +3 -0
  181. package/__dev__/jsutils/inspect.mjs +3 -0
  182. package/__dev__/jsutils/instanceOf.d.mts +1 -0
  183. package/__dev__/jsutils/instanceOf.d.ts +1 -0
  184. package/__dev__/jsutils/instanceOf.js +3 -0
  185. package/__dev__/jsutils/instanceOf.mjs +3 -0
  186. package/__dev__/jsutils/invariant.d.mts +1 -0
  187. package/__dev__/jsutils/invariant.d.ts +1 -0
  188. package/__dev__/jsutils/invariant.js +3 -0
  189. package/__dev__/jsutils/invariant.mjs +3 -0
  190. package/__dev__/jsutils/isAsyncIterable.d.mts +1 -0
  191. package/__dev__/jsutils/isAsyncIterable.d.ts +1 -0
  192. package/__dev__/jsutils/isAsyncIterable.js +3 -0
  193. package/__dev__/jsutils/isAsyncIterable.mjs +3 -0
  194. package/__dev__/jsutils/isIterableObject.d.mts +1 -0
  195. package/__dev__/jsutils/isIterableObject.d.ts +1 -0
  196. package/__dev__/jsutils/isIterableObject.js +3 -0
  197. package/__dev__/jsutils/isIterableObject.mjs +3 -0
  198. package/__dev__/jsutils/isObjectLike.d.mts +1 -0
  199. package/__dev__/jsutils/isObjectLike.d.ts +1 -0
  200. package/__dev__/jsutils/isObjectLike.js +3 -0
  201. package/__dev__/jsutils/isObjectLike.mjs +3 -0
  202. package/__dev__/jsutils/isPromise.d.mts +1 -0
  203. package/__dev__/jsutils/isPromise.d.ts +1 -0
  204. package/__dev__/jsutils/isPromise.js +3 -0
  205. package/__dev__/jsutils/isPromise.mjs +3 -0
  206. package/__dev__/jsutils/isSameSet.d.mts +1 -0
  207. package/__dev__/jsutils/isSameSet.d.ts +1 -0
  208. package/__dev__/jsutils/isSameSet.js +3 -0
  209. package/__dev__/jsutils/isSameSet.mjs +3 -0
  210. package/__dev__/jsutils/keyMap.d.mts +1 -0
  211. package/__dev__/jsutils/keyMap.d.ts +1 -0
  212. package/__dev__/jsutils/keyMap.js +3 -0
  213. package/__dev__/jsutils/keyMap.mjs +3 -0
  214. package/__dev__/jsutils/keyValMap.d.mts +1 -0
  215. package/__dev__/jsutils/keyValMap.d.ts +1 -0
  216. package/__dev__/jsutils/keyValMap.js +3 -0
  217. package/__dev__/jsutils/keyValMap.mjs +3 -0
  218. package/__dev__/jsutils/mapValue.d.mts +1 -0
  219. package/__dev__/jsutils/mapValue.d.ts +1 -0
  220. package/__dev__/jsutils/mapValue.js +3 -0
  221. package/__dev__/jsutils/mapValue.mjs +3 -0
  222. package/__dev__/jsutils/memoize1.d.mts +1 -0
  223. package/__dev__/jsutils/memoize1.d.ts +1 -0
  224. package/__dev__/jsutils/memoize1.js +3 -0
  225. package/__dev__/jsutils/memoize1.mjs +3 -0
  226. package/__dev__/jsutils/memoize2.d.mts +1 -0
  227. package/__dev__/jsutils/memoize2.d.ts +1 -0
  228. package/__dev__/jsutils/memoize2.js +3 -0
  229. package/__dev__/jsutils/memoize2.mjs +3 -0
  230. package/__dev__/jsutils/memoize3.d.mts +1 -0
  231. package/__dev__/jsutils/memoize3.d.ts +1 -0
  232. package/__dev__/jsutils/memoize3.js +3 -0
  233. package/__dev__/jsutils/memoize3.mjs +3 -0
  234. package/__dev__/jsutils/naturalCompare.d.mts +1 -0
  235. package/__dev__/jsutils/naturalCompare.d.ts +1 -0
  236. package/__dev__/jsutils/naturalCompare.js +3 -0
  237. package/__dev__/jsutils/naturalCompare.mjs +3 -0
  238. package/__dev__/jsutils/printPathArray.d.mts +1 -0
  239. package/__dev__/jsutils/printPathArray.d.ts +1 -0
  240. package/__dev__/jsutils/printPathArray.js +3 -0
  241. package/__dev__/jsutils/printPathArray.mjs +3 -0
  242. package/__dev__/jsutils/promiseForObject.d.mts +1 -0
  243. package/__dev__/jsutils/promiseForObject.d.ts +1 -0
  244. package/__dev__/jsutils/promiseForObject.js +3 -0
  245. package/__dev__/jsutils/promiseForObject.mjs +3 -0
  246. package/__dev__/jsutils/promiseReduce.d.mts +1 -0
  247. package/__dev__/jsutils/promiseReduce.d.ts +1 -0
  248. package/__dev__/jsutils/promiseReduce.js +3 -0
  249. package/__dev__/jsutils/promiseReduce.mjs +3 -0
  250. package/__dev__/jsutils/promiseWithResolvers.d.mts +1 -0
  251. package/__dev__/jsutils/promiseWithResolvers.d.ts +1 -0
  252. package/__dev__/jsutils/promiseWithResolvers.js +3 -0
  253. package/__dev__/jsutils/promiseWithResolvers.mjs +3 -0
  254. package/__dev__/jsutils/suggestionList.d.mts +1 -0
  255. package/__dev__/jsutils/suggestionList.d.ts +1 -0
  256. package/__dev__/jsutils/suggestionList.js +3 -0
  257. package/__dev__/jsutils/suggestionList.mjs +3 -0
  258. package/__dev__/jsutils/toError.d.mts +1 -0
  259. package/__dev__/jsutils/toError.d.ts +1 -0
  260. package/__dev__/jsutils/toError.js +3 -0
  261. package/__dev__/jsutils/toError.mjs +3 -0
  262. package/__dev__/jsutils/toObjMap.d.mts +1 -0
  263. package/__dev__/jsutils/toObjMap.d.ts +1 -0
  264. package/__dev__/jsutils/toObjMap.js +3 -0
  265. package/__dev__/jsutils/toObjMap.mjs +3 -0
  266. package/__dev__/language/KindTypeMap.d.mts +1 -0
  267. package/__dev__/language/KindTypeMap.d.ts +1 -0
  268. package/__dev__/language/KindTypeMap.js +3 -0
  269. package/__dev__/language/KindTypeMap.mjs +3 -0
  270. package/__dev__/language/ast.d.mts +1 -0
  271. package/__dev__/language/ast.d.ts +1 -0
  272. package/__dev__/language/ast.js +3 -0
  273. package/__dev__/language/ast.mjs +3 -0
  274. package/__dev__/language/blockString.d.mts +1 -0
  275. package/__dev__/language/blockString.d.ts +1 -0
  276. package/__dev__/language/blockString.js +3 -0
  277. package/__dev__/language/blockString.mjs +3 -0
  278. package/__dev__/language/characterClasses.d.mts +1 -0
  279. package/__dev__/language/characterClasses.d.ts +1 -0
  280. package/__dev__/language/characterClasses.js +3 -0
  281. package/__dev__/language/characterClasses.mjs +3 -0
  282. package/__dev__/language/directiveLocation.d.mts +1 -0
  283. package/__dev__/language/directiveLocation.d.ts +1 -0
  284. package/__dev__/language/directiveLocation.js +3 -0
  285. package/__dev__/language/directiveLocation.mjs +3 -0
  286. package/__dev__/language/index.d.mts +1 -0
  287. package/__dev__/language/index.d.ts +1 -0
  288. package/__dev__/language/index.js +3 -0
  289. package/__dev__/language/index.mjs +3 -0
  290. package/__dev__/language/kinds.d.mts +1 -0
  291. package/__dev__/language/kinds.d.ts +1 -0
  292. package/__dev__/language/kinds.js +3 -0
  293. package/__dev__/language/kinds.mjs +3 -0
  294. package/__dev__/language/kinds_.d.mts +1 -0
  295. package/__dev__/language/kinds_.d.ts +1 -0
  296. package/__dev__/language/kinds_.js +3 -0
  297. package/__dev__/language/kinds_.mjs +3 -0
  298. package/__dev__/language/lexer.d.mts +1 -0
  299. package/__dev__/language/lexer.d.ts +1 -0
  300. package/__dev__/language/lexer.js +3 -0
  301. package/__dev__/language/lexer.mjs +3 -0
  302. package/__dev__/language/location.d.mts +1 -0
  303. package/__dev__/language/location.d.ts +1 -0
  304. package/__dev__/language/location.js +3 -0
  305. package/__dev__/language/location.mjs +3 -0
  306. package/__dev__/language/parser.d.mts +1 -0
  307. package/__dev__/language/parser.d.ts +1 -0
  308. package/__dev__/language/parser.js +3 -0
  309. package/__dev__/language/parser.mjs +3 -0
  310. package/__dev__/language/predicates.d.mts +1 -0
  311. package/__dev__/language/predicates.d.ts +1 -0
  312. package/__dev__/language/predicates.js +3 -0
  313. package/__dev__/language/predicates.mjs +3 -0
  314. package/__dev__/language/printLocation.d.mts +1 -0
  315. package/__dev__/language/printLocation.d.ts +1 -0
  316. package/__dev__/language/printLocation.js +3 -0
  317. package/__dev__/language/printLocation.mjs +3 -0
  318. package/__dev__/language/printString.d.mts +1 -0
  319. package/__dev__/language/printString.d.ts +1 -0
  320. package/__dev__/language/printString.js +3 -0
  321. package/__dev__/language/printString.mjs +3 -0
  322. package/__dev__/language/printer.d.mts +1 -0
  323. package/__dev__/language/printer.d.ts +1 -0
  324. package/__dev__/language/printer.js +3 -0
  325. package/__dev__/language/printer.mjs +3 -0
  326. package/__dev__/language/schemaCoordinateLexer.d.mts +1 -0
  327. package/__dev__/language/schemaCoordinateLexer.d.ts +1 -0
  328. package/__dev__/language/schemaCoordinateLexer.js +3 -0
  329. package/__dev__/language/schemaCoordinateLexer.mjs +3 -0
  330. package/__dev__/language/source.d.mts +1 -0
  331. package/__dev__/language/source.d.ts +1 -0
  332. package/__dev__/language/source.js +3 -0
  333. package/__dev__/language/source.mjs +3 -0
  334. package/__dev__/language/tokenKind.d.mts +1 -0
  335. package/__dev__/language/tokenKind.d.ts +1 -0
  336. package/__dev__/language/tokenKind.js +3 -0
  337. package/__dev__/language/tokenKind.mjs +3 -0
  338. package/__dev__/language/visitor.d.mts +1 -0
  339. package/__dev__/language/visitor.d.ts +1 -0
  340. package/__dev__/language/visitor.js +3 -0
  341. package/__dev__/language/visitor.mjs +3 -0
  342. package/__dev__/type/assertName.d.mts +1 -0
  343. package/__dev__/type/assertName.d.ts +1 -0
  344. package/__dev__/type/assertName.js +3 -0
  345. package/__dev__/type/assertName.mjs +3 -0
  346. package/__dev__/type/definition.d.mts +1 -0
  347. package/__dev__/type/definition.d.ts +1 -0
  348. package/__dev__/type/definition.js +3 -0
  349. package/__dev__/type/definition.mjs +3 -0
  350. package/__dev__/type/directives.d.mts +1 -0
  351. package/__dev__/type/directives.d.ts +1 -0
  352. package/__dev__/type/directives.js +3 -0
  353. package/__dev__/type/directives.mjs +3 -0
  354. package/__dev__/type/index.d.mts +1 -0
  355. package/__dev__/type/index.d.ts +1 -0
  356. package/__dev__/type/index.js +3 -0
  357. package/__dev__/type/index.mjs +3 -0
  358. package/__dev__/type/introspection.d.mts +1 -0
  359. package/__dev__/type/introspection.d.ts +1 -0
  360. package/__dev__/type/introspection.js +3 -0
  361. package/__dev__/type/introspection.mjs +3 -0
  362. package/__dev__/type/scalars.d.mts +1 -0
  363. package/__dev__/type/scalars.d.ts +1 -0
  364. package/__dev__/type/scalars.js +3 -0
  365. package/__dev__/type/scalars.mjs +3 -0
  366. package/__dev__/type/schema.d.mts +1 -0
  367. package/__dev__/type/schema.d.ts +1 -0
  368. package/__dev__/type/schema.js +3 -0
  369. package/__dev__/type/schema.mjs +3 -0
  370. package/__dev__/type/validate.d.mts +1 -0
  371. package/__dev__/type/validate.d.ts +1 -0
  372. package/__dev__/type/validate.js +3 -0
  373. package/__dev__/type/validate.mjs +3 -0
  374. package/__dev__/utilities/TypeInfo.d.mts +1 -0
  375. package/__dev__/utilities/TypeInfo.d.ts +1 -0
  376. package/__dev__/utilities/TypeInfo.js +3 -0
  377. package/__dev__/utilities/TypeInfo.mjs +3 -0
  378. package/__dev__/utilities/astFromValue.d.mts +1 -0
  379. package/__dev__/utilities/astFromValue.d.ts +1 -0
  380. package/__dev__/utilities/astFromValue.js +3 -0
  381. package/__dev__/utilities/astFromValue.mjs +3 -0
  382. package/__dev__/utilities/buildASTSchema.d.mts +1 -0
  383. package/__dev__/utilities/buildASTSchema.d.ts +1 -0
  384. package/__dev__/utilities/buildASTSchema.js +3 -0
  385. package/__dev__/utilities/buildASTSchema.mjs +3 -0
  386. package/__dev__/utilities/buildClientSchema.d.mts +1 -0
  387. package/__dev__/utilities/buildClientSchema.d.ts +1 -0
  388. package/__dev__/utilities/buildClientSchema.js +3 -0
  389. package/__dev__/utilities/buildClientSchema.mjs +3 -0
  390. package/__dev__/utilities/coerceInputValue.d.mts +1 -0
  391. package/__dev__/utilities/coerceInputValue.d.ts +1 -0
  392. package/__dev__/utilities/coerceInputValue.js +3 -0
  393. package/__dev__/utilities/coerceInputValue.mjs +3 -0
  394. package/__dev__/utilities/concatAST.d.mts +1 -0
  395. package/__dev__/utilities/concatAST.d.ts +1 -0
  396. package/__dev__/utilities/concatAST.js +3 -0
  397. package/__dev__/utilities/concatAST.mjs +3 -0
  398. package/__dev__/utilities/extendSchema.d.mts +1 -0
  399. package/__dev__/utilities/extendSchema.d.ts +1 -0
  400. package/__dev__/utilities/extendSchema.js +3 -0
  401. package/__dev__/utilities/extendSchema.mjs +3 -0
  402. package/__dev__/utilities/findSchemaChanges.d.mts +1 -0
  403. package/__dev__/utilities/findSchemaChanges.d.ts +1 -0
  404. package/__dev__/utilities/findSchemaChanges.js +3 -0
  405. package/__dev__/utilities/findSchemaChanges.mjs +3 -0
  406. package/__dev__/utilities/getDefaultValueAST.d.mts +1 -0
  407. package/__dev__/utilities/getDefaultValueAST.d.ts +1 -0
  408. package/__dev__/utilities/getDefaultValueAST.js +3 -0
  409. package/__dev__/utilities/getDefaultValueAST.mjs +3 -0
  410. package/__dev__/utilities/getIntrospectionQuery.d.mts +1 -0
  411. package/__dev__/utilities/getIntrospectionQuery.d.ts +1 -0
  412. package/__dev__/utilities/getIntrospectionQuery.js +3 -0
  413. package/__dev__/utilities/getIntrospectionQuery.mjs +3 -0
  414. package/__dev__/utilities/getOperationAST.d.mts +1 -0
  415. package/__dev__/utilities/getOperationAST.d.ts +1 -0
  416. package/__dev__/utilities/getOperationAST.js +3 -0
  417. package/__dev__/utilities/getOperationAST.mjs +3 -0
  418. package/__dev__/utilities/index.d.mts +1 -0
  419. package/__dev__/utilities/index.d.ts +1 -0
  420. package/__dev__/utilities/index.js +3 -0
  421. package/__dev__/utilities/index.mjs +3 -0
  422. package/__dev__/utilities/introspectionFromSchema.d.mts +1 -0
  423. package/__dev__/utilities/introspectionFromSchema.d.ts +1 -0
  424. package/__dev__/utilities/introspectionFromSchema.js +3 -0
  425. package/__dev__/utilities/introspectionFromSchema.mjs +3 -0
  426. package/__dev__/utilities/lexicographicSortSchema.d.mts +1 -0
  427. package/__dev__/utilities/lexicographicSortSchema.d.ts +1 -0
  428. package/__dev__/utilities/lexicographicSortSchema.js +3 -0
  429. package/__dev__/utilities/lexicographicSortSchema.mjs +3 -0
  430. package/__dev__/utilities/mapSchemaConfig.d.mts +1 -0
  431. package/__dev__/utilities/mapSchemaConfig.d.ts +1 -0
  432. package/__dev__/utilities/mapSchemaConfig.js +3 -0
  433. package/__dev__/utilities/mapSchemaConfig.mjs +3 -0
  434. package/__dev__/utilities/printSchema.d.mts +1 -0
  435. package/__dev__/utilities/printSchema.d.ts +1 -0
  436. package/__dev__/utilities/printSchema.js +3 -0
  437. package/__dev__/utilities/printSchema.mjs +3 -0
  438. package/__dev__/utilities/replaceVariables.d.mts +1 -0
  439. package/__dev__/utilities/replaceVariables.d.ts +1 -0
  440. package/__dev__/utilities/replaceVariables.js +3 -0
  441. package/__dev__/utilities/replaceVariables.mjs +3 -0
  442. package/__dev__/utilities/resolveSchemaCoordinate.d.mts +1 -0
  443. package/__dev__/utilities/resolveSchemaCoordinate.d.ts +1 -0
  444. package/__dev__/utilities/resolveSchemaCoordinate.js +3 -0
  445. package/__dev__/utilities/resolveSchemaCoordinate.mjs +3 -0
  446. package/__dev__/utilities/separateOperations.d.mts +1 -0
  447. package/__dev__/utilities/separateOperations.d.ts +1 -0
  448. package/__dev__/utilities/separateOperations.js +3 -0
  449. package/__dev__/utilities/separateOperations.mjs +3 -0
  450. package/__dev__/utilities/sortValueNode.d.mts +1 -0
  451. package/__dev__/utilities/sortValueNode.d.ts +1 -0
  452. package/__dev__/utilities/sortValueNode.js +3 -0
  453. package/__dev__/utilities/sortValueNode.mjs +3 -0
  454. package/__dev__/utilities/stripIgnoredCharacters.d.mts +1 -0
  455. package/__dev__/utilities/stripIgnoredCharacters.d.ts +1 -0
  456. package/__dev__/utilities/stripIgnoredCharacters.js +3 -0
  457. package/__dev__/utilities/stripIgnoredCharacters.mjs +3 -0
  458. package/__dev__/utilities/typeComparators.d.mts +1 -0
  459. package/__dev__/utilities/typeComparators.d.ts +1 -0
  460. package/__dev__/utilities/typeComparators.js +3 -0
  461. package/__dev__/utilities/typeComparators.mjs +3 -0
  462. package/__dev__/utilities/typeFromAST.d.mts +1 -0
  463. package/__dev__/utilities/typeFromAST.d.ts +1 -0
  464. package/__dev__/utilities/typeFromAST.js +3 -0
  465. package/__dev__/utilities/typeFromAST.mjs +3 -0
  466. package/__dev__/utilities/typedQueryDocumentNode.d.mts +1 -0
  467. package/__dev__/utilities/typedQueryDocumentNode.d.ts +1 -0
  468. package/__dev__/utilities/typedQueryDocumentNode.js +3 -0
  469. package/__dev__/utilities/typedQueryDocumentNode.mjs +3 -0
  470. package/__dev__/utilities/validateInputValue.d.mts +1 -0
  471. package/__dev__/utilities/validateInputValue.d.ts +1 -0
  472. package/__dev__/utilities/validateInputValue.js +3 -0
  473. package/__dev__/utilities/validateInputValue.mjs +3 -0
  474. package/__dev__/utilities/valueFromAST.d.mts +1 -0
  475. package/__dev__/utilities/valueFromAST.d.ts +1 -0
  476. package/__dev__/utilities/valueFromAST.js +3 -0
  477. package/__dev__/utilities/valueFromAST.mjs +3 -0
  478. package/__dev__/utilities/valueFromASTUntyped.d.mts +1 -0
  479. package/__dev__/utilities/valueFromASTUntyped.d.ts +1 -0
  480. package/__dev__/utilities/valueFromASTUntyped.js +3 -0
  481. package/__dev__/utilities/valueFromASTUntyped.mjs +3 -0
  482. package/__dev__/utilities/valueToLiteral.d.mts +1 -0
  483. package/__dev__/utilities/valueToLiteral.d.ts +1 -0
  484. package/__dev__/utilities/valueToLiteral.js +3 -0
  485. package/__dev__/utilities/valueToLiteral.mjs +3 -0
  486. package/__dev__/validation/ValidationContext.d.mts +1 -0
  487. package/__dev__/validation/ValidationContext.d.ts +1 -0
  488. package/__dev__/validation/ValidationContext.js +3 -0
  489. package/__dev__/validation/ValidationContext.mjs +3 -0
  490. package/__dev__/validation/index.d.mts +1 -0
  491. package/__dev__/validation/index.d.ts +1 -0
  492. package/__dev__/validation/index.js +3 -0
  493. package/__dev__/validation/index.mjs +3 -0
  494. package/__dev__/validation/rules/DeferStreamDirectiveLabelRule.d.mts +1 -0
  495. package/__dev__/validation/rules/DeferStreamDirectiveLabelRule.d.ts +1 -0
  496. package/__dev__/validation/rules/DeferStreamDirectiveLabelRule.js +3 -0
  497. package/__dev__/validation/rules/DeferStreamDirectiveLabelRule.mjs +3 -0
  498. package/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.mts +1 -0
  499. package/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.ts +1 -0
  500. package/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.js +3 -0
  501. package/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs +3 -0
  502. package/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.mts +1 -0
  503. package/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.ts +1 -0
  504. package/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.js +3 -0
  505. package/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs +3 -0
  506. package/__dev__/validation/rules/ExecutableDefinitionsRule.d.mts +1 -0
  507. package/__dev__/validation/rules/ExecutableDefinitionsRule.d.ts +1 -0
  508. package/__dev__/validation/rules/ExecutableDefinitionsRule.js +3 -0
  509. package/__dev__/validation/rules/ExecutableDefinitionsRule.mjs +3 -0
  510. package/__dev__/validation/rules/FieldsOnCorrectTypeRule.d.mts +1 -0
  511. package/__dev__/validation/rules/FieldsOnCorrectTypeRule.d.ts +1 -0
  512. package/__dev__/validation/rules/FieldsOnCorrectTypeRule.js +3 -0
  513. package/__dev__/validation/rules/FieldsOnCorrectTypeRule.mjs +3 -0
  514. package/__dev__/validation/rules/FragmentsOnCompositeTypesRule.d.mts +1 -0
  515. package/__dev__/validation/rules/FragmentsOnCompositeTypesRule.d.ts +1 -0
  516. package/__dev__/validation/rules/FragmentsOnCompositeTypesRule.js +3 -0
  517. package/__dev__/validation/rules/FragmentsOnCompositeTypesRule.mjs +3 -0
  518. package/__dev__/validation/rules/KnownArgumentNamesRule.d.mts +1 -0
  519. package/__dev__/validation/rules/KnownArgumentNamesRule.d.ts +1 -0
  520. package/__dev__/validation/rules/KnownArgumentNamesRule.js +3 -0
  521. package/__dev__/validation/rules/KnownArgumentNamesRule.mjs +3 -0
  522. package/__dev__/validation/rules/KnownDirectivesRule.d.mts +1 -0
  523. package/__dev__/validation/rules/KnownDirectivesRule.d.ts +1 -0
  524. package/__dev__/validation/rules/KnownDirectivesRule.js +3 -0
  525. package/__dev__/validation/rules/KnownDirectivesRule.mjs +3 -0
  526. package/__dev__/validation/rules/KnownFragmentNamesRule.d.mts +1 -0
  527. package/__dev__/validation/rules/KnownFragmentNamesRule.d.ts +1 -0
  528. package/__dev__/validation/rules/KnownFragmentNamesRule.js +3 -0
  529. package/__dev__/validation/rules/KnownFragmentNamesRule.mjs +3 -0
  530. package/__dev__/validation/rules/KnownOperationTypesRule.d.mts +1 -0
  531. package/__dev__/validation/rules/KnownOperationTypesRule.d.ts +1 -0
  532. package/__dev__/validation/rules/KnownOperationTypesRule.js +3 -0
  533. package/__dev__/validation/rules/KnownOperationTypesRule.mjs +3 -0
  534. package/__dev__/validation/rules/KnownTypeNamesRule.d.mts +1 -0
  535. package/__dev__/validation/rules/KnownTypeNamesRule.d.ts +1 -0
  536. package/__dev__/validation/rules/KnownTypeNamesRule.js +3 -0
  537. package/__dev__/validation/rules/KnownTypeNamesRule.mjs +3 -0
  538. package/__dev__/validation/rules/LoneAnonymousOperationRule.d.mts +1 -0
  539. package/__dev__/validation/rules/LoneAnonymousOperationRule.d.ts +1 -0
  540. package/__dev__/validation/rules/LoneAnonymousOperationRule.js +3 -0
  541. package/__dev__/validation/rules/LoneAnonymousOperationRule.mjs +3 -0
  542. package/__dev__/validation/rules/LoneSchemaDefinitionRule.d.mts +1 -0
  543. package/__dev__/validation/rules/LoneSchemaDefinitionRule.d.ts +1 -0
  544. package/__dev__/validation/rules/LoneSchemaDefinitionRule.js +3 -0
  545. package/__dev__/validation/rules/LoneSchemaDefinitionRule.mjs +3 -0
  546. package/__dev__/validation/rules/MaxIntrospectionDepthRule.d.mts +1 -0
  547. package/__dev__/validation/rules/MaxIntrospectionDepthRule.d.ts +1 -0
  548. package/__dev__/validation/rules/MaxIntrospectionDepthRule.js +3 -0
  549. package/__dev__/validation/rules/MaxIntrospectionDepthRule.mjs +3 -0
  550. package/__dev__/validation/rules/NoFragmentCyclesRule.d.mts +1 -0
  551. package/__dev__/validation/rules/NoFragmentCyclesRule.d.ts +1 -0
  552. package/__dev__/validation/rules/NoFragmentCyclesRule.js +3 -0
  553. package/__dev__/validation/rules/NoFragmentCyclesRule.mjs +3 -0
  554. package/__dev__/validation/rules/NoUndefinedVariablesRule.d.mts +1 -0
  555. package/__dev__/validation/rules/NoUndefinedVariablesRule.d.ts +1 -0
  556. package/__dev__/validation/rules/NoUndefinedVariablesRule.js +3 -0
  557. package/__dev__/validation/rules/NoUndefinedVariablesRule.mjs +3 -0
  558. package/__dev__/validation/rules/NoUnusedFragmentsRule.d.mts +1 -0
  559. package/__dev__/validation/rules/NoUnusedFragmentsRule.d.ts +1 -0
  560. package/__dev__/validation/rules/NoUnusedFragmentsRule.js +3 -0
  561. package/__dev__/validation/rules/NoUnusedFragmentsRule.mjs +3 -0
  562. package/__dev__/validation/rules/NoUnusedVariablesRule.d.mts +1 -0
  563. package/__dev__/validation/rules/NoUnusedVariablesRule.d.ts +1 -0
  564. package/__dev__/validation/rules/NoUnusedVariablesRule.js +3 -0
  565. package/__dev__/validation/rules/NoUnusedVariablesRule.mjs +3 -0
  566. package/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.d.mts +1 -0
  567. package/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts +1 -0
  568. package/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.js +3 -0
  569. package/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +3 -0
  570. package/__dev__/validation/rules/PossibleFragmentSpreadsRule.d.mts +1 -0
  571. package/__dev__/validation/rules/PossibleFragmentSpreadsRule.d.ts +1 -0
  572. package/__dev__/validation/rules/PossibleFragmentSpreadsRule.js +3 -0
  573. package/__dev__/validation/rules/PossibleFragmentSpreadsRule.mjs +3 -0
  574. package/__dev__/validation/rules/PossibleTypeExtensionsRule.d.mts +1 -0
  575. package/__dev__/validation/rules/PossibleTypeExtensionsRule.d.ts +1 -0
  576. package/__dev__/validation/rules/PossibleTypeExtensionsRule.js +3 -0
  577. package/__dev__/validation/rules/PossibleTypeExtensionsRule.mjs +3 -0
  578. package/__dev__/validation/rules/ProvidedRequiredArgumentsRule.d.mts +1 -0
  579. package/__dev__/validation/rules/ProvidedRequiredArgumentsRule.d.ts +1 -0
  580. package/__dev__/validation/rules/ProvidedRequiredArgumentsRule.js +3 -0
  581. package/__dev__/validation/rules/ProvidedRequiredArgumentsRule.mjs +3 -0
  582. package/__dev__/validation/rules/ScalarLeafsRule.d.mts +1 -0
  583. package/__dev__/validation/rules/ScalarLeafsRule.d.ts +1 -0
  584. package/__dev__/validation/rules/ScalarLeafsRule.js +3 -0
  585. package/__dev__/validation/rules/ScalarLeafsRule.mjs +3 -0
  586. package/__dev__/validation/rules/SingleFieldSubscriptionsRule.d.mts +1 -0
  587. package/__dev__/validation/rules/SingleFieldSubscriptionsRule.d.ts +1 -0
  588. package/__dev__/validation/rules/SingleFieldSubscriptionsRule.js +3 -0
  589. package/__dev__/validation/rules/SingleFieldSubscriptionsRule.mjs +3 -0
  590. package/__dev__/validation/rules/StreamDirectiveOnListFieldRule.d.mts +1 -0
  591. package/__dev__/validation/rules/StreamDirectiveOnListFieldRule.d.ts +1 -0
  592. package/__dev__/validation/rules/StreamDirectiveOnListFieldRule.js +3 -0
  593. package/__dev__/validation/rules/StreamDirectiveOnListFieldRule.mjs +3 -0
  594. package/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.d.mts +1 -0
  595. package/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.d.ts +1 -0
  596. package/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.js +3 -0
  597. package/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.mjs +3 -0
  598. package/__dev__/validation/rules/UniqueArgumentNamesRule.d.mts +1 -0
  599. package/__dev__/validation/rules/UniqueArgumentNamesRule.d.ts +1 -0
  600. package/__dev__/validation/rules/UniqueArgumentNamesRule.js +3 -0
  601. package/__dev__/validation/rules/UniqueArgumentNamesRule.mjs +3 -0
  602. package/__dev__/validation/rules/UniqueDirectiveNamesRule.d.mts +1 -0
  603. package/__dev__/validation/rules/UniqueDirectiveNamesRule.d.ts +1 -0
  604. package/__dev__/validation/rules/UniqueDirectiveNamesRule.js +3 -0
  605. package/__dev__/validation/rules/UniqueDirectiveNamesRule.mjs +3 -0
  606. package/__dev__/validation/rules/UniqueDirectivesPerLocationRule.d.mts +1 -0
  607. package/__dev__/validation/rules/UniqueDirectivesPerLocationRule.d.ts +1 -0
  608. package/__dev__/validation/rules/UniqueDirectivesPerLocationRule.js +3 -0
  609. package/__dev__/validation/rules/UniqueDirectivesPerLocationRule.mjs +3 -0
  610. package/__dev__/validation/rules/UniqueEnumValueNamesRule.d.mts +1 -0
  611. package/__dev__/validation/rules/UniqueEnumValueNamesRule.d.ts +1 -0
  612. package/__dev__/validation/rules/UniqueEnumValueNamesRule.js +3 -0
  613. package/__dev__/validation/rules/UniqueEnumValueNamesRule.mjs +3 -0
  614. package/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.d.mts +1 -0
  615. package/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.d.ts +1 -0
  616. package/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.js +3 -0
  617. package/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.mjs +3 -0
  618. package/__dev__/validation/rules/UniqueFragmentNamesRule.d.mts +1 -0
  619. package/__dev__/validation/rules/UniqueFragmentNamesRule.d.ts +1 -0
  620. package/__dev__/validation/rules/UniqueFragmentNamesRule.js +3 -0
  621. package/__dev__/validation/rules/UniqueFragmentNamesRule.mjs +3 -0
  622. package/__dev__/validation/rules/UniqueInputFieldNamesRule.d.mts +1 -0
  623. package/__dev__/validation/rules/UniqueInputFieldNamesRule.d.ts +1 -0
  624. package/__dev__/validation/rules/UniqueInputFieldNamesRule.js +3 -0
  625. package/__dev__/validation/rules/UniqueInputFieldNamesRule.mjs +3 -0
  626. package/__dev__/validation/rules/UniqueOperationNamesRule.d.mts +1 -0
  627. package/__dev__/validation/rules/UniqueOperationNamesRule.d.ts +1 -0
  628. package/__dev__/validation/rules/UniqueOperationNamesRule.js +3 -0
  629. package/__dev__/validation/rules/UniqueOperationNamesRule.mjs +3 -0
  630. package/__dev__/validation/rules/UniqueOperationTypesRule.d.mts +1 -0
  631. package/__dev__/validation/rules/UniqueOperationTypesRule.d.ts +1 -0
  632. package/__dev__/validation/rules/UniqueOperationTypesRule.js +3 -0
  633. package/__dev__/validation/rules/UniqueOperationTypesRule.mjs +3 -0
  634. package/__dev__/validation/rules/UniqueTypeNamesRule.d.mts +1 -0
  635. package/__dev__/validation/rules/UniqueTypeNamesRule.d.ts +1 -0
  636. package/__dev__/validation/rules/UniqueTypeNamesRule.js +3 -0
  637. package/__dev__/validation/rules/UniqueTypeNamesRule.mjs +3 -0
  638. package/__dev__/validation/rules/UniqueVariableNamesRule.d.mts +1 -0
  639. package/__dev__/validation/rules/UniqueVariableNamesRule.d.ts +1 -0
  640. package/__dev__/validation/rules/UniqueVariableNamesRule.js +3 -0
  641. package/__dev__/validation/rules/UniqueVariableNamesRule.mjs +3 -0
  642. package/__dev__/validation/rules/ValuesOfCorrectTypeRule.d.mts +1 -0
  643. package/__dev__/validation/rules/ValuesOfCorrectTypeRule.d.ts +1 -0
  644. package/__dev__/validation/rules/ValuesOfCorrectTypeRule.js +3 -0
  645. package/__dev__/validation/rules/ValuesOfCorrectTypeRule.mjs +3 -0
  646. package/__dev__/validation/rules/VariablesAreInputTypesRule.d.mts +1 -0
  647. package/__dev__/validation/rules/VariablesAreInputTypesRule.d.ts +1 -0
  648. package/__dev__/validation/rules/VariablesAreInputTypesRule.js +3 -0
  649. package/__dev__/validation/rules/VariablesAreInputTypesRule.mjs +3 -0
  650. package/__dev__/validation/rules/VariablesInAllowedPositionRule.d.mts +1 -0
  651. package/__dev__/validation/rules/VariablesInAllowedPositionRule.d.ts +1 -0
  652. package/__dev__/validation/rules/VariablesInAllowedPositionRule.js +3 -0
  653. package/__dev__/validation/rules/VariablesInAllowedPositionRule.mjs +3 -0
  654. package/__dev__/validation/rules/custom/NoDeprecatedCustomRule.d.mts +1 -0
  655. package/__dev__/validation/rules/custom/NoDeprecatedCustomRule.d.ts +1 -0
  656. package/__dev__/validation/rules/custom/NoDeprecatedCustomRule.js +3 -0
  657. package/__dev__/validation/rules/custom/NoDeprecatedCustomRule.mjs +3 -0
  658. package/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.mts +1 -0
  659. package/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts +1 -0
  660. package/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.js +3 -0
  661. package/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs +3 -0
  662. package/__dev__/validation/specifiedRules.d.mts +1 -0
  663. package/__dev__/validation/specifiedRules.d.ts +1 -0
  664. package/__dev__/validation/specifiedRules.js +3 -0
  665. package/__dev__/validation/specifiedRules.mjs +3 -0
  666. package/__dev__/validation/validate.d.mts +1 -0
  667. package/__dev__/validation/validate.d.ts +1 -0
  668. package/__dev__/validation/validate.js +3 -0
  669. package/__dev__/validation/validate.mjs +3 -0
  670. package/__dev__/version.d.mts +1 -0
  671. package/__dev__/version.d.ts +1 -0
  672. package/__dev__/version.js +3 -0
  673. package/__dev__/version.mjs +3 -0
  674. package/devMode.d.mts +2 -0
  675. package/devMode.d.ts +2 -0
  676. package/devMode.js +14 -0
  677. package/devMode.js.map +1 -0
  678. package/devMode.mjs +10 -0
  679. package/devMode.mjs.map +1 -0
  680. package/error/GraphQLError.d.mts +120 -0
  681. package/error/ensureGraphQLError.d.mts +5 -0
  682. package/error/ensureGraphQLError.d.ts +5 -0
  683. package/error/ensureGraphQLError.js +16 -0
  684. package/error/ensureGraphQLError.js.map +1 -0
  685. package/error/ensureGraphQLError.mjs +13 -0
  686. package/error/ensureGraphQLError.mjs.map +1 -0
  687. package/error/index.d.mts +4 -0
  688. package/error/locatedError.d.mts +9 -0
  689. package/error/syntaxError.d.mts +7 -0
  690. package/execution/AbortedGraphQLExecutionError.d.mts +6 -0
  691. package/execution/AbortedGraphQLExecutionError.d.ts +6 -0
  692. package/execution/AbortedGraphQLExecutionError.js +27 -0
  693. package/execution/AbortedGraphQLExecutionError.js.map +1 -0
  694. package/execution/AbortedGraphQLExecutionError.mjs +23 -0
  695. package/execution/AbortedGraphQLExecutionError.mjs.map +1 -0
  696. package/execution/AsyncWorkTracker.d.mts +10 -0
  697. package/execution/AsyncWorkTracker.d.ts +10 -0
  698. package/execution/AsyncWorkTracker.js +49 -0
  699. package/execution/AsyncWorkTracker.js.map +1 -0
  700. package/execution/AsyncWorkTracker.mjs +45 -0
  701. package/execution/AsyncWorkTracker.mjs.map +1 -0
  702. package/execution/Executor.d.mts +212 -0
  703. package/execution/Executor.d.ts +212 -0
  704. package/execution/Executor.js +655 -0
  705. package/execution/Executor.js.map +1 -0
  706. package/execution/Executor.mjs +651 -0
  707. package/execution/Executor.mjs.map +1 -0
  708. package/execution/ExecutorThrowingOnIncremental.d.mts +12 -0
  709. package/execution/ExecutorThrowingOnIncremental.d.ts +12 -0
  710. package/execution/ExecutorThrowingOnIncremental.js +47 -0
  711. package/execution/ExecutorThrowingOnIncremental.js.map +1 -0
  712. package/execution/ExecutorThrowingOnIncremental.mjs +43 -0
  713. package/execution/ExecutorThrowingOnIncremental.mjs.map +1 -0
  714. package/execution/cancellablePromise.d.mts +6 -0
  715. package/execution/cancellablePromise.d.ts +6 -0
  716. package/execution/cancellablePromise.js +49 -0
  717. package/execution/cancellablePromise.js.map +1 -0
  718. package/execution/cancellablePromise.mjs +45 -0
  719. package/execution/cancellablePromise.mjs.map +1 -0
  720. package/execution/collectFields.d.mts +59 -0
  721. package/execution/collectFields.d.ts +15 -4
  722. package/execution/collectFields.js +57 -22
  723. package/execution/collectFields.js.map +1 -1
  724. package/execution/collectFields.mjs +58 -23
  725. package/execution/collectFields.mjs.map +1 -1
  726. package/execution/collectIteratorPromises.d.mts +5 -0
  727. package/execution/collectIteratorPromises.d.ts +5 -0
  728. package/execution/collectIteratorPromises.js +27 -0
  729. package/execution/collectIteratorPromises.js.map +1 -0
  730. package/execution/collectIteratorPromises.mjs +24 -0
  731. package/execution/collectIteratorPromises.mjs.map +1 -0
  732. package/execution/createSharedExecutionContext.d.mts +10 -0
  733. package/execution/createSharedExecutionContext.d.ts +10 -0
  734. package/execution/createSharedExecutionContext.js +20 -0
  735. package/execution/createSharedExecutionContext.js.map +1 -0
  736. package/execution/createSharedExecutionContext.mjs +17 -0
  737. package/execution/createSharedExecutionContext.mjs.map +1 -0
  738. package/execution/execute.d.mts +180 -0
  739. package/execution/execute.d.ts +73 -118
  740. package/execution/execute.js +218 -1121
  741. package/execution/execute.js.map +1 -1
  742. package/execution/execute.mjs +213 -1119
  743. package/execution/execute.mjs.map +1 -1
  744. package/execution/getStreamUsage.d.mts +13 -0
  745. package/execution/getStreamUsage.d.ts +13 -0
  746. package/execution/getStreamUsage.js +41 -0
  747. package/execution/getStreamUsage.js.map +1 -0
  748. package/execution/getStreamUsage.mjs +38 -0
  749. package/execution/getStreamUsage.mjs.map +1 -0
  750. package/execution/getVariableSignature.d.mts +18 -0
  751. package/execution/hooks.d.mts +9 -0
  752. package/execution/hooks.d.ts +9 -0
  753. package/execution/hooks.js +24 -0
  754. package/execution/hooks.js.map +1 -0
  755. package/execution/hooks.mjs +21 -0
  756. package/execution/hooks.mjs.map +1 -0
  757. package/execution/incremental/Computation.d.mts +22 -0
  758. package/execution/incremental/Computation.d.ts +22 -0
  759. package/execution/incremental/Computation.js +68 -0
  760. package/execution/incremental/Computation.js.map +1 -0
  761. package/execution/incremental/Computation.mjs +64 -0
  762. package/execution/incremental/Computation.mjs.map +1 -0
  763. package/execution/incremental/IncrementalExecutor.d.mts +182 -0
  764. package/execution/incremental/IncrementalExecutor.d.ts +182 -0
  765. package/execution/incremental/IncrementalExecutor.js +390 -0
  766. package/execution/incremental/IncrementalExecutor.js.map +1 -0
  767. package/execution/incremental/IncrementalExecutor.mjs +386 -0
  768. package/execution/incremental/IncrementalExecutor.mjs.map +1 -0
  769. package/execution/incremental/IncrementalPublisher.d.mts +17 -0
  770. package/execution/incremental/IncrementalPublisher.d.ts +17 -0
  771. package/execution/incremental/IncrementalPublisher.js +201 -0
  772. package/execution/incremental/IncrementalPublisher.js.map +1 -0
  773. package/execution/incremental/IncrementalPublisher.mjs +197 -0
  774. package/execution/incremental/IncrementalPublisher.mjs.map +1 -0
  775. package/execution/incremental/Queue.d.mts +86 -0
  776. package/execution/incremental/Queue.d.ts +86 -0
  777. package/execution/incremental/Queue.js +330 -0
  778. package/execution/incremental/Queue.js.map +1 -0
  779. package/execution/incremental/Queue.mjs +325 -0
  780. package/execution/incremental/Queue.mjs.map +1 -0
  781. package/execution/incremental/WorkQueue.d.mts +67 -0
  782. package/execution/incremental/WorkQueue.d.ts +67 -0
  783. package/execution/incremental/WorkQueue.js +396 -0
  784. package/execution/incremental/WorkQueue.js.map +1 -0
  785. package/execution/incremental/WorkQueue.mjs +393 -0
  786. package/execution/incremental/WorkQueue.mjs.map +1 -0
  787. package/execution/incremental/buildExecutionPlan.d.mts +7 -0
  788. package/execution/{buildExecutionPlan.d.ts → incremental/buildExecutionPlan.d.ts} +1 -1
  789. package/execution/{buildExecutionPlan.js → incremental/buildExecutionPlan.js} +2 -2
  790. package/execution/incremental/buildExecutionPlan.js.map +1 -0
  791. package/execution/{buildExecutionPlan.mjs → incremental/buildExecutionPlan.mjs} +2 -2
  792. package/execution/incremental/buildExecutionPlan.mjs.map +1 -0
  793. package/execution/index.d.mts +8 -0
  794. package/execution/index.d.ts +6 -3
  795. package/execution/index.js +8 -4
  796. package/execution/index.js.map +1 -1
  797. package/execution/index.mjs +2 -1
  798. package/execution/index.mjs.map +1 -1
  799. package/execution/mapAsyncIterable.d.mts +6 -0
  800. package/execution/mapAsyncIterable.d.ts +1 -1
  801. package/execution/mapAsyncIterable.js +28 -51
  802. package/execution/mapAsyncIterable.js.map +1 -1
  803. package/execution/mapAsyncIterable.mjs +28 -51
  804. package/execution/mapAsyncIterable.mjs.map +1 -1
  805. package/execution/returnIteratorCatchingErrors.d.mts +1 -0
  806. package/execution/returnIteratorCatchingErrors.d.ts +1 -0
  807. package/execution/returnIteratorCatchingErrors.js +12 -0
  808. package/execution/returnIteratorCatchingErrors.js.map +1 -0
  809. package/execution/returnIteratorCatchingErrors.mjs +9 -0
  810. package/execution/returnIteratorCatchingErrors.mjs.map +1 -0
  811. package/execution/values.d.mts +61 -0
  812. package/execution/values.d.ts +12 -21
  813. package/execution/values.js +111 -74
  814. package/execution/values.js.map +1 -1
  815. package/execution/values.mjs +111 -73
  816. package/execution/values.mjs.map +1 -1
  817. package/execution/withConcurrentAbruptClose.d.mts +13 -0
  818. package/execution/withConcurrentAbruptClose.d.ts +13 -0
  819. package/execution/withConcurrentAbruptClose.js +72 -0
  820. package/execution/withConcurrentAbruptClose.js.map +1 -0
  821. package/execution/withConcurrentAbruptClose.mjs +69 -0
  822. package/execution/withConcurrentAbruptClose.mjs.map +1 -0
  823. package/graphql.d.mts +61 -0
  824. package/graphql.d.ts +9 -16
  825. package/graphql.js +22 -22
  826. package/graphql.js.map +1 -1
  827. package/graphql.mjs +22 -22
  828. package/graphql.mjs.map +1 -1
  829. package/harness.d.mts +15 -0
  830. package/harness.d.ts +15 -0
  831. package/harness.js +13 -0
  832. package/harness.js.map +1 -0
  833. package/harness.mjs +10 -0
  834. package/harness.mjs.map +1 -0
  835. package/index.d.mts +51 -0
  836. package/index.d.ts +10 -7
  837. package/index.js +25 -8
  838. package/index.js.map +1 -1
  839. package/index.mjs +11 -5
  840. package/index.mjs.map +1 -1
  841. package/jsutils/AccumulatorMap.d.mts +7 -0
  842. package/jsutils/AccumulatorMap.js +1 -0
  843. package/jsutils/AccumulatorMap.js.map +1 -1
  844. package/jsutils/AccumulatorMap.mjs +1 -0
  845. package/jsutils/AccumulatorMap.mjs.map +1 -1
  846. package/jsutils/Maybe.d.mts +2 -0
  847. package/jsutils/ObjMap.d.mts +18 -0
  848. package/jsutils/Path.d.mts +14 -0
  849. package/jsutils/PromiseOrValue.d.mts +1 -0
  850. package/jsutils/capitalize.d.mts +4 -0
  851. package/jsutils/devAssert.d.mts +1 -0
  852. package/jsutils/didYouMean.d.mts +5 -0
  853. package/jsutils/formatList.d.mts +8 -0
  854. package/jsutils/formatList.js +2 -1
  855. package/jsutils/formatList.js.map +1 -1
  856. package/jsutils/formatList.mjs +2 -1
  857. package/jsutils/formatList.mjs.map +1 -1
  858. package/jsutils/getBySet.d.mts +1 -0
  859. package/jsutils/groupBy.d.mts +4 -0
  860. package/jsutils/identityFunc.d.mts +4 -0
  861. package/jsutils/inspect.d.mts +4 -0
  862. package/jsutils/instanceOf.d.mts +15 -0
  863. package/jsutils/instanceOf.d.ts +8 -7
  864. package/jsutils/instanceOf.js +29 -30
  865. package/jsutils/instanceOf.js.map +1 -1
  866. package/jsutils/instanceOf.mjs +28 -30
  867. package/jsutils/instanceOf.mjs.map +1 -1
  868. package/jsutils/invariant.d.mts +1 -0
  869. package/jsutils/isAsyncIterable.d.mts +5 -0
  870. package/jsutils/isIterableObject.d.mts +18 -0
  871. package/jsutils/isObjectLike.d.mts +7 -0
  872. package/jsutils/isPromise.d.mts +6 -0
  873. package/jsutils/isPromise.d.ts +2 -1
  874. package/jsutils/isPromise.js +5 -1
  875. package/jsutils/isPromise.js.map +1 -1
  876. package/jsutils/isPromise.mjs +4 -1
  877. package/jsutils/isPromise.mjs.map +1 -1
  878. package/jsutils/isSameSet.d.mts +1 -0
  879. package/jsutils/keyMap.d.mts +29 -0
  880. package/jsutils/keyValMap.d.mts +19 -0
  881. package/jsutils/mapValue.d.mts +6 -0
  882. package/jsutils/memoize1.d.mts +4 -0
  883. package/jsutils/memoize1.d.ts +4 -0
  884. package/jsutils/memoize1.js +19 -0
  885. package/jsutils/memoize1.js.map +1 -0
  886. package/jsutils/memoize1.mjs +16 -0
  887. package/jsutils/memoize1.mjs.map +1 -0
  888. package/jsutils/memoize2.d.mts +4 -0
  889. package/jsutils/memoize2.d.ts +4 -0
  890. package/jsutils/memoize2.js +24 -0
  891. package/jsutils/memoize2.js.map +1 -0
  892. package/jsutils/memoize2.mjs +21 -0
  893. package/jsutils/memoize2.mjs.map +1 -0
  894. package/jsutils/memoize3.d.mts +4 -0
  895. package/jsutils/memoize3.js +1 -3
  896. package/jsutils/memoize3.js.map +1 -1
  897. package/jsutils/memoize3.mjs +1 -3
  898. package/jsutils/memoize3.mjs.map +1 -1
  899. package/jsutils/naturalCompare.d.mts +8 -0
  900. package/jsutils/printPathArray.d.mts +4 -0
  901. package/jsutils/promiseForObject.d.mts +10 -0
  902. package/jsutils/promiseForObject.d.ts +2 -1
  903. package/jsutils/promiseForObject.js +8 -7
  904. package/jsutils/promiseForObject.js.map +1 -1
  905. package/jsutils/promiseForObject.mjs +8 -7
  906. package/jsutils/promiseForObject.mjs.map +1 -1
  907. package/jsutils/promiseReduce.d.mts +9 -0
  908. package/jsutils/promiseWithResolvers.d.mts +10 -0
  909. package/jsutils/suggestionList.d.mts +5 -0
  910. package/jsutils/toError.d.mts +4 -0
  911. package/jsutils/toObjMap.d.mts +4 -0
  912. package/language/KindTypeMap.d.mts +2 -0
  913. package/language/KindTypeMap.d.ts +2 -0
  914. package/language/KindTypeMap.js +3 -0
  915. package/language/KindTypeMap.js.map +1 -0
  916. package/language/KindTypeMap.mjs +2 -0
  917. package/language/KindTypeMap.mjs.map +1 -0
  918. package/language/ast.d.mts +495 -0
  919. package/language/ast.d.ts +94 -51
  920. package/language/ast.js +15 -2
  921. package/language/ast.js.map +1 -1
  922. package/language/ast.mjs +15 -2
  923. package/language/ast.mjs.map +1 -1
  924. package/language/blockString.d.mts +23 -0
  925. package/language/characterClasses.d.mts +47 -0
  926. package/language/directiveLocation.d.mts +28 -0
  927. package/language/index.d.mts +16 -0
  928. package/language/index.d.ts +3 -3
  929. package/language/index.js +7 -2
  930. package/language/index.js.map +1 -1
  931. package/language/index.mjs +5 -3
  932. package/language/index.mjs.map +1 -1
  933. package/language/kinds.d.mts +3 -0
  934. package/language/kinds.js +34 -1
  935. package/language/kinds.js.map +1 -1
  936. package/language/kinds_.d.mts +109 -0
  937. package/language/kinds_.d.ts +11 -0
  938. package/language/kinds_.js +7 -1
  939. package/language/kinds_.js.map +1 -1
  940. package/language/kinds_.mjs +6 -0
  941. package/language/kinds_.mjs.map +1 -1
  942. package/language/lexer.d.mts +87 -0
  943. package/language/lexer.d.ts +43 -1
  944. package/language/lexer.js +10 -0
  945. package/language/lexer.js.map +1 -1
  946. package/language/lexer.mjs +10 -3
  947. package/language/lexer.mjs.map +1 -1
  948. package/language/location.d.mts +13 -0
  949. package/language/location.js +2 -1
  950. package/language/location.js.map +1 -1
  951. package/language/location.mjs +2 -1
  952. package/language/location.mjs.map +1 -1
  953. package/language/parser.d.mts +522 -0
  954. package/language/parser.d.ts +28 -4
  955. package/language/parser.js +101 -6
  956. package/language/parser.js.map +1 -1
  957. package/language/parser.mjs +100 -6
  958. package/language/parser.mjs.map +1 -1
  959. package/language/predicates.d.mts +19 -0
  960. package/language/predicates.d.ts +9 -1
  961. package/language/predicates.js +19 -0
  962. package/language/predicates.js.map +1 -1
  963. package/language/predicates.mjs +17 -0
  964. package/language/predicates.mjs.map +1 -1
  965. package/language/printLocation.d.mts +11 -0
  966. package/language/printString.d.mts +5 -0
  967. package/language/printer.d.mts +6 -0
  968. package/language/printer.js +28 -12
  969. package/language/printer.js.map +1 -1
  970. package/language/printer.mjs +28 -12
  971. package/language/printer.mjs.map +1 -1
  972. package/language/schemaCoordinateLexer.d.mts +43 -0
  973. package/language/schemaCoordinateLexer.d.ts +43 -0
  974. package/language/schemaCoordinateLexer.js +93 -0
  975. package/language/schemaCoordinateLexer.js.map +1 -0
  976. package/language/schemaCoordinateLexer.mjs +89 -0
  977. package/language/schemaCoordinateLexer.mjs.map +1 -0
  978. package/language/source.d.mts +26 -0
  979. package/language/source.d.ts +1 -0
  980. package/language/source.js +7 -3
  981. package/language/source.js.map +1 -1
  982. package/language/source.mjs +7 -3
  983. package/language/source.mjs.map +1 -1
  984. package/language/tokenKind.d.mts +30 -0
  985. package/language/tokenKind.d.ts +1 -0
  986. package/language/tokenKind.js +1 -0
  987. package/language/tokenKind.js.map +1 -1
  988. package/language/tokenKind.mjs +1 -0
  989. package/language/tokenKind.mjs.map +1 -1
  990. package/language/visitor.d.mts +160 -0
  991. package/language/visitor.js +3 -2
  992. package/language/visitor.js.map +1 -1
  993. package/language/visitor.mjs +3 -2
  994. package/language/visitor.mjs.map +1 -1
  995. package/package.json +174 -7
  996. package/type/assertName.d.mts +10 -0
  997. package/type/definition.d.mts +933 -0
  998. package/type/definition.d.ts +58 -16
  999. package/type/definition.js +53 -28
  1000. package/type/definition.js.map +1 -1
  1001. package/type/definition.mjs +53 -28
  1002. package/type/definition.mjs.map +1 -1
  1003. package/type/directives.d.mts +97 -0
  1004. package/type/directives.d.ts +5 -0
  1005. package/type/directives.js +20 -4
  1006. package/type/directives.js.map +1 -1
  1007. package/type/directives.mjs +19 -3
  1008. package/type/directives.mjs.map +1 -1
  1009. package/type/index.d.mts +12 -0
  1010. package/type/index.d.ts +1 -1
  1011. package/type/index.js.map +1 -1
  1012. package/type/index.mjs.map +1 -1
  1013. package/type/introspection.d.mts +26 -0
  1014. package/type/introspection.d.ts +3 -3
  1015. package/type/introspection.js +9 -7
  1016. package/type/introspection.js.map +1 -1
  1017. package/type/introspection.mjs +9 -7
  1018. package/type/introspection.mjs.map +1 -1
  1019. package/type/scalars.d.mts +19 -0
  1020. package/type/scalars.d.ts +5 -5
  1021. package/type/scalars.js +130 -38
  1022. package/type/scalars.js.map +1 -1
  1023. package/type/scalars.mjs +130 -38
  1024. package/type/scalars.mjs.map +1 -1
  1025. package/type/schema.d.mts +172 -0
  1026. package/type/schema.d.ts +2 -0
  1027. package/type/schema.js +11 -13
  1028. package/type/schema.js.map +1 -1
  1029. package/type/schema.mjs +11 -13
  1030. package/type/schema.mjs.map +1 -1
  1031. package/type/validate.d.mts +21 -0
  1032. package/type/validate.d.ts +6 -0
  1033. package/type/validate.js +48 -30
  1034. package/type/validate.js.map +1 -1
  1035. package/type/validate.mjs +47 -30
  1036. package/type/validate.mjs.map +1 -1
  1037. package/utilities/TypeInfo.d.mts +55 -0
  1038. package/utilities/TypeInfo.js +3 -1
  1039. package/utilities/TypeInfo.js.map +1 -1
  1040. package/utilities/TypeInfo.mjs +3 -1
  1041. package/utilities/TypeInfo.mjs.map +1 -1
  1042. package/utilities/astFromValue.d.mts +27 -0
  1043. package/utilities/astFromValue.d.ts +1 -0
  1044. package/utilities/astFromValue.js +8 -2
  1045. package/utilities/astFromValue.js.map +1 -1
  1046. package/utilities/astFromValue.mjs +8 -2
  1047. package/utilities/astFromValue.mjs.map +1 -1
  1048. package/utilities/buildASTSchema.d.mts +29 -0
  1049. package/utilities/buildClientSchema.d.mts +16 -0
  1050. package/utilities/buildClientSchema.js +10 -6
  1051. package/utilities/buildClientSchema.js.map +1 -1
  1052. package/utilities/buildClientSchema.mjs +9 -6
  1053. package/utilities/buildClientSchema.mjs.map +1 -1
  1054. package/utilities/coerceInputValue.d.mts +34 -0
  1055. package/utilities/coerceInputValue.d.ts +7 -1
  1056. package/utilities/coerceInputValue.js +36 -13
  1057. package/utilities/coerceInputValue.js.map +1 -1
  1058. package/utilities/coerceInputValue.mjs +36 -13
  1059. package/utilities/coerceInputValue.mjs.map +1 -1
  1060. package/utilities/concatAST.d.mts +7 -0
  1061. package/utilities/extendSchema.d.mts +29 -0
  1062. package/utilities/extendSchema.js +2 -1
  1063. package/utilities/extendSchema.js.map +1 -1
  1064. package/utilities/extendSchema.mjs +2 -1
  1065. package/utilities/extendSchema.mjs.map +1 -1
  1066. package/utilities/findSchemaChanges.d.mts +72 -0
  1067. package/utilities/findSchemaChanges.d.ts +18 -18
  1068. package/utilities/findSchemaChanges.js +4 -2
  1069. package/utilities/findSchemaChanges.js.map +1 -1
  1070. package/utilities/findSchemaChanges.mjs +4 -2
  1071. package/utilities/findSchemaChanges.mjs.map +1 -1
  1072. package/utilities/getDefaultValueAST.d.mts +3 -0
  1073. package/utilities/getDefaultValueAST.js +4 -2
  1074. package/utilities/getDefaultValueAST.js.map +1 -1
  1075. package/utilities/getDefaultValueAST.mjs +4 -2
  1076. package/utilities/getDefaultValueAST.mjs.map +1 -1
  1077. package/utilities/getIntrospectionQuery.d.mts +138 -0
  1078. package/utilities/getOperationAST.d.mts +8 -0
  1079. package/utilities/index.d.mts +32 -0
  1080. package/utilities/index.d.ts +2 -0
  1081. package/utilities/index.js +5 -1
  1082. package/utilities/index.js.map +1 -1
  1083. package/utilities/index.mjs +2 -0
  1084. package/utilities/index.mjs.map +1 -1
  1085. package/utilities/introspectionFromSchema.d.mts +12 -0
  1086. package/utilities/introspectionFromSchema.js +2 -1
  1087. package/utilities/introspectionFromSchema.js.map +1 -1
  1088. package/utilities/introspectionFromSchema.mjs +2 -1
  1089. package/utilities/introspectionFromSchema.mjs.map +1 -1
  1090. package/utilities/lexicographicSortSchema.d.mts +7 -0
  1091. package/utilities/mapSchemaConfig.d.mts +66 -0
  1092. package/utilities/mapSchemaConfig.d.ts +1 -1
  1093. package/utilities/mapSchemaConfig.js +6 -3
  1094. package/utilities/mapSchemaConfig.js.map +1 -1
  1095. package/utilities/mapSchemaConfig.mjs +6 -3
  1096. package/utilities/mapSchemaConfig.mjs.map +1 -1
  1097. package/utilities/printSchema.d.mts +7 -0
  1098. package/utilities/printSchema.js +4 -2
  1099. package/utilities/printSchema.js.map +1 -1
  1100. package/utilities/printSchema.mjs +4 -2
  1101. package/utilities/printSchema.mjs.map +1 -1
  1102. package/utilities/replaceVariables.d.mts +13 -0
  1103. package/utilities/replaceVariables.d.ts +2 -1
  1104. package/utilities/replaceVariables.js +17 -8
  1105. package/utilities/replaceVariables.js.map +1 -1
  1106. package/utilities/replaceVariables.mjs +17 -8
  1107. package/utilities/replaceVariables.mjs.map +1 -1
  1108. package/utilities/resolveSchemaCoordinate.d.mts +57 -0
  1109. package/utilities/resolveSchemaCoordinate.d.ts +57 -0
  1110. package/utilities/resolveSchemaCoordinate.js +167 -0
  1111. package/utilities/resolveSchemaCoordinate.js.map +1 -0
  1112. package/utilities/resolveSchemaCoordinate.mjs +163 -0
  1113. package/utilities/resolveSchemaCoordinate.mjs.map +1 -0
  1114. package/utilities/separateOperations.d.mts +9 -0
  1115. package/utilities/sortValueNode.d.mts +9 -0
  1116. package/utilities/stripIgnoredCharacters.d.mts +62 -0
  1117. package/utilities/typeComparators.d.mts +21 -0
  1118. package/utilities/typeFromAST.d.mts +15 -0
  1119. package/utilities/typedQueryDocumentNode.d.mts +17 -0
  1120. package/utilities/validateInputValue.d.mts +19 -0
  1121. package/utilities/validateInputValue.d.ts +2 -1
  1122. package/utilities/validateInputValue.js +42 -17
  1123. package/utilities/validateInputValue.js.map +1 -1
  1124. package/utilities/validateInputValue.mjs +42 -17
  1125. package/utilities/validateInputValue.mjs.map +1 -1
  1126. package/utilities/valueFromAST.d.mts +26 -0
  1127. package/utilities/valueFromAST.js +24 -9
  1128. package/utilities/valueFromAST.js.map +1 -1
  1129. package/utilities/valueFromAST.mjs +24 -9
  1130. package/utilities/valueFromAST.mjs.map +1 -1
  1131. package/utilities/valueFromASTUntyped.d.mts +20 -0
  1132. package/utilities/valueToLiteral.d.mts +31 -0
  1133. package/utilities/valueToLiteral.d.ts +1 -0
  1134. package/utilities/valueToLiteral.js +4 -1
  1135. package/utilities/valueToLiteral.js.map +1 -1
  1136. package/utilities/valueToLiteral.mjs +4 -1
  1137. package/utilities/valueToLiteral.mjs.map +1 -1
  1138. package/validation/ValidationContext.d.mts +70 -0
  1139. package/validation/ValidationContext.js +2 -0
  1140. package/validation/ValidationContext.js.map +1 -1
  1141. package/validation/ValidationContext.mjs +2 -0
  1142. package/validation/ValidationContext.mjs.map +1 -1
  1143. package/validation/index.d.mts +46 -0
  1144. package/validation/rules/DeferStreamDirectiveLabelRule.d.mts +8 -0
  1145. package/validation/rules/DeferStreamDirectiveLabelRule.js +1 -1
  1146. package/validation/rules/DeferStreamDirectiveLabelRule.js.map +1 -1
  1147. package/validation/rules/DeferStreamDirectiveLabelRule.mjs +1 -1
  1148. package/validation/rules/DeferStreamDirectiveLabelRule.mjs.map +1 -1
  1149. package/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.mts +8 -0
  1150. package/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.mts +8 -0
  1151. package/validation/rules/ExecutableDefinitionsRule.d.mts +11 -0
  1152. package/validation/rules/FieldsOnCorrectTypeRule.d.mts +11 -0
  1153. package/validation/rules/FragmentsOnCompositeTypesRule.d.mts +12 -0
  1154. package/validation/rules/KnownArgumentNamesRule.d.mts +16 -0
  1155. package/validation/rules/KnownDirectivesRule.d.mts +11 -0
  1156. package/validation/rules/KnownDirectivesRule.js +7 -4
  1157. package/validation/rules/KnownDirectivesRule.js.map +1 -1
  1158. package/validation/rules/KnownDirectivesRule.mjs +7 -4
  1159. package/validation/rules/KnownDirectivesRule.mjs.map +1 -1
  1160. package/validation/rules/KnownFragmentNamesRule.d.mts +11 -0
  1161. package/validation/rules/KnownOperationTypesRule.d.mts +11 -0
  1162. package/validation/rules/KnownTypeNamesRule.d.mts +11 -0
  1163. package/validation/rules/LoneAnonymousOperationRule.d.mts +11 -0
  1164. package/validation/rules/LoneSchemaDefinitionRule.d.mts +8 -0
  1165. package/validation/rules/MaxIntrospectionDepthRule.d.mts +3 -0
  1166. package/validation/rules/MaxIntrospectionDepthRule.d.ts +2 -2
  1167. package/validation/rules/MaxIntrospectionDepthRule.js +1 -2
  1168. package/validation/rules/MaxIntrospectionDepthRule.js.map +1 -1
  1169. package/validation/rules/MaxIntrospectionDepthRule.mjs +1 -2
  1170. package/validation/rules/MaxIntrospectionDepthRule.mjs.map +1 -1
  1171. package/validation/rules/NoFragmentCyclesRule.d.mts +11 -0
  1172. package/validation/rules/NoUndefinedVariablesRule.d.mts +11 -0
  1173. package/validation/rules/NoUnusedFragmentsRule.d.mts +11 -0
  1174. package/validation/rules/NoUnusedVariablesRule.d.mts +11 -0
  1175. package/validation/rules/OverlappingFieldsCanBeMergedRule.d.mts +12 -0
  1176. package/validation/rules/OverlappingFieldsCanBeMergedRule.js +15 -14
  1177. package/validation/rules/OverlappingFieldsCanBeMergedRule.js.map +1 -1
  1178. package/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +15 -14
  1179. package/validation/rules/OverlappingFieldsCanBeMergedRule.mjs.map +1 -1
  1180. package/validation/rules/PossibleFragmentSpreadsRule.d.mts +10 -0
  1181. package/validation/rules/PossibleTypeExtensionsRule.d.mts +8 -0
  1182. package/validation/rules/PossibleTypeExtensionsRule.js +5 -3
  1183. package/validation/rules/PossibleTypeExtensionsRule.js.map +1 -1
  1184. package/validation/rules/PossibleTypeExtensionsRule.mjs +5 -3
  1185. package/validation/rules/PossibleTypeExtensionsRule.mjs.map +1 -1
  1186. package/validation/rules/ProvidedRequiredArgumentsRule.d.mts +13 -0
  1187. package/validation/rules/ScalarLeafsRule.d.mts +9 -0
  1188. package/validation/rules/SingleFieldSubscriptionsRule.d.mts +12 -0
  1189. package/validation/rules/SingleFieldSubscriptionsRule.d.ts +2 -1
  1190. package/validation/rules/SingleFieldSubscriptionsRule.js +9 -2
  1191. package/validation/rules/SingleFieldSubscriptionsRule.js.map +1 -1
  1192. package/validation/rules/SingleFieldSubscriptionsRule.mjs +9 -2
  1193. package/validation/rules/SingleFieldSubscriptionsRule.mjs.map +1 -1
  1194. package/validation/rules/StreamDirectiveOnListFieldRule.d.mts +8 -0
  1195. package/validation/rules/UniqueArgumentDefinitionNamesRule.d.mts +9 -0
  1196. package/validation/rules/UniqueArgumentNamesRule.d.mts +11 -0
  1197. package/validation/rules/UniqueDirectiveNamesRule.d.mts +8 -0
  1198. package/validation/rules/UniqueDirectivesPerLocationRule.d.mts +11 -0
  1199. package/validation/rules/UniqueEnumValueNamesRule.d.mts +8 -0
  1200. package/validation/rules/UniqueFieldDefinitionNamesRule.d.mts +8 -0
  1201. package/validation/rules/UniqueFragmentNamesRule.d.mts +10 -0
  1202. package/validation/rules/UniqueInputFieldNamesRule.d.mts +11 -0
  1203. package/validation/rules/UniqueInputFieldNamesRule.js +2 -1
  1204. package/validation/rules/UniqueInputFieldNamesRule.js.map +1 -1
  1205. package/validation/rules/UniqueInputFieldNamesRule.mjs +2 -1
  1206. package/validation/rules/UniqueInputFieldNamesRule.mjs.map +1 -1
  1207. package/validation/rules/UniqueOperationNamesRule.d.mts +10 -0
  1208. package/validation/rules/UniqueOperationTypesRule.d.mts +8 -0
  1209. package/validation/rules/UniqueTypeNamesRule.d.mts +8 -0
  1210. package/validation/rules/UniqueVariableNamesRule.d.mts +8 -0
  1211. package/validation/rules/ValuesOfCorrectTypeRule.d.mts +11 -0
  1212. package/validation/rules/ValuesOfCorrectTypeRule.js +5 -0
  1213. package/validation/rules/ValuesOfCorrectTypeRule.js.map +1 -1
  1214. package/validation/rules/ValuesOfCorrectTypeRule.mjs +5 -0
  1215. package/validation/rules/ValuesOfCorrectTypeRule.mjs.map +1 -1
  1216. package/validation/rules/VariablesAreInputTypesRule.d.mts +11 -0
  1217. package/validation/rules/VariablesInAllowedPositionRule.d.mts +10 -0
  1218. package/validation/rules/VariablesInAllowedPositionRule.js +1 -3
  1219. package/validation/rules/VariablesInAllowedPositionRule.js.map +1 -1
  1220. package/validation/rules/VariablesInAllowedPositionRule.mjs +1 -3
  1221. package/validation/rules/VariablesInAllowedPositionRule.mjs.map +1 -1
  1222. package/validation/rules/custom/NoDeprecatedCustomRule.d.mts +13 -0
  1223. package/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.mts +13 -0
  1224. package/validation/specifiedRules.d.mts +17 -0
  1225. package/validation/specifiedRules.d.ts +1 -2
  1226. package/validation/specifiedRules.js +3 -1
  1227. package/validation/specifiedRules.js.map +1 -1
  1228. package/validation/specifiedRules.mjs +3 -1
  1229. package/validation/specifiedRules.mjs.map +1 -1
  1230. package/validation/validate.d.mts +48 -0
  1231. package/validation/validate.d.ts +5 -4
  1232. package/validation/validate.js +10 -5
  1233. package/validation/validate.js.map +1 -1
  1234. package/validation/validate.mjs +10 -5
  1235. package/validation/validate.mjs.map +1 -1
  1236. package/version.d.mts +13 -0
  1237. package/version.js +2 -2
  1238. package/version.js.map +1 -1
  1239. package/version.mjs +2 -2
  1240. package/version.mjs.map +1 -1
  1241. package/execution/AbortSignalListener.d.ts +0 -17
  1242. package/execution/AbortSignalListener.js +0 -71
  1243. package/execution/AbortSignalListener.js.map +0 -1
  1244. package/execution/AbortSignalListener.mjs +0 -65
  1245. package/execution/AbortSignalListener.mjs.map +0 -1
  1246. package/execution/IncrementalGraph.d.ts +0 -29
  1247. package/execution/IncrementalGraph.js +0 -232
  1248. package/execution/IncrementalGraph.js.map +0 -1
  1249. package/execution/IncrementalGraph.mjs +0 -228
  1250. package/execution/IncrementalGraph.mjs.map +0 -1
  1251. package/execution/IncrementalPublisher.d.ts +0 -10
  1252. package/execution/IncrementalPublisher.js +0 -259
  1253. package/execution/IncrementalPublisher.js.map +0 -1
  1254. package/execution/IncrementalPublisher.mjs +0 -256
  1255. package/execution/IncrementalPublisher.mjs.map +0 -1
  1256. package/execution/buildExecutionPlan.js.map +0 -1
  1257. package/execution/buildExecutionPlan.mjs.map +0 -1
  1258. package/execution/types.d.ts +0 -161
  1259. package/execution/types.js +0 -36
  1260. package/execution/types.js.map +0 -1
  1261. package/execution/types.mjs +0 -27
  1262. package/execution/types.mjs.map +0 -1
  1263. package/jsutils/BoxedPromiseOrValue.d.ts +0 -15
  1264. package/jsutils/BoxedPromiseOrValue.js +0 -27
  1265. package/jsutils/BoxedPromiseOrValue.js.map +0 -1
  1266. package/jsutils/BoxedPromiseOrValue.mjs +0 -23
  1267. package/jsutils/BoxedPromiseOrValue.mjs.map +0 -1
@@ -1,43 +1,25 @@
1
- import { BoxedPromiseOrValue } from "../jsutils/BoxedPromiseOrValue.mjs";
2
1
  import { inspect } from "../jsutils/inspect.mjs";
3
- import { invariant } from "../jsutils/invariant.mjs";
4
2
  import { isAsyncIterable } from "../jsutils/isAsyncIterable.mjs";
5
- import { isIterableObject } from "../jsutils/isIterableObject.mjs";
6
3
  import { isObjectLike } from "../jsutils/isObjectLike.mjs";
7
- import { isPromise } from "../jsutils/isPromise.mjs";
8
- import { memoize3 } from "../jsutils/memoize3.mjs";
4
+ import { isPromise, isPromiseLike } from "../jsutils/isPromise.mjs";
9
5
  import { addPath, pathToArray } from "../jsutils/Path.mjs";
10
- import { promiseForObject } from "../jsutils/promiseForObject.mjs";
11
- import { promiseReduce } from "../jsutils/promiseReduce.mjs";
6
+ import { ensureGraphQLError } from "../error/ensureGraphQLError.mjs";
12
7
  import { GraphQLError } from "../error/GraphQLError.mjs";
13
8
  import { locatedError } from "../error/locatedError.mjs";
14
- import { OperationTypeNode } from "../language/ast.mjs";
15
9
  import { Kind } from "../language/kinds.mjs";
16
- import { isAbstractType, isLeafType, isListType, isNonNullType, isObjectType, } from "../type/definition.mjs";
17
- import { GraphQLStreamDirective } from "../type/directives.mjs";
18
- import { assertValidSchema } from "../type/validate.mjs";
19
- import { AbortSignalListener, cancellableIterable, cancellablePromise, } from "./AbortSignalListener.mjs";
20
- import { buildExecutionPlan } from "./buildExecutionPlan.mjs";
21
- import { collectFields, collectSubfields as _collectSubfields, } from "./collectFields.mjs";
10
+ import { isSubscriptionOperationDefinitionNode } from "../language/predicates.mjs";
11
+ import { GraphQLDisableErrorPropagationDirective } from "../type/directives.mjs";
12
+ import { assertValidSchema } from "../type/index.mjs";
13
+ import { cancellablePromise } from "./cancellablePromise.mjs";
14
+ import { collectFields } from "./collectFields.mjs";
15
+ import { createSharedExecutionContext } from "./createSharedExecutionContext.mjs";
16
+ import { Executor } from "./Executor.mjs";
17
+ import { ExecutorThrowingOnIncremental } from "./ExecutorThrowingOnIncremental.mjs";
22
18
  import { getVariableSignature } from "./getVariableSignature.mjs";
23
- import { buildIncrementalResponse } from "./IncrementalPublisher.mjs";
19
+ import { IncrementalExecutor } from "./incremental/IncrementalExecutor.mjs";
24
20
  import { mapAsyncIterable } from "./mapAsyncIterable.mjs";
25
- import { DeferredFragmentRecord } from "./types.mjs";
26
- import { experimentalGetArgumentValues, getArgumentValues, getDirectiveValues, getVariableValues, } from "./values.mjs";
27
- /* eslint-disable @typescript-eslint/max-params */
28
- // This file contains a lot of such errors but we plan to refactor it anyway
29
- // so just disable it for entire file.
30
- /**
31
- * A memoized collection of relevant subfields with regard to the return
32
- * type. Memoizing ensures the subfields are not repeatedly calculated, which
33
- * saves overhead when resolving lists of values.
34
- */
35
- const collectSubfields = memoize3((validatedExecutionArgs, returnType, fieldDetailsList) => {
36
- const { schema, fragments, variableValues, hideSuggestions } = validatedExecutionArgs;
37
- return _collectSubfields(schema, fragments, variableValues, returnType, fieldDetailsList, hideSuggestions);
38
- });
21
+ import { getArgumentValues, getVariableValues } from "./values.mjs";
39
22
  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
- const UNEXPECTED_MULTIPLE_PAYLOADS = 'Executing this GraphQL operation would unexpectedly produce multiple payloads (due to @defer or @stream directive)';
41
23
  /**
42
24
  * Implements the "Executing requests" section of the GraphQL specification.
43
25
  *
@@ -58,24 +40,12 @@ export function execute(args) {
58
40
  if (args.schema.getDirective('defer') || args.schema.getDirective('stream')) {
59
41
  throw new Error(UNEXPECTED_EXPERIMENTAL_DIRECTIVES);
60
42
  }
61
- const result = experimentalExecuteIncrementally(args);
62
- // Multiple payloads could be encountered if the operation contains @defer or
63
- // @stream directives and is not validated prior to execution
64
- return ensureSinglePayload(result);
65
- }
66
- function ensureSinglePayload(result) {
67
- if (isPromise(result)) {
68
- return result.then((resolved) => {
69
- if ('initialResult' in resolved) {
70
- throw new Error(UNEXPECTED_MULTIPLE_PAYLOADS);
71
- }
72
- return resolved;
73
- });
74
- }
75
- if ('initialResult' in result) {
76
- throw new Error(UNEXPECTED_MULTIPLE_PAYLOADS);
43
+ const validatedExecutionArgs = validateExecutionArgs(args);
44
+ // Return early errors if execution context failed.
45
+ if (!('schema' in validatedExecutionArgs)) {
46
+ return { errors: validatedExecutionArgs };
77
47
  }
78
- return result;
48
+ return executeRootSelectionSet(validatedExecutionArgs);
79
49
  }
80
50
  /**
81
51
  * Implements the "Executing requests" section of the GraphQL specification,
@@ -97,7 +67,17 @@ export function experimentalExecuteIncrementally(args) {
97
67
  if (!('schema' in validatedExecutionArgs)) {
98
68
  return { errors: validatedExecutionArgs };
99
69
  }
100
- return experimentalExecuteQueryOrMutationOrSubscriptionEvent(validatedExecutionArgs);
70
+ return experimentalExecuteRootSelectionSet(validatedExecutionArgs);
71
+ }
72
+ export function executeIgnoringIncremental(args) {
73
+ // If a valid execution context cannot be created due to incorrect arguments,
74
+ // a "Response" with only errors is returned.
75
+ const validatedExecutionArgs = validateExecutionArgs(args);
76
+ // Return early errors if execution context failed.
77
+ if (!('schema' in validatedExecutionArgs)) {
78
+ return { errors: validatedExecutionArgs };
79
+ }
80
+ return executeRootSelectionSetIgnoringIncremental(validatedExecutionArgs);
101
81
  }
102
82
  /**
103
83
  * Implements the "Executing operations" section of the spec.
@@ -114,65 +94,14 @@ export function experimentalExecuteIncrementally(args) {
114
94
  * at which point we still log the error and null the parent field, which
115
95
  * in this case is the entire response.
116
96
  */
117
- export function executeQueryOrMutationOrSubscriptionEvent(validatedExecutionArgs) {
118
- const result = experimentalExecuteQueryOrMutationOrSubscriptionEvent(validatedExecutionArgs);
119
- return ensureSinglePayload(result);
97
+ export function executeRootSelectionSet(validatedExecutionArgs) {
98
+ return new ExecutorThrowingOnIncremental(validatedExecutionArgs).executeRootSelectionSet();
120
99
  }
121
- export function experimentalExecuteQueryOrMutationOrSubscriptionEvent(validatedExecutionArgs) {
122
- const abortSignal = validatedExecutionArgs.abortSignal;
123
- const exeContext = {
124
- validatedExecutionArgs,
125
- errors: undefined,
126
- abortSignalListener: abortSignal
127
- ? new AbortSignalListener(abortSignal)
128
- : undefined,
129
- completed: false,
130
- cancellableStreams: undefined,
131
- };
132
- try {
133
- const { schema, fragments, rootValue, operation, variableValues, hideSuggestions, } = validatedExecutionArgs;
134
- const { operation: operationType, selectionSet } = operation;
135
- const rootType = schema.getRootType(operationType);
136
- if (rootType == null) {
137
- throw new GraphQLError(`Schema is not configured to execute ${operationType} operation.`, { nodes: operation });
138
- }
139
- const { groupedFieldSet, newDeferUsages } = collectFields(schema, fragments, variableValues, rootType, selectionSet, hideSuggestions);
140
- const graphqlWrappedResult = executeRootExecutionPlan(exeContext, operation.operation, rootType, rootValue, groupedFieldSet, newDeferUsages);
141
- if (isPromise(graphqlWrappedResult)) {
142
- return graphqlWrappedResult.then((resolved) => {
143
- exeContext.completed = true;
144
- return buildDataResponse(exeContext, resolved);
145
- }, (error) => {
146
- exeContext.completed = true;
147
- exeContext.abortSignalListener?.disconnect();
148
- return {
149
- data: null,
150
- errors: withError(exeContext.errors, error),
151
- };
152
- });
153
- }
154
- exeContext.completed = true;
155
- return buildDataResponse(exeContext, graphqlWrappedResult);
156
- }
157
- catch (error) {
158
- exeContext.completed = true;
159
- // TODO: add test case for synchronous null bubbling to root with cancellation
160
- /* c8 ignore next */
161
- exeContext.abortSignalListener?.disconnect();
162
- return { data: null, errors: withError(exeContext.errors, error) };
163
- }
164
- }
165
- function withError(errors, error) {
166
- return errors === undefined ? [error] : [...errors, error];
100
+ export function experimentalExecuteRootSelectionSet(validatedExecutionArgs) {
101
+ return new IncrementalExecutor(validatedExecutionArgs).executeRootSelectionSet();
167
102
  }
168
- function buildDataResponse(exeContext, graphqlWrappedResult) {
169
- const { rawResult: data, incrementalDataRecords } = graphqlWrappedResult;
170
- const errors = exeContext.errors;
171
- if (incrementalDataRecords === undefined) {
172
- exeContext.abortSignalListener?.disconnect();
173
- return errors !== undefined ? { errors, data } : { data };
174
- }
175
- return buildIncrementalResponse(exeContext, data, errors, incrementalDataRecords);
103
+ export function executeRootSelectionSetIgnoringIncremental(validatedExecutionArgs) {
104
+ return new Executor(validatedExecutionArgs).executeRootSelectionSet();
176
105
  }
177
106
  /**
178
107
  * Also implements the "Executing requests" section of the GraphQL specification.
@@ -187,6 +116,95 @@ export function executeSync(args) {
187
116
  }
188
117
  return result;
189
118
  }
119
+ export function executeSubscriptionEvent(validatedExecutionArgs) {
120
+ return new ExecutorThrowingOnIncremental(validatedExecutionArgs).executeRootSelectionSet(false);
121
+ }
122
+ /**
123
+ * Implements the "Subscribe" algorithm described in the GraphQL specification.
124
+ *
125
+ * Returns a Promise which resolves to either an AsyncIterator (if successful)
126
+ * or an ExecutionResult (error). The promise will be rejected if the schema or
127
+ * other arguments to this function are invalid, or if the resolved event stream
128
+ * is not an async iterable.
129
+ *
130
+ * If the client-provided arguments to this function do not result in a
131
+ * compliant subscription, a GraphQL Response (ExecutionResult) with descriptive
132
+ * errors and no data will be returned.
133
+ *
134
+ * If the source stream could not be created due to faulty subscription resolver
135
+ * logic or underlying systems, the promise will resolve to a single
136
+ * ExecutionResult containing `errors` and no `data`.
137
+ *
138
+ * If the operation succeeded, the promise resolves to an AsyncIterator, which
139
+ * yields a stream of ExecutionResults representing the response stream.
140
+ *
141
+ * This function does not support incremental delivery (`@defer` and `@stream`).
142
+ * If an operation which would defer or stream data is executed with this
143
+ * function, a field error will be raised at the location of the `@defer` or
144
+ * `@stream` directive.
145
+ *
146
+ * Accepts an object with named arguments.
147
+ */
148
+ export function subscribe(args) {
149
+ // If a valid execution context cannot be created due to incorrect arguments,
150
+ // a "Response" with only errors is returned.
151
+ const validatedExecutionArgs = validateSubscriptionArgs(args);
152
+ // Return early errors if execution context failed.
153
+ if (!('schema' in validatedExecutionArgs)) {
154
+ return { errors: validatedExecutionArgs };
155
+ }
156
+ const resultOrStream = createSourceEventStream(validatedExecutionArgs);
157
+ if (isPromise(resultOrStream)) {
158
+ return resultOrStream.then((resolvedResultOrStream) => mapSourceToResponse(validatedExecutionArgs, resolvedResultOrStream));
159
+ }
160
+ return mapSourceToResponse(validatedExecutionArgs, resultOrStream);
161
+ }
162
+ /**
163
+ * Implements the "CreateSourceEventStream" algorithm described in the
164
+ * GraphQL specification, resolving the subscription source event stream for a
165
+ * previously validated subscription request.
166
+ *
167
+ * Returns a Promise which resolves to either an AsyncIterable (if successful)
168
+ * or an ExecutionResult (error). The promise will be rejected if the validated
169
+ * execution arguments are invalid, or if the resolved event stream is not an
170
+ * async iterable.
171
+ *
172
+ * If the client-provided arguments to this function do not result in a
173
+ * compliant subscription, a GraphQL Response (ExecutionResult) with
174
+ * descriptive errors and no data will be returned.
175
+ *
176
+ * If the the source stream could not be created due to faulty subscription
177
+ * resolver logic or underlying systems, the promise will resolve to a single
178
+ * ExecutionResult containing `errors` and no `data`.
179
+ *
180
+ * If the operation succeeded, the promise resolves to the AsyncIterable for the
181
+ * event stream returned by the resolver.
182
+ *
183
+ * A Source Event Stream represents a sequence of events, each of which triggers
184
+ * a GraphQL execution for that event.
185
+ *
186
+ * This may be useful when hosting the stateful subscription service in a
187
+ * different process or machine than the stateless GraphQL execution engine,
188
+ * or otherwise separating these two steps. For more on this, see the
189
+ * "Supporting Subscriptions at Scale" information in the GraphQL specification.
190
+ */
191
+ export function createSourceEventStream(validatedExecutionArgs) {
192
+ if (!('operation' in validatedExecutionArgs)) {
193
+ throw new GraphQLError('Passing ExecutionArgs to createSourceEventStream() was removed in graphql-js@17.0.0; call validateSubscriptionArgs() first and pass the result instead, or use subscribe() for the full subscription pipeline.');
194
+ }
195
+ try {
196
+ const eventStream = executeSubscription(validatedExecutionArgs);
197
+ if (isPromise(eventStream)) {
198
+ return eventStream.then(undefined, (error) => ({
199
+ errors: [ensureGraphQLError(error)],
200
+ }));
201
+ }
202
+ return eventStream;
203
+ }
204
+ catch (error) {
205
+ return { errors: [ensureGraphQLError(error)] };
206
+ }
207
+ }
190
208
  /**
191
209
  * Constructs a ExecutionContext object from the arguments passed to
192
210
  * execute, which we will pass throughout the other execution methods.
@@ -197,10 +215,7 @@ export function executeSync(args) {
197
215
  * @internal
198
216
  */
199
217
  export function validateExecutionArgs(args) {
200
- const { schema, document, rootValue, contextValue, variableValues: rawVariableValues, operationName, fieldResolver, typeResolver, subscribeFieldResolver, perEventExecutor, enableEarlyExecution, abortSignal, } = args;
201
- if (abortSignal?.aborted) {
202
- return [locatedError(abortSignal.reason, undefined)];
203
- }
218
+ const { schema, document, rootValue, contextValue, variableValues: rawVariableValues, operationName, fieldResolver, typeResolver, subscribeFieldResolver, perEventExecutor, abortSignal: externalAbortSignal, enableEarlyExecution, hooks, options, } = args;
204
219
  // If the schema used for execution is invalid, throw an error.
205
220
  assertValidSchema(schema);
206
221
  let operation;
@@ -247,12 +262,13 @@ export function validateExecutionArgs(args) {
247
262
  const variableDefinitions = operation.variableDefinitions ?? [];
248
263
  const hideSuggestions = args.hideSuggestions ?? false;
249
264
  const variableValuesOrErrors = getVariableValues(schema, variableDefinitions, rawVariableValues ?? {}, {
250
- maxErrors: 50,
265
+ maxErrors: options?.maxCoercionErrors ?? 50,
251
266
  hideSuggestions,
252
267
  });
253
268
  if (variableValuesOrErrors.errors) {
254
269
  return variableValuesOrErrors.errors;
255
270
  }
271
+ const errorPropagation = !operation.directives?.find((directive) => directive.name.value === GraphQLDisableErrorPropagationDirective.name);
256
272
  return {
257
273
  schema,
258
274
  fragmentDefinitions,
@@ -265,690 +281,25 @@ export function validateExecutionArgs(args) {
265
281
  typeResolver: typeResolver ?? defaultTypeResolver,
266
282
  subscribeFieldResolver: subscribeFieldResolver ?? defaultFieldResolver,
267
283
  perEventExecutor: perEventExecutor ?? executeSubscriptionEvent,
268
- enableEarlyExecution: enableEarlyExecution === true,
269
284
  hideSuggestions,
270
- abortSignal: args.abortSignal ?? undefined,
271
- };
272
- }
273
- function executeRootExecutionPlan(exeContext, operation, rootType, rootValue, originalGroupedFieldSet, newDeferUsages) {
274
- if (newDeferUsages.length === 0) {
275
- return executeRootGroupedFieldSet(exeContext, operation, rootType, rootValue, originalGroupedFieldSet, undefined);
276
- }
277
- const newDeferMap = getNewDeferMap(newDeferUsages, undefined, undefined);
278
- const { groupedFieldSet, newGroupedFieldSets } = buildExecutionPlan(originalGroupedFieldSet);
279
- const graphqlWrappedResult = executeRootGroupedFieldSet(exeContext, operation, rootType, rootValue, groupedFieldSet, newDeferMap);
280
- if (newGroupedFieldSets.size > 0) {
281
- const newPendingExecutionGroups = collectExecutionGroups(exeContext, rootType, rootValue, undefined, undefined, newGroupedFieldSets, newDeferMap);
282
- return withNewExecutionGroups(graphqlWrappedResult, newPendingExecutionGroups);
283
- }
284
- return graphqlWrappedResult;
285
- }
286
- function withNewExecutionGroups(result, newPendingExecutionGroups) {
287
- if (isPromise(result)) {
288
- return result.then((resolved) => {
289
- addIncrementalDataRecords(resolved, newPendingExecutionGroups);
290
- return resolved;
291
- });
292
- }
293
- addIncrementalDataRecords(result, newPendingExecutionGroups);
294
- return result;
295
- }
296
- function executeRootGroupedFieldSet(exeContext, operation, rootType, rootValue, groupedFieldSet, deferMap) {
297
- switch (operation) {
298
- case OperationTypeNode.QUERY:
299
- return executeFields(exeContext, rootType, rootValue, undefined, groupedFieldSet, undefined, deferMap);
300
- case OperationTypeNode.MUTATION:
301
- return executeFieldsSerially(exeContext, rootType, rootValue, undefined, groupedFieldSet, undefined, deferMap);
302
- case OperationTypeNode.SUBSCRIPTION:
303
- // TODO: deprecate `subscribe` and move all logic here
304
- // Temporary solution until we finish merging execute and subscribe together
305
- return executeFields(exeContext, rootType, rootValue, undefined, groupedFieldSet, undefined, deferMap);
306
- }
307
- }
308
- /**
309
- * Implements the "Executing selection sets" section of the spec
310
- * for fields that must be executed serially.
311
- */
312
- function executeFieldsSerially(exeContext, parentType, sourceValue, path, groupedFieldSet, incrementalContext, deferMap) {
313
- const abortSignal = exeContext.validatedExecutionArgs.abortSignal;
314
- return promiseReduce(groupedFieldSet, (graphqlWrappedResult, [responseName, fieldDetailsList]) => {
315
- const fieldPath = addPath(path, responseName, parentType.name);
316
- if (abortSignal?.aborted) {
317
- handleFieldError(abortSignal.reason, exeContext, parentType, fieldDetailsList, fieldPath, incrementalContext);
318
- graphqlWrappedResult.rawResult[responseName] = null;
319
- return graphqlWrappedResult;
320
- }
321
- const result = executeField(exeContext, parentType, sourceValue, fieldDetailsList, fieldPath, incrementalContext, deferMap);
322
- if (result === undefined) {
323
- return graphqlWrappedResult;
324
- }
325
- if (isPromise(result)) {
326
- return result.then((resolved) => {
327
- graphqlWrappedResult.rawResult[responseName] = resolved.rawResult;
328
- addIncrementalDataRecords(graphqlWrappedResult, resolved.incrementalDataRecords);
329
- return graphqlWrappedResult;
330
- });
331
- }
332
- graphqlWrappedResult.rawResult[responseName] = result.rawResult;
333
- addIncrementalDataRecords(graphqlWrappedResult, result.incrementalDataRecords);
334
- return graphqlWrappedResult;
335
- }, {
336
- rawResult: Object.create(null),
337
- incrementalDataRecords: undefined,
338
- });
339
- }
340
- function addIncrementalDataRecords(graphqlWrappedResult, incrementalDataRecords) {
341
- if (incrementalDataRecords === undefined) {
342
- return;
343
- }
344
- if (graphqlWrappedResult.incrementalDataRecords === undefined) {
345
- graphqlWrappedResult.incrementalDataRecords = [...incrementalDataRecords];
346
- }
347
- else {
348
- graphqlWrappedResult.incrementalDataRecords.push(...incrementalDataRecords);
349
- }
350
- }
351
- /**
352
- * Implements the "Executing selection sets" section of the spec
353
- * for fields that may be executed in parallel.
354
- */
355
- function executeFields(exeContext, parentType, sourceValue, path, groupedFieldSet, incrementalContext, deferMap) {
356
- const results = Object.create(null);
357
- const graphqlWrappedResult = {
358
- rawResult: results,
359
- incrementalDataRecords: undefined,
360
- };
361
- let containsPromise = false;
362
- try {
363
- for (const [responseName, fieldDetailsList] of groupedFieldSet) {
364
- const fieldPath = addPath(path, responseName, parentType.name);
365
- const result = executeField(exeContext, parentType, sourceValue, fieldDetailsList, fieldPath, incrementalContext, deferMap);
366
- if (result !== undefined) {
367
- if (isPromise(result)) {
368
- results[responseName] = result.then((resolved) => {
369
- addIncrementalDataRecords(graphqlWrappedResult, resolved.incrementalDataRecords);
370
- return resolved.rawResult;
371
- });
372
- containsPromise = true;
373
- }
374
- else {
375
- results[responseName] = result.rawResult;
376
- addIncrementalDataRecords(graphqlWrappedResult, result.incrementalDataRecords);
377
- }
378
- }
379
- }
380
- }
381
- catch (error) {
382
- if (containsPromise) {
383
- // Ensure that any promises returned by other fields are handled, as they may also reject.
384
- return promiseForObject(results, () => {
385
- /* noop */
386
- }).finally(() => {
387
- throw error;
388
- });
389
- }
390
- throw error;
391
- }
392
- // If there are no promises, we can just return the object and any incrementalDataRecords
393
- if (!containsPromise) {
394
- return graphqlWrappedResult;
395
- }
396
- // Otherwise, results is a map from field name to the result of resolving that
397
- // field, which is possibly a promise. Return a promise that will return this
398
- // same map, but with any promises replaced with the values they resolved to.
399
- return promiseForObject(results, (resolved) => ({
400
- rawResult: resolved,
401
- incrementalDataRecords: graphqlWrappedResult.incrementalDataRecords,
402
- }));
403
- }
404
- function toNodes(fieldDetailsList) {
405
- return fieldDetailsList.map((fieldDetails) => fieldDetails.node);
406
- }
407
- /**
408
- * Implements the "Executing fields" section of the spec
409
- * In particular, this function figures out the value that the field returns by
410
- * calling its resolve function, then calls completeValue to complete promises,
411
- * coercing scalars, or execute the sub-selection-set for objects.
412
- */
413
- function executeField(exeContext, parentType, source, fieldDetailsList, path, incrementalContext, deferMap) {
414
- const { validatedExecutionArgs, abortSignalListener } = exeContext;
415
- const { schema, contextValue, variableValues, hideSuggestions, abortSignal } = validatedExecutionArgs;
416
- const fieldName = fieldDetailsList[0].node.name.value;
417
- const fieldDef = schema.getField(parentType, fieldName);
418
- if (!fieldDef) {
419
- return;
420
- }
421
- const returnType = fieldDef.type;
422
- const resolveFn = fieldDef.resolve ?? validatedExecutionArgs.fieldResolver;
423
- const info = buildResolveInfo(validatedExecutionArgs, fieldDef, toNodes(fieldDetailsList), parentType, path);
424
- // Get the resolve function, regardless of if its result is normal or abrupt (error).
425
- try {
426
- // Build a JS object of arguments from the field.arguments AST, using the
427
- // variables scope to fulfill any variable references.
428
- // TODO: find a way to memoize, in case this field is within a List type.
429
- const args = experimentalGetArgumentValues(fieldDetailsList[0].node, fieldDef.args, variableValues, fieldDetailsList[0].fragmentVariableValues, hideSuggestions);
430
- // The resolve function's optional third argument is a context value that
431
- // is provided to every resolve function within an execution. It is commonly
432
- // used to represent an authenticated user, or request-specific caches.
433
- const result = resolveFn(source, args, contextValue, info, abortSignal);
434
- if (isPromise(result)) {
435
- return completePromisedValue(exeContext, returnType, fieldDetailsList, info, path, abortSignalListener
436
- ? cancellablePromise(result, abortSignalListener)
437
- : result, incrementalContext, deferMap);
438
- }
439
- const completed = completeValue(exeContext, returnType, fieldDetailsList, info, path, result, incrementalContext, deferMap);
440
- if (isPromise(completed)) {
441
- // Note: we don't rely on a `catch` method, but we do expect "thenable"
442
- // to take a second callback for the error case.
443
- return completed.then(undefined, (rawError) => {
444
- handleFieldError(rawError, exeContext, returnType, fieldDetailsList, path, incrementalContext);
445
- return { rawResult: null, incrementalDataRecords: undefined };
446
- });
447
- }
448
- return completed;
449
- }
450
- catch (rawError) {
451
- handleFieldError(rawError, exeContext, returnType, fieldDetailsList, path, incrementalContext);
452
- return { rawResult: null, incrementalDataRecords: undefined };
453
- }
454
- }
455
- /**
456
- * TODO: consider no longer exporting this function
457
- * @internal
458
- */
459
- export function buildResolveInfo(validatedExecutionArgs, fieldDef, fieldNodes, parentType, path) {
460
- const { schema, fragmentDefinitions, rootValue, operation, variableValues } = validatedExecutionArgs;
461
- // The resolve function's optional fourth argument is a collection of
462
- // information about the current execution state.
463
- return {
464
- fieldName: fieldDef.name,
465
- fieldNodes,
466
- returnType: fieldDef.type,
467
- parentType,
468
- path,
469
- schema,
470
- fragments: fragmentDefinitions,
471
- rootValue,
472
- operation,
473
- variableValues,
474
- };
475
- }
476
- function handleFieldError(rawError, exeContext, returnType, fieldDetailsList, path, incrementalContext) {
477
- const error = locatedError(rawError, toNodes(fieldDetailsList), pathToArray(path));
478
- // If the field type is non-nullable, then it is resolved without any
479
- // protection from errors, however it still properly locates the error.
480
- if (isNonNullType(returnType)) {
481
- throw error;
482
- }
483
- // Otherwise, error protection is applied, logging the error and resolving
484
- // a null value for this field if one is encountered.
485
- const context = incrementalContext ?? exeContext;
486
- let errors = context.errors;
487
- if (errors === undefined) {
488
- errors = [];
489
- context.errors = errors;
490
- }
491
- errors.push(error);
492
- }
493
- /**
494
- * Implements the instructions for completeValue as defined in the
495
- * "Value Completion" section of the spec.
496
- *
497
- * If the field type is Non-Null, then this recursively completes the value
498
- * for the inner type. It throws a field error if that completion returns null,
499
- * as per the "Nullability" section of the spec.
500
- *
501
- * If the field type is a List, then this recursively completes the value
502
- * for the inner type on each item in the list.
503
- *
504
- * If the field type is a Scalar or Enum, ensures the completed value is a legal
505
- * value of the type by calling the `coerceOutputValue` method of GraphQL type
506
- * definition.
507
- *
508
- * If the field is an abstract type, determine the runtime type of the value
509
- * and then complete based on that type
510
- *
511
- * Otherwise, the field type expects a sub-selection set, and will complete the
512
- * value by executing all sub-selections.
513
- */
514
- function completeValue(exeContext, returnType, fieldDetailsList, info, path, result, incrementalContext, deferMap) {
515
- // If result is an Error, throw a located error.
516
- if (result instanceof Error) {
517
- throw result;
518
- }
519
- // If field type is NonNull, complete for inner type, and throw field error
520
- // if result is null.
521
- if (isNonNullType(returnType)) {
522
- const completed = completeValue(exeContext, returnType.ofType, fieldDetailsList, info, path, result, incrementalContext, deferMap);
523
- if (completed.rawResult === null) {
524
- throw new Error(`Cannot return null for non-nullable field ${info.parentType}.${info.fieldName}.`);
525
- }
526
- return completed;
527
- }
528
- // If result value is null or undefined then return null.
529
- if (result == null) {
530
- return { rawResult: null, incrementalDataRecords: undefined };
531
- }
532
- // If field type is List, complete each item in the list with the inner type
533
- if (isListType(returnType)) {
534
- return completeListValue(exeContext, returnType, fieldDetailsList, info, path, result, incrementalContext, deferMap);
535
- }
536
- // If field type is a leaf type, Scalar or Enum, coerce to a valid value,
537
- // returning null if coercion is not possible.
538
- if (isLeafType(returnType)) {
539
- return {
540
- rawResult: completeLeafValue(returnType, result),
541
- incrementalDataRecords: undefined,
542
- };
543
- }
544
- // If field type is an abstract type, Interface or Union, determine the
545
- // runtime Object type and complete for that type.
546
- if (isAbstractType(returnType)) {
547
- return completeAbstractValue(exeContext, returnType, fieldDetailsList, info, path, result, incrementalContext, deferMap);
548
- }
549
- // If field type is Object, execute and complete all sub-selections.
550
- if (isObjectType(returnType)) {
551
- return completeObjectValue(exeContext, returnType, fieldDetailsList, info, path, result, incrementalContext, deferMap);
552
- }
553
- /* c8 ignore next 6 */
554
- // Not reachable, all possible output types have been considered.
555
- (false) || invariant(false, 'Cannot complete value of unexpected output type: ' + inspect(returnType));
556
- }
557
- async function completePromisedValue(exeContext, returnType, fieldDetailsList, info, path, result, incrementalContext, deferMap) {
558
- try {
559
- const resolved = await result;
560
- let completed = completeValue(exeContext, returnType, fieldDetailsList, info, path, resolved, incrementalContext, deferMap);
561
- if (isPromise(completed)) {
562
- completed = await completed;
563
- }
564
- return completed;
565
- }
566
- catch (rawError) {
567
- handleFieldError(rawError, exeContext, returnType, fieldDetailsList, path, incrementalContext);
568
- return { rawResult: null, incrementalDataRecords: undefined };
569
- }
570
- }
571
- /**
572
- * Returns an object containing info for streaming if a field should be
573
- * streamed based on the experimental flag, stream directive present and
574
- * not disabled by the "if" argument.
575
- */
576
- function getStreamUsage(validatedExecutionArgs, fieldDetailsList, path) {
577
- // do not stream inner lists of multi-dimensional lists
578
- if (typeof path.key === 'number') {
579
- return;
580
- }
581
- // TODO: add test for this case (a streamed list nested under a list).
582
- /* c8 ignore next 7 */
583
- if (fieldDetailsList
584
- ._streamUsage !== undefined) {
585
- return fieldDetailsList
586
- ._streamUsage;
587
- }
588
- const { operation, variableValues } = validatedExecutionArgs;
589
- // validation only allows equivalent streams on multiple fields, so it is
590
- // safe to only check the first fieldNode for the stream directive
591
- const stream = getDirectiveValues(GraphQLStreamDirective, fieldDetailsList[0].node, variableValues, fieldDetailsList[0].fragmentVariableValues);
592
- if (!stream) {
593
- return;
594
- }
595
- if (stream.if === false) {
596
- return;
597
- }
598
- (typeof stream.initialCount === 'number') || invariant(false, 'initialCount must be a number');
599
- (stream.initialCount >= 0) || invariant(false, 'initialCount must be a positive integer');
600
- (operation.operation !== OperationTypeNode.SUBSCRIPTION) || invariant(false, '`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.');
601
- const streamedFieldDetailsList = fieldDetailsList.map((fieldDetails) => ({
602
- node: fieldDetails.node,
603
- deferUsage: undefined,
604
- fragmentVariableValues: fieldDetails.fragmentVariableValues,
605
- }));
606
- const streamUsage = {
607
- initialCount: stream.initialCount,
608
- label: typeof stream.label === 'string' ? stream.label : undefined,
609
- fieldDetailsList: streamedFieldDetailsList,
610
- };
611
- fieldDetailsList._streamUsage =
612
- streamUsage;
613
- return streamUsage;
614
- }
615
- /**
616
- * Complete a async iterator value by completing the result and calling
617
- * recursively until all the results are completed.
618
- */
619
- async function completeAsyncIteratorValue(exeContext, itemType, fieldDetailsList, info, path, asyncIterator, incrementalContext, deferMap) {
620
- let containsPromise = false;
621
- const completedResults = [];
622
- const graphqlWrappedResult = {
623
- rawResult: completedResults,
624
- incrementalDataRecords: undefined,
625
- };
626
- let index = 0;
627
- const streamUsage = getStreamUsage(exeContext.validatedExecutionArgs, fieldDetailsList, path);
628
- const earlyReturn = asyncIterator.return === undefined
629
- ? undefined
630
- : asyncIterator.return.bind(asyncIterator);
631
- try {
632
- while (true) {
633
- if (streamUsage && index >= streamUsage.initialCount) {
634
- const streamItemQueue = buildAsyncStreamItemQueue(index, path, asyncIterator, exeContext, streamUsage.fieldDetailsList, info, itemType);
635
- let streamRecord;
636
- if (earlyReturn === undefined) {
637
- streamRecord = {
638
- label: streamUsage.label,
639
- path,
640
- streamItemQueue,
641
- };
642
- }
643
- else {
644
- streamRecord = {
645
- label: streamUsage.label,
646
- path,
647
- earlyReturn,
648
- streamItemQueue,
649
- };
650
- if (exeContext.cancellableStreams === undefined) {
651
- exeContext.cancellableStreams = new Set();
652
- }
653
- exeContext.cancellableStreams.add(streamRecord);
654
- }
655
- addIncrementalDataRecords(graphqlWrappedResult, [streamRecord]);
656
- break;
657
- }
658
- const itemPath = addPath(path, index, undefined);
659
- let iteration;
660
- try {
661
- // eslint-disable-next-line no-await-in-loop
662
- iteration = await asyncIterator.next();
663
- }
664
- catch (rawError) {
665
- throw locatedError(rawError, toNodes(fieldDetailsList), pathToArray(path));
666
- }
667
- // TODO: add test case for stream returning done before initialCount
668
- /* c8 ignore next 3 */
669
- if (iteration.done) {
670
- break;
671
- }
672
- const item = iteration.value;
673
- // TODO: add tests for stream backed by asyncIterator that returns a promise
674
- /* c8 ignore start */
675
- if (isPromise(item)) {
676
- completedResults.push(completePromisedListItemValue(item, graphqlWrappedResult, exeContext, itemType, fieldDetailsList, info, itemPath, incrementalContext, deferMap));
677
- containsPromise = true;
678
- }
679
- else if (
680
- /* c8 ignore stop */
681
- completeListItemValue(item, completedResults, graphqlWrappedResult, exeContext, itemType, fieldDetailsList, info, itemPath, incrementalContext, deferMap)
682
- // TODO: add tests for stream backed by asyncIterator that completes to a promise
683
- /* c8 ignore start */
684
- ) {
685
- containsPromise = true;
686
- }
687
- /* c8 ignore stop */
688
- index++;
689
- }
690
- }
691
- catch (error) {
692
- if (earlyReturn !== undefined) {
693
- earlyReturn().catch(() => {
694
- /* c8 ignore next 1 */
695
- // ignore error
696
- });
697
- }
698
- throw error;
699
- }
700
- return containsPromise
701
- ? /* c8 ignore start */ Promise.all(completedResults).then((resolved) => ({
702
- rawResult: resolved,
703
- incrementalDataRecords: graphqlWrappedResult.incrementalDataRecords,
704
- }))
705
- : /* c8 ignore stop */ graphqlWrappedResult;
706
- }
707
- /**
708
- * Complete a list value by completing each item in the list with the
709
- * inner type
710
- */
711
- function completeListValue(exeContext, returnType, fieldDetailsList, info, path, result, incrementalContext, deferMap) {
712
- const itemType = returnType.ofType;
713
- if (isAsyncIterable(result)) {
714
- const abortSignalListener = exeContext.abortSignalListener;
715
- const maybeCancellableIterable = abortSignalListener
716
- ? cancellableIterable(result, abortSignalListener)
717
- : result;
718
- const asyncIterator = maybeCancellableIterable[Symbol.asyncIterator]();
719
- return completeAsyncIteratorValue(exeContext, itemType, fieldDetailsList, info, path, asyncIterator, incrementalContext, deferMap);
720
- }
721
- if (!isIterableObject(result)) {
722
- throw new GraphQLError(`Expected Iterable, but did not find one for field "${info.parentType}.${info.fieldName}".`);
723
- }
724
- return completeIterableValue(exeContext, itemType, fieldDetailsList, info, path, result, incrementalContext, deferMap);
725
- }
726
- function completeIterableValue(exeContext, itemType, fieldDetailsList, info, path, items, incrementalContext, deferMap) {
727
- // This is specified as a simple map, however we're optimizing the path
728
- // where the list contains no Promises by avoiding creating another Promise.
729
- let containsPromise = false;
730
- const completedResults = [];
731
- const graphqlWrappedResult = {
732
- rawResult: completedResults,
733
- incrementalDataRecords: undefined,
285
+ errorPropagation,
286
+ externalAbortSignal: externalAbortSignal ?? undefined,
287
+ enableEarlyExecution: enableEarlyExecution === true,
288
+ hooks: hooks ?? undefined,
734
289
  };
735
- let index = 0;
736
- const streamUsage = getStreamUsage(exeContext.validatedExecutionArgs, fieldDetailsList, path);
737
- const iterator = items[Symbol.iterator]();
738
- let iteration = iterator.next();
739
- while (!iteration.done) {
740
- const item = iteration.value;
741
- if (streamUsage && index >= streamUsage.initialCount) {
742
- const syncStreamRecord = {
743
- label: streamUsage.label,
744
- path,
745
- streamItemQueue: buildSyncStreamItemQueue(item, index, path, iterator, exeContext, streamUsage.fieldDetailsList, info, itemType),
746
- };
747
- addIncrementalDataRecords(graphqlWrappedResult, [syncStreamRecord]);
748
- break;
749
- }
750
- // No need to modify the info object containing the path,
751
- // since from here on it is not ever accessed by resolver functions.
752
- const itemPath = addPath(path, index, undefined);
753
- if (isPromise(item)) {
754
- completedResults.push(completePromisedListItemValue(item, graphqlWrappedResult, exeContext, itemType, fieldDetailsList, info, itemPath, incrementalContext, deferMap));
755
- containsPromise = true;
756
- }
757
- else if (completeListItemValue(item, completedResults, graphqlWrappedResult, exeContext, itemType, fieldDetailsList, info, itemPath, incrementalContext, deferMap)) {
758
- containsPromise = true;
759
- }
760
- index++;
761
- iteration = iterator.next();
762
- }
763
- return containsPromise
764
- ? Promise.all(completedResults).then((resolved) => ({
765
- rawResult: resolved,
766
- incrementalDataRecords: graphqlWrappedResult.incrementalDataRecords,
767
- }))
768
- : graphqlWrappedResult;
769
- }
770
- /**
771
- * Complete a list item value by adding it to the completed results.
772
- *
773
- * Returns true if the value is a Promise.
774
- */
775
- function completeListItemValue(item, completedResults, parent, exeContext, itemType, fieldDetailsList, info, itemPath, incrementalContext, deferMap) {
776
- try {
777
- const completedItem = completeValue(exeContext, itemType, fieldDetailsList, info, itemPath, item, incrementalContext, deferMap);
778
- if (isPromise(completedItem)) {
779
- // Note: we don't rely on a `catch` method, but we do expect "thenable"
780
- // to take a second callback for the error case.
781
- completedResults.push(completedItem.then((resolved) => {
782
- addIncrementalDataRecords(parent, resolved.incrementalDataRecords);
783
- return resolved.rawResult;
784
- }, (rawError) => {
785
- handleFieldError(rawError, exeContext, itemType, fieldDetailsList, itemPath, incrementalContext);
786
- return null;
787
- }));
788
- return true;
789
- }
790
- completedResults.push(completedItem.rawResult);
791
- addIncrementalDataRecords(parent, completedItem.incrementalDataRecords);
792
- }
793
- catch (rawError) {
794
- handleFieldError(rawError, exeContext, itemType, fieldDetailsList, itemPath, incrementalContext);
795
- completedResults.push(null);
796
- }
797
- return false;
798
- }
799
- async function completePromisedListItemValue(item, parent, exeContext, itemType, fieldDetailsList, info, itemPath, incrementalContext, deferMap) {
800
- try {
801
- const abortSignalListener = exeContext.abortSignalListener;
802
- const maybeCancellableItem = abortSignalListener
803
- ? cancellablePromise(item, abortSignalListener)
804
- : item;
805
- const resolved = await maybeCancellableItem;
806
- let completed = completeValue(exeContext, itemType, fieldDetailsList, info, itemPath, resolved, incrementalContext, deferMap);
807
- if (isPromise(completed)) {
808
- completed = await completed;
809
- }
810
- addIncrementalDataRecords(parent, completed.incrementalDataRecords);
811
- return completed.rawResult;
812
- }
813
- catch (rawError) {
814
- handleFieldError(rawError, exeContext, itemType, fieldDetailsList, itemPath, incrementalContext);
815
- return null;
816
- }
817
- }
818
- /**
819
- * Complete a Scalar or Enum by serializing to a valid value, returning
820
- * null if serialization is not possible.
821
- */
822
- function completeLeafValue(returnType, result) {
823
- const coerced = returnType.coerceOutputValue(result);
824
- if (coerced == null) {
825
- throw new Error(`Expected \`${inspect(returnType)}.coerceOutputValue(${inspect(result)})\` to ` +
826
- `return non-nullable value, returned: ${inspect(coerced)}`);
827
- }
828
- return coerced;
829
- }
830
- /**
831
- * Complete a value of an abstract type by determining the runtime object type
832
- * of that value, then complete the value for that type.
833
- */
834
- function completeAbstractValue(exeContext, returnType, fieldDetailsList, info, path, result, incrementalContext, deferMap) {
835
- const validatedExecutionArgs = exeContext.validatedExecutionArgs;
836
- const { schema, contextValue } = validatedExecutionArgs;
837
- const resolveTypeFn = returnType.resolveType ?? validatedExecutionArgs.typeResolver;
838
- const runtimeType = resolveTypeFn(result, contextValue, info, returnType);
839
- if (isPromise(runtimeType)) {
840
- return runtimeType.then((resolvedRuntimeType) => completeObjectValue(exeContext, ensureValidRuntimeType(resolvedRuntimeType, schema, returnType, fieldDetailsList, info, result), fieldDetailsList, info, path, result, incrementalContext, deferMap));
841
- }
842
- return completeObjectValue(exeContext, ensureValidRuntimeType(runtimeType, schema, returnType, fieldDetailsList, info, result), fieldDetailsList, info, path, result, incrementalContext, deferMap);
843
- }
844
- function ensureValidRuntimeType(runtimeTypeName, schema, returnType, fieldDetailsList, info, result) {
845
- if (runtimeTypeName == null) {
846
- throw new GraphQLError(`Abstract type "${returnType}" must resolve to an Object type at runtime for field "${info.parentType}.${info.fieldName}". Either the "${returnType}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`, { nodes: toNodes(fieldDetailsList) });
847
- }
848
- if (typeof runtimeTypeName !== 'string') {
849
- throw new GraphQLError(`Abstract type "${returnType}" must resolve to an Object type at runtime for field "${info.parentType}.${info.fieldName}" with ` +
850
- `value ${inspect(result)}, received "${inspect(runtimeTypeName)}", which is not a valid Object type name.`);
851
- }
852
- const runtimeType = schema.getType(runtimeTypeName);
853
- if (runtimeType == null) {
854
- throw new GraphQLError(`Abstract type "${returnType}" was resolved to a type "${runtimeTypeName}" that does not exist inside the schema.`, { nodes: toNodes(fieldDetailsList) });
855
- }
856
- if (!isObjectType(runtimeType)) {
857
- throw new GraphQLError(`Abstract type "${returnType}" was resolved to a non-object type "${runtimeTypeName}".`, { nodes: toNodes(fieldDetailsList) });
858
- }
859
- if (!schema.isSubType(returnType, runtimeType)) {
860
- throw new GraphQLError(`Runtime Object type "${runtimeType}" is not a possible type for "${returnType}".`, { nodes: toNodes(fieldDetailsList) });
861
- }
862
- return runtimeType;
863
- }
864
- /**
865
- * Complete an Object value by executing all sub-selections.
866
- */
867
- function completeObjectValue(exeContext, returnType, fieldDetailsList, info, path, result, incrementalContext, deferMap) {
868
- if ((incrementalContext ?? exeContext).completed) {
869
- throw new Error('Completed, aborting.');
870
- }
871
- // If there is an isTypeOf predicate function, call it with the
872
- // current result. If isTypeOf returns false, then raise an error rather
873
- // than continuing execution.
874
- if (returnType.isTypeOf) {
875
- const isTypeOf = returnType.isTypeOf(result, exeContext.validatedExecutionArgs.contextValue, info);
876
- if (isPromise(isTypeOf)) {
877
- return isTypeOf.then((resolvedIsTypeOf) => {
878
- if (!resolvedIsTypeOf) {
879
- throw invalidReturnTypeError(returnType, result, fieldDetailsList);
880
- }
881
- return collectAndExecuteSubfields(exeContext, returnType, fieldDetailsList, path, result, incrementalContext, deferMap);
882
- });
883
- }
884
- if (!isTypeOf) {
885
- throw invalidReturnTypeError(returnType, result, fieldDetailsList);
886
- }
887
- }
888
- return collectAndExecuteSubfields(exeContext, returnType, fieldDetailsList, path, result, incrementalContext, deferMap);
889
- }
890
- function invalidReturnTypeError(returnType, result, fieldDetailsList) {
891
- return new GraphQLError(`Expected value of type "${returnType}" but got: ${inspect(result)}.`, { nodes: toNodes(fieldDetailsList) });
892
- }
893
- /**
894
- * Instantiates new DeferredFragmentRecords for the given path within an
895
- * incremental data record, returning an updated map of DeferUsage
896
- * objects to DeferredFragmentRecords.
897
- *
898
- * Note: As defer directives may be used with operations returning lists,
899
- * a DeferUsage object may correspond to many DeferredFragmentRecords.
900
- */
901
- function getNewDeferMap(newDeferUsages, deferMap, path) {
902
- const newDeferMap = new Map(deferMap);
903
- // For each new deferUsage object:
904
- for (const newDeferUsage of newDeferUsages) {
905
- const parentDeferUsage = newDeferUsage.parentDeferUsage;
906
- const parent = parentDeferUsage === undefined
907
- ? undefined
908
- : deferredFragmentRecordFromDeferUsage(parentDeferUsage, newDeferMap);
909
- // Instantiate the new record.
910
- const deferredFragmentRecord = new DeferredFragmentRecord(path, newDeferUsage.label, parent);
911
- // Update the map.
912
- newDeferMap.set(newDeferUsage, deferredFragmentRecord);
913
- }
914
- return newDeferMap;
915
290
  }
916
- function deferredFragmentRecordFromDeferUsage(deferUsage, deferMap) {
917
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
918
- return deferMap.get(deferUsage);
919
- }
920
- function collectAndExecuteSubfields(exeContext, returnType, fieldDetailsList, path, result, incrementalContext, deferMap) {
921
- const validatedExecutionArgs = exeContext.validatedExecutionArgs;
922
- // Collect sub-fields to execute to complete this value.
923
- const collectedSubfields = collectSubfields(validatedExecutionArgs, returnType, fieldDetailsList);
924
- const { groupedFieldSet, newDeferUsages } = collectedSubfields;
925
- if (newDeferUsages.length > 0) {
926
- (validatedExecutionArgs.operation.operation !==
927
- OperationTypeNode.SUBSCRIPTION) || invariant(false, '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.');
928
- }
929
- return executeSubExecutionPlan(exeContext, returnType, result, groupedFieldSet, newDeferUsages, path, incrementalContext, deferMap);
930
- }
931
- function executeSubExecutionPlan(exeContext, returnType, sourceValue, originalGroupedFieldSet, newDeferUsages, path, incrementalContext, deferMap) {
932
- if (deferMap === undefined && newDeferUsages.length === 0) {
933
- return executeFields(exeContext, returnType, sourceValue, path, originalGroupedFieldSet, incrementalContext, deferMap);
934
- }
935
- const newDeferMap = getNewDeferMap(newDeferUsages, deferMap, path);
936
- const { groupedFieldSet, newGroupedFieldSets } = buildSubExecutionPlan(originalGroupedFieldSet, incrementalContext?.deferUsageSet);
937
- const graphqlWrappedResult = executeFields(exeContext, returnType, sourceValue, path, groupedFieldSet, incrementalContext, newDeferMap);
938
- if (newGroupedFieldSets.size > 0) {
939
- const newPendingExecutionGroups = collectExecutionGroups(exeContext, returnType, sourceValue, path, incrementalContext?.deferUsageSet, newGroupedFieldSets, newDeferMap);
940
- return withNewExecutionGroups(graphqlWrappedResult, newPendingExecutionGroups);
291
+ export function validateSubscriptionArgs(args) {
292
+ const validatedExecutionArgs = validateExecutionArgs(args);
293
+ if (!('schema' in validatedExecutionArgs)) {
294
+ return validatedExecutionArgs;
941
295
  }
942
- return graphqlWrappedResult;
296
+ assertSubscriptionExecutionArgs(validatedExecutionArgs);
297
+ return validatedExecutionArgs;
943
298
  }
944
- function buildSubExecutionPlan(originalGroupedFieldSet, deferUsageSet) {
945
- let executionPlan = originalGroupedFieldSet._executionPlan;
946
- if (executionPlan !== undefined) {
947
- return executionPlan;
299
+ function assertSubscriptionExecutionArgs(validatedExecutionArgs) {
300
+ if (!isSubscriptionOperationDefinitionNode(validatedExecutionArgs.operation)) {
301
+ throw new GraphQLError('Expected subscription operation.');
948
302
  }
949
- executionPlan = buildExecutionPlan(originalGroupedFieldSet, deferUsageSet);
950
- originalGroupedFieldSet._executionPlan = executionPlan;
951
- return executionPlan;
952
303
  }
953
304
  /**
954
305
  * If a resolveType function is not given, then a default resolve behavior is
@@ -968,25 +319,34 @@ export const defaultTypeResolver = function (value, contextValue, info, abstract
968
319
  // Otherwise, test each possible type.
969
320
  const possibleTypes = info.schema.getPossibleTypes(abstractType);
970
321
  const promisedIsTypeOfResults = [];
971
- for (let i = 0; i < possibleTypes.length; i++) {
972
- const type = possibleTypes[i];
973
- if (type.isTypeOf) {
974
- const isTypeOfResult = type.isTypeOf(value, contextValue, info);
975
- if (isPromise(isTypeOfResult)) {
976
- promisedIsTypeOfResults[i] = isTypeOfResult;
977
- }
978
- else if (isTypeOfResult) {
979
- if (promisedIsTypeOfResults.length > 0) {
980
- Promise.all(promisedIsTypeOfResults).then(undefined, () => {
981
- /* ignore errors */
982
- });
322
+ try {
323
+ for (let i = 0; i < possibleTypes.length; i++) {
324
+ const type = possibleTypes[i];
325
+ if (type.isTypeOf) {
326
+ const isTypeOfResult = type.isTypeOf(value, contextValue, info);
327
+ if (isPromiseLike(isTypeOfResult)) {
328
+ promisedIsTypeOfResults[i] = isTypeOfResult;
329
+ }
330
+ else if (isTypeOfResult) {
331
+ if (promisedIsTypeOfResults.length) {
332
+ info.getAsyncHelpers().track(promisedIsTypeOfResults);
333
+ }
334
+ return type.name;
983
335
  }
984
- return type.name;
985
336
  }
986
337
  }
987
338
  }
339
+ catch (error) {
340
+ if (promisedIsTypeOfResults.length) {
341
+ info.getAsyncHelpers().track(promisedIsTypeOfResults);
342
+ }
343
+ throw error;
344
+ }
988
345
  if (promisedIsTypeOfResults.length) {
989
- return Promise.all(promisedIsTypeOfResults).then((isTypeOfResults) => {
346
+ return info
347
+ .getAsyncHelpers()
348
+ .promiseAll(promisedIsTypeOfResults)
349
+ .then((isTypeOfResults) => {
990
350
  for (let i = 0; i < isTypeOfResults.length; i++) {
991
351
  if (isTypeOfResults[i]) {
992
352
  return possibleTypes[i].name;
@@ -1001,135 +361,43 @@ export const defaultTypeResolver = function (value, contextValue, info, abstract
1001
361
  * and returns it as the result, or if it's a function, returns the result
1002
362
  * of calling that function while passing along args and context value.
1003
363
  */
1004
- export const defaultFieldResolver = function (source, args, contextValue, info, abortSignal) {
364
+ export const defaultFieldResolver = function (source, args, contextValue, info) {
1005
365
  // ensure source is a value for which property access is acceptable.
1006
366
  if (isObjectLike(source) || typeof source === 'function') {
1007
367
  const property = source[info.fieldName];
1008
368
  if (typeof property === 'function') {
1009
- return source[info.fieldName](args, contextValue, info, abortSignal);
369
+ return source[info.fieldName](args, contextValue, info);
1010
370
  }
1011
371
  return property;
1012
372
  }
1013
373
  };
1014
- /**
1015
- * Implements the "Subscribe" algorithm described in the GraphQL specification.
1016
- *
1017
- * Returns a Promise which resolves to either an AsyncIterator (if successful)
1018
- * or an ExecutionResult (error). The promise will be rejected if the schema or
1019
- * other arguments to this function are invalid, or if the resolved event stream
1020
- * is not an async iterable.
1021
- *
1022
- * If the client-provided arguments to this function do not result in a
1023
- * compliant subscription, a GraphQL Response (ExecutionResult) with descriptive
1024
- * errors and no data will be returned.
1025
- *
1026
- * If the source stream could not be created due to faulty subscription resolver
1027
- * logic or underlying systems, the promise will resolve to a single
1028
- * ExecutionResult containing `errors` and no `data`.
1029
- *
1030
- * If the operation succeeded, the promise resolves to an AsyncIterator, which
1031
- * yields a stream of ExecutionResults representing the response stream.
1032
- *
1033
- * This function does not support incremental delivery (`@defer` and `@stream`).
1034
- * If an operation which would defer or stream data is executed with this
1035
- * function, a field error will be raised at the location of the `@defer` or
1036
- * `@stream` directive.
1037
- *
1038
- * Accepts an object with named arguments.
1039
- */
1040
- export function subscribe(args) {
1041
- // If a valid execution context cannot be created due to incorrect arguments,
1042
- // a "Response" with only errors is returned.
1043
- const validatedExecutionArgs = validateExecutionArgs(args);
1044
- // Return early errors if execution context failed.
1045
- if (!('schema' in validatedExecutionArgs)) {
1046
- return { errors: validatedExecutionArgs };
1047
- }
1048
- const resultOrStream = createSourceEventStreamImpl(validatedExecutionArgs);
1049
- if (isPromise(resultOrStream)) {
1050
- return resultOrStream.then((resolvedResultOrStream) => mapSourceToResponse(validatedExecutionArgs, resolvedResultOrStream));
1051
- }
1052
- return mapSourceToResponse(validatedExecutionArgs, resultOrStream);
1053
- }
1054
374
  function mapSourceToResponse(validatedExecutionArgs, resultOrStream) {
1055
375
  if (!isAsyncIterable(resultOrStream)) {
1056
376
  return resultOrStream;
1057
377
  }
1058
- const abortSignal = validatedExecutionArgs.abortSignal;
1059
- const abortSignalListener = abortSignal
1060
- ? new AbortSignalListener(abortSignal)
1061
- : undefined;
1062
378
  // For each payload yielded from a subscription, map it over the normal
1063
379
  // GraphQL `execute` function, with `payload` as the rootValue.
1064
380
  // This implements the "MapSourceToResponseEvent" algorithm described in
1065
381
  // the GraphQL specification..
1066
- return mapAsyncIterable(abortSignalListener
1067
- ? cancellableIterable(resultOrStream, abortSignalListener)
1068
- : resultOrStream, (payload) => {
382
+ function mapFn(payload) {
1069
383
  const perEventExecutionArgs = {
1070
384
  ...validatedExecutionArgs,
1071
385
  rootValue: payload,
1072
386
  };
1073
387
  return validatedExecutionArgs.perEventExecutor(perEventExecutionArgs);
1074
- }, () => abortSignalListener?.disconnect());
1075
- }
1076
- export function executeSubscriptionEvent(validatedExecutionArgs) {
1077
- return executeQueryOrMutationOrSubscriptionEvent(validatedExecutionArgs);
1078
- }
1079
- /**
1080
- * Implements the "CreateSourceEventStream" algorithm described in the
1081
- * GraphQL specification, resolving the subscription source event stream.
1082
- *
1083
- * Returns a Promise which resolves to either an AsyncIterable (if successful)
1084
- * or an ExecutionResult (error). The promise will be rejected if the schema or
1085
- * other arguments to this function are invalid, or if the resolved event stream
1086
- * is not an async iterable.
1087
- *
1088
- * If the client-provided arguments to this function do not result in a
1089
- * compliant subscription, a GraphQL Response (ExecutionResult) with
1090
- * descriptive errors and no data will be returned.
1091
- *
1092
- * If the the source stream could not be created due to faulty subscription
1093
- * resolver logic or underlying systems, the promise will resolve to a single
1094
- * ExecutionResult containing `errors` and no `data`.
1095
- *
1096
- * If the operation succeeded, the promise resolves to the AsyncIterable for the
1097
- * event stream returned by the resolver.
1098
- *
1099
- * A Source Event Stream represents a sequence of events, each of which triggers
1100
- * a GraphQL execution for that event.
1101
- *
1102
- * This may be useful when hosting the stateful subscription service in a
1103
- * different process or machine than the stateless GraphQL execution engine,
1104
- * or otherwise separating these two steps. For more on this, see the
1105
- * "Supporting Subscriptions at Scale" information in the GraphQL specification.
1106
- */
1107
- export function createSourceEventStream(args) {
1108
- // If a valid execution context cannot be created due to incorrect arguments,
1109
- // a "Response" with only errors is returned.
1110
- const validatedExecutionArgs = validateExecutionArgs(args);
1111
- // Return early errors if execution context failed.
1112
- if (!('schema' in validatedExecutionArgs)) {
1113
- return { errors: validatedExecutionArgs };
1114
388
  }
1115
- return createSourceEventStreamImpl(validatedExecutionArgs);
1116
- }
1117
- function createSourceEventStreamImpl(validatedExecutionArgs) {
1118
- try {
1119
- const eventStream = executeSubscription(validatedExecutionArgs);
1120
- if (isPromise(eventStream)) {
1121
- return eventStream.then(undefined, (error) => ({
1122
- errors: [error],
1123
- }));
1124
- }
1125
- return eventStream;
1126
- }
1127
- catch (error) {
1128
- return { errors: [error] };
389
+ const externalAbortSignal = validatedExecutionArgs.externalAbortSignal;
390
+ if (externalAbortSignal) {
391
+ const generator = mapAsyncIterable(resultOrStream, mapFn);
392
+ return {
393
+ ...generator,
394
+ next: () => cancellablePromise(generator.next(), externalAbortSignal),
395
+ };
1129
396
  }
397
+ return mapAsyncIterable(resultOrStream, mapFn);
1130
398
  }
1131
399
  function executeSubscription(validatedExecutionArgs) {
1132
- const { schema, fragments, rootValue, contextValue, operation, variableValues, hideSuggestions, abortSignal, } = validatedExecutionArgs;
400
+ const { schema, fragments, rootValue, contextValue, operation, variableValues, hideSuggestions, externalAbortSignal, } = validatedExecutionArgs;
1133
401
  const rootType = schema.getSubscriptionType();
1134
402
  if (rootType == null) {
1135
403
  throw new GraphQLError('Schema is not configured to execute subscription operation.', { nodes: operation });
@@ -1137,40 +405,39 @@ function executeSubscription(validatedExecutionArgs) {
1137
405
  const { groupedFieldSet } = collectFields(schema, fragments, variableValues, rootType, operation.selectionSet, hideSuggestions);
1138
406
  const firstRootField = groupedFieldSet.entries().next().value;
1139
407
  const [responseName, fieldDetailsList] = firstRootField;
1140
- const fieldName = fieldDetailsList[0].node.name.value;
408
+ const firstFieldDetails = fieldDetailsList[0];
409
+ const firstNode = firstFieldDetails.node;
410
+ const fieldName = firstNode.name.value;
1141
411
  const fieldDef = schema.getField(rootType, fieldName);
1142
412
  const fieldNodes = fieldDetailsList.map((fieldDetails) => fieldDetails.node);
1143
413
  if (!fieldDef) {
1144
414
  throw new GraphQLError(`The subscription field "${fieldName}" is not defined.`, { nodes: fieldNodes });
1145
415
  }
416
+ const sharedExecutionContext = createSharedExecutionContext(externalAbortSignal);
1146
417
  const path = addPath(undefined, responseName, rootType.name);
1147
- const info = buildResolveInfo(validatedExecutionArgs, fieldDef, fieldNodes, rootType, path);
418
+ const info = buildResolveInfo(validatedExecutionArgs, fieldDef, fieldNodes, rootType, path, sharedExecutionContext.getAbortSignal, sharedExecutionContext.getAsyncHelpers);
1148
419
  try {
1149
420
  // Implements the "ResolveFieldEventStream" algorithm from GraphQL specification.
1150
421
  // It differs from "ResolveFieldValue" due to providing a different `resolveFn`.
1151
422
  // Build a JS object of arguments from the field.arguments AST, using the
1152
423
  // variables scope to fulfill any variable references.
1153
- const args = getArgumentValues(fieldDef, fieldNodes[0], variableValues, hideSuggestions);
424
+ const args = getArgumentValues(fieldDef, firstNode, variableValues, firstFieldDetails.fragmentVariableValues, hideSuggestions);
1154
425
  // Call the `subscribe()` resolver or the default resolver to produce an
1155
426
  // AsyncIterable yielding raw payloads.
1156
427
  const resolveFn = fieldDef.subscribe ?? validatedExecutionArgs.subscribeFieldResolver;
1157
428
  // The resolve function's optional third argument is a context value that
1158
429
  // is provided to every resolve function within an execution. It is commonly
1159
430
  // used to represent an authenticated user, or request-specific caches.
1160
- const result = resolveFn(rootValue, args, contextValue, info, abortSignal);
1161
- if (isPromise(result)) {
1162
- const abortSignalListener = abortSignal
1163
- ? new AbortSignalListener(abortSignal)
1164
- : undefined;
1165
- const promise = abortSignalListener
1166
- ? cancellablePromise(result, abortSignalListener)
1167
- : result;
1168
- return promise.then(assertEventStream).then((resolved) => {
1169
- abortSignalListener?.disconnect();
1170
- return resolved;
1171
- }, (error) => {
1172
- abortSignalListener?.disconnect();
1173
- throw locatedError(error, fieldNodes, pathToArray(path));
431
+ const result = resolveFn(rootValue, args, contextValue, info);
432
+ if (isPromiseLike(result)) {
433
+ const promisedResult = Promise.resolve(result);
434
+ const promise = externalAbortSignal
435
+ ? cancellablePromise(promisedResult, externalAbortSignal)
436
+ : promisedResult;
437
+ return promise
438
+ .then(assertEventStream)
439
+ .then(undefined, (error) => {
440
+ throw locatedError(error, toNodes(fieldDetailsList), pathToArray(path));
1174
441
  });
1175
442
  }
1176
443
  return assertEventStream(result);
@@ -1190,204 +457,31 @@ function assertEventStream(result) {
1190
457
  }
1191
458
  return result;
1192
459
  }
1193
- function collectExecutionGroups(exeContext, parentType, sourceValue, path, parentDeferUsages, newGroupedFieldSets, deferMap) {
1194
- const newPendingExecutionGroups = [];
1195
- for (const [deferUsageSet, groupedFieldSet] of newGroupedFieldSets) {
1196
- const deferredFragmentRecords = getDeferredFragmentRecords(deferUsageSet, deferMap);
1197
- const pendingExecutionGroup = {
1198
- deferredFragmentRecords,
1199
- result: undefined,
1200
- };
1201
- const executor = () => executeExecutionGroup(pendingExecutionGroup, exeContext, parentType, sourceValue, path, groupedFieldSet, {
1202
- errors: undefined,
1203
- completed: false,
1204
- deferUsageSet,
1205
- }, deferMap);
1206
- if (exeContext.validatedExecutionArgs.enableEarlyExecution) {
1207
- pendingExecutionGroup.result = new BoxedPromiseOrValue(shouldDefer(parentDeferUsages, deferUsageSet)
1208
- ? Promise.resolve().then(executor)
1209
- : executor());
1210
- }
1211
- else {
1212
- pendingExecutionGroup.result = () => new BoxedPromiseOrValue(executor());
1213
- }
1214
- newPendingExecutionGroups.push(pendingExecutionGroup);
1215
- }
1216
- return newPendingExecutionGroups;
1217
- }
1218
- function shouldDefer(parentDeferUsages, deferUsages) {
1219
- // If we have a new child defer usage, defer.
1220
- // Otherwise, this defer usage was already deferred when it was initially
1221
- // encountered, and is now in the midst of executing early, so the new
1222
- // deferred grouped fields set can be executed immediately.
1223
- return (parentDeferUsages === undefined ||
1224
- !Array.from(deferUsages).every((deferUsage) => parentDeferUsages.has(deferUsage)));
1225
- }
1226
- function executeExecutionGroup(pendingExecutionGroup, exeContext, parentType, sourceValue, path, groupedFieldSet, incrementalContext, deferMap) {
1227
- let result;
1228
- try {
1229
- result = executeFields(exeContext, parentType, sourceValue, path, groupedFieldSet, incrementalContext, deferMap);
1230
- }
1231
- catch (error) {
1232
- incrementalContext.completed = true;
1233
- return {
1234
- pendingExecutionGroup,
1235
- path: pathToArray(path),
1236
- errors: withError(incrementalContext.errors, error),
1237
- };
1238
- }
1239
- if (isPromise(result)) {
1240
- return result.then((resolved) => {
1241
- incrementalContext.completed = true;
1242
- return buildCompletedExecutionGroup(incrementalContext.errors, pendingExecutionGroup, path, resolved);
1243
- }, (error) => {
1244
- incrementalContext.completed = true;
1245
- return {
1246
- pendingExecutionGroup,
1247
- path: pathToArray(path),
1248
- errors: withError(incrementalContext.errors, error),
1249
- };
1250
- });
1251
- }
1252
- incrementalContext.completed = true;
1253
- return buildCompletedExecutionGroup(incrementalContext.errors, pendingExecutionGroup, path, result);
1254
- }
1255
- function buildCompletedExecutionGroup(errors, pendingExecutionGroup, path, result) {
1256
- const { rawResult: data, incrementalDataRecords } = result;
460
+ /**
461
+ * TODO: consider no longer exporting this function
462
+ * @internal
463
+ */
464
+ // eslint-disable-next-line max-params
465
+ export function buildResolveInfo(validatedExecutionArgs, fieldDef, fieldNodes, parentType, path, getAbortSignal, getAsyncHelpers) {
466
+ const { schema, fragmentDefinitions, rootValue, operation, variableValues } = validatedExecutionArgs;
467
+ // The resolve function's optional fourth argument is a collection of
468
+ // information about the current execution state.
1257
469
  return {
1258
- pendingExecutionGroup,
1259
- path: pathToArray(path),
1260
- result: errors === undefined ? { data } : { data, errors },
1261
- incrementalDataRecords,
1262
- };
1263
- }
1264
- function getDeferredFragmentRecords(deferUsages, deferMap) {
1265
- return Array.from(deferUsages).map((deferUsage) => deferredFragmentRecordFromDeferUsage(deferUsage, deferMap));
1266
- }
1267
- function buildSyncStreamItemQueue(initialItem, initialIndex, streamPath, iterator, exeContext, fieldDetailsList, info, itemType) {
1268
- const streamItemQueue = [];
1269
- const enableEarlyExecution = exeContext.validatedExecutionArgs.enableEarlyExecution;
1270
- const firstExecutor = () => {
1271
- const initialPath = addPath(streamPath, initialIndex, undefined);
1272
- const firstStreamItem = new BoxedPromiseOrValue(completeStreamItem(initialPath, initialItem, exeContext, { errors: undefined, completed: false }, fieldDetailsList, info, itemType));
1273
- let iteration = iterator.next();
1274
- let currentIndex = initialIndex + 1;
1275
- let currentStreamItem = firstStreamItem;
1276
- while (!iteration.done) {
1277
- // TODO: add test case for early sync termination
1278
- /* c8 ignore next 6 */
1279
- if (currentStreamItem instanceof BoxedPromiseOrValue) {
1280
- const result = currentStreamItem.value;
1281
- if (!isPromise(result) && result.errors !== undefined) {
1282
- break;
1283
- }
1284
- }
1285
- const itemPath = addPath(streamPath, currentIndex, undefined);
1286
- const value = iteration.value;
1287
- const currentExecutor = () => completeStreamItem(itemPath, value, exeContext, { errors: undefined, completed: false }, fieldDetailsList, info, itemType);
1288
- currentStreamItem = enableEarlyExecution
1289
- ? new BoxedPromiseOrValue(currentExecutor())
1290
- : () => new BoxedPromiseOrValue(currentExecutor());
1291
- streamItemQueue.push(currentStreamItem);
1292
- iteration = iterator.next();
1293
- currentIndex = initialIndex + 1;
1294
- }
1295
- streamItemQueue.push(new BoxedPromiseOrValue({}));
1296
- return firstStreamItem.value;
470
+ fieldName: fieldDef.name,
471
+ fieldNodes,
472
+ returnType: fieldDef.type,
473
+ parentType,
474
+ path,
475
+ schema,
476
+ fragments: fragmentDefinitions,
477
+ rootValue,
478
+ operation,
479
+ variableValues,
480
+ getAbortSignal,
481
+ getAsyncHelpers,
1297
482
  };
1298
- streamItemQueue.push(enableEarlyExecution
1299
- ? new BoxedPromiseOrValue(Promise.resolve().then(firstExecutor))
1300
- : () => new BoxedPromiseOrValue(firstExecutor()));
1301
- return streamItemQueue;
1302
483
  }
1303
- function buildAsyncStreamItemQueue(initialIndex, streamPath, asyncIterator, exeContext, fieldDetailsList, info, itemType) {
1304
- const streamItemQueue = [];
1305
- const executor = () => getNextAsyncStreamItemResult(streamItemQueue, streamPath, initialIndex, asyncIterator, exeContext, fieldDetailsList, info, itemType);
1306
- streamItemQueue.push(exeContext.validatedExecutionArgs.enableEarlyExecution
1307
- ? new BoxedPromiseOrValue(executor())
1308
- : () => new BoxedPromiseOrValue(executor()));
1309
- return streamItemQueue;
1310
- }
1311
- async function getNextAsyncStreamItemResult(streamItemQueue, streamPath, index, asyncIterator, exeContext, fieldDetailsList, info, itemType) {
1312
- let iteration;
1313
- try {
1314
- iteration = await asyncIterator.next();
1315
- }
1316
- catch (error) {
1317
- return {
1318
- errors: [
1319
- locatedError(error, toNodes(fieldDetailsList), pathToArray(streamPath)),
1320
- ],
1321
- };
1322
- }
1323
- if (iteration.done) {
1324
- return {};
1325
- }
1326
- const itemPath = addPath(streamPath, index, undefined);
1327
- const result = completeStreamItem(itemPath, iteration.value, exeContext, { errors: undefined, completed: false }, fieldDetailsList, info, itemType);
1328
- const executor = () => getNextAsyncStreamItemResult(streamItemQueue, streamPath, index + 1, asyncIterator, exeContext, fieldDetailsList, info, itemType);
1329
- streamItemQueue.push(exeContext.validatedExecutionArgs.enableEarlyExecution
1330
- ? new BoxedPromiseOrValue(executor())
1331
- : () => new BoxedPromiseOrValue(executor()));
1332
- return result;
1333
- }
1334
- function completeStreamItem(itemPath, item, exeContext, incrementalContext, fieldDetailsList, info, itemType) {
1335
- if (isPromise(item)) {
1336
- const abortSignalListener = exeContext.abortSignalListener;
1337
- const maybeCancellableItem = abortSignalListener
1338
- ? cancellablePromise(item, abortSignalListener)
1339
- : item;
1340
- return completePromisedValue(exeContext, itemType, fieldDetailsList, info, itemPath, maybeCancellableItem, incrementalContext, new Map()).then((resolvedItem) => {
1341
- incrementalContext.completed = true;
1342
- return buildStreamItemResult(incrementalContext.errors, resolvedItem);
1343
- }, (error) => {
1344
- incrementalContext.completed = true;
1345
- return {
1346
- errors: withError(incrementalContext.errors, error),
1347
- };
1348
- });
1349
- }
1350
- let result;
1351
- try {
1352
- try {
1353
- result = completeValue(exeContext, itemType, fieldDetailsList, info, itemPath, item, incrementalContext, new Map());
1354
- }
1355
- catch (rawError) {
1356
- handleFieldError(rawError, exeContext, itemType, fieldDetailsList, itemPath, incrementalContext);
1357
- result = { rawResult: null, incrementalDataRecords: undefined };
1358
- }
1359
- }
1360
- catch (error) {
1361
- incrementalContext.completed = true;
1362
- return {
1363
- errors: withError(incrementalContext.errors, error),
1364
- };
1365
- }
1366
- if (isPromise(result)) {
1367
- return result
1368
- .then(undefined, (rawError) => {
1369
- handleFieldError(rawError, exeContext, itemType, fieldDetailsList, itemPath, incrementalContext);
1370
- return { rawResult: null, incrementalDataRecords: undefined };
1371
- })
1372
- .then((resolvedItem) => {
1373
- incrementalContext.completed = true;
1374
- return buildStreamItemResult(incrementalContext.errors, resolvedItem);
1375
- }, (error) => {
1376
- incrementalContext.completed = true;
1377
- return {
1378
- errors: withError(incrementalContext.errors, error),
1379
- };
1380
- });
1381
- }
1382
- incrementalContext.completed = true;
1383
- return buildStreamItemResult(incrementalContext.errors, result);
1384
- }
1385
- function buildStreamItemResult(errors, result) {
1386
- const { rawResult: item, incrementalDataRecords } = result;
1387
- return {
1388
- item,
1389
- errors,
1390
- incrementalDataRecords,
1391
- };
484
+ function toNodes(fieldDetailsList) {
485
+ return fieldDetailsList.map((fieldDetails) => fieldDetails.node);
1392
486
  }
1393
487
  //# sourceMappingURL=execute.js.map