graphql 17.0.0-beta.1 → 17.0.0-beta.2

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 (1176) hide show
  1. package/__dev__/devMode.d.ts +1 -1
  2. package/__dev__/error/GraphQLError.d.ts +1 -1
  3. package/__dev__/error/ensureGraphQLError.d.ts +1 -1
  4. package/__dev__/error/index.d.ts +1 -1
  5. package/__dev__/error/locatedError.d.ts +1 -1
  6. package/__dev__/error/syntaxError.d.ts +1 -1
  7. package/__dev__/execution/AbortedGraphQLExecutionError.d.ts +1 -1
  8. package/__dev__/execution/AsyncWorkTracker.d.ts +1 -1
  9. package/__dev__/execution/ExecutionArgs.d.mts +1 -0
  10. package/__dev__/execution/ExecutionArgs.d.ts +1 -0
  11. package/__dev__/execution/ExecutionArgs.js +3 -0
  12. package/__dev__/execution/ExecutionArgs.mjs +3 -0
  13. package/__dev__/execution/Executor.d.ts +1 -1
  14. package/__dev__/execution/ExecutorThrowingOnIncremental.d.ts +1 -1
  15. package/__dev__/execution/buildResolveInfo.d.ts +1 -1
  16. package/__dev__/execution/cancellablePromise.d.ts +1 -1
  17. package/__dev__/execution/collectFields.d.ts +1 -1
  18. package/__dev__/execution/collectIteratorPromises.d.ts +1 -1
  19. package/__dev__/execution/createSharedExecutionContext.d.ts +1 -1
  20. package/__dev__/execution/execute.d.ts +1 -1
  21. package/__dev__/execution/getStreamUsage.d.ts +1 -1
  22. package/__dev__/execution/getVariableSignature.d.ts +1 -1
  23. package/__dev__/execution/hooks.d.ts +1 -1
  24. package/__dev__/execution/incremental/Computation.d.ts +1 -1
  25. package/__dev__/execution/incremental/IncrementalExecutor.d.ts +1 -1
  26. package/__dev__/execution/incremental/IncrementalPublisher.d.ts +1 -1
  27. package/__dev__/execution/incremental/Queue.d.ts +1 -1
  28. package/__dev__/execution/incremental/WorkQueue.d.ts +1 -1
  29. package/__dev__/execution/incremental/buildExecutionPlan.d.ts +1 -1
  30. package/__dev__/execution/index.d.ts +1 -1
  31. package/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.d.mts +1 -0
  32. package/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.d.ts +1 -0
  33. package/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.js +3 -0
  34. package/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.mjs +3 -0
  35. package/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.d.mts +1 -0
  36. package/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.d.ts +1 -0
  37. package/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.js +3 -0
  38. package/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.mjs +3 -0
  39. package/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.d.mts +1 -0
  40. package/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.d.ts +1 -0
  41. package/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.js +3 -0
  42. package/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.mjs +3 -0
  43. package/__dev__/execution/mapAsyncIterable.d.ts +1 -1
  44. package/__dev__/execution/returnIteratorCatchingErrors.d.ts +1 -1
  45. package/__dev__/execution/values.d.ts +1 -1
  46. package/__dev__/execution/withConcurrentAbruptClose.d.ts +1 -1
  47. package/__dev__/graphql.d.ts +1 -1
  48. package/__dev__/harness.d.ts +1 -1
  49. package/__dev__/index.d.ts +1 -1
  50. package/__dev__/jsutils/AccumulatorMap.d.ts +1 -1
  51. package/__dev__/jsutils/Maybe.d.ts +1 -1
  52. package/__dev__/jsutils/ObjMap.d.ts +1 -1
  53. package/__dev__/jsutils/Path.d.ts +1 -1
  54. package/__dev__/jsutils/PromiseOrValue.d.ts +1 -1
  55. package/__dev__/jsutils/capitalize.d.ts +1 -1
  56. package/__dev__/jsutils/devAssert.d.ts +1 -1
  57. package/__dev__/jsutils/didYouMean.d.ts +1 -1
  58. package/__dev__/jsutils/formatList.d.ts +1 -1
  59. package/__dev__/jsutils/getBySet.d.ts +1 -1
  60. package/__dev__/jsutils/groupBy.d.ts +1 -1
  61. package/__dev__/jsutils/identityFunc.d.ts +1 -1
  62. package/__dev__/jsutils/inspect.d.ts +1 -1
  63. package/__dev__/jsutils/instanceOf.d.ts +1 -1
  64. package/__dev__/jsutils/invariant.d.ts +1 -1
  65. package/__dev__/jsutils/isAsyncIterable.d.ts +1 -1
  66. package/__dev__/jsutils/isIterableObject.d.ts +1 -1
  67. package/__dev__/jsutils/isObjectLike.d.ts +1 -1
  68. package/__dev__/jsutils/isPromise.d.ts +1 -1
  69. package/__dev__/jsutils/isSameSet.d.ts +1 -1
  70. package/__dev__/jsutils/keyMap.d.ts +1 -1
  71. package/__dev__/jsutils/keyValMap.d.ts +1 -1
  72. package/__dev__/jsutils/mapValue.d.ts +1 -1
  73. package/__dev__/jsutils/memoize1.d.ts +1 -1
  74. package/__dev__/jsutils/memoize2.d.ts +1 -1
  75. package/__dev__/jsutils/memoize3.d.ts +1 -1
  76. package/__dev__/jsutils/naturalCompare.d.ts +1 -1
  77. package/__dev__/jsutils/printPathArray.d.ts +1 -1
  78. package/__dev__/jsutils/promiseForObject.d.ts +1 -1
  79. package/__dev__/jsutils/promiseReduce.d.ts +1 -1
  80. package/__dev__/jsutils/promiseWithResolvers.d.ts +1 -1
  81. package/__dev__/jsutils/suggestionList.d.ts +1 -1
  82. package/__dev__/jsutils/toError.d.ts +1 -1
  83. package/__dev__/jsutils/toObjMap.d.ts +1 -1
  84. package/__dev__/language/KindTypeMap.d.ts +1 -1
  85. package/__dev__/language/ast.d.ts +1 -1
  86. package/__dev__/language/blockString.d.ts +1 -1
  87. package/__dev__/language/characterClasses.d.ts +1 -1
  88. package/__dev__/language/directiveLocation.d.ts +1 -1
  89. package/__dev__/language/index.d.ts +1 -1
  90. package/__dev__/language/kinds.d.ts +1 -1
  91. package/__dev__/language/kinds_.d.ts +1 -1
  92. package/__dev__/language/lexer.d.ts +1 -1
  93. package/__dev__/language/location.d.ts +1 -1
  94. package/__dev__/language/parser.d.ts +1 -1
  95. package/__dev__/language/predicates.d.ts +1 -1
  96. package/__dev__/language/printLocation.d.ts +1 -1
  97. package/__dev__/language/printString.d.ts +1 -1
  98. package/__dev__/language/printer.d.ts +1 -1
  99. package/__dev__/language/schemaCoordinateLexer.d.ts +1 -1
  100. package/__dev__/language/source.d.ts +1 -1
  101. package/__dev__/language/tokenKind.d.ts +1 -1
  102. package/__dev__/language/visitor.d.ts +1 -1
  103. package/__dev__/type/assertName.d.ts +1 -1
  104. package/__dev__/type/definition.d.ts +1 -1
  105. package/__dev__/type/directives.d.ts +1 -1
  106. package/__dev__/type/index.d.ts +1 -1
  107. package/__dev__/type/introspection.d.ts +1 -1
  108. package/__dev__/type/scalars.d.ts +1 -1
  109. package/__dev__/type/schema.d.ts +1 -1
  110. package/__dev__/type/validate.d.ts +1 -1
  111. package/__dev__/utilities/TypeInfo.d.ts +1 -1
  112. package/__dev__/utilities/astFromValue.d.ts +1 -1
  113. package/__dev__/utilities/buildASTSchema.d.ts +1 -1
  114. package/__dev__/utilities/buildClientSchema.d.ts +1 -1
  115. package/__dev__/utilities/coerceInputValue.d.ts +1 -1
  116. package/__dev__/utilities/concatAST.d.ts +1 -1
  117. package/__dev__/utilities/extendSchema.d.ts +1 -1
  118. package/__dev__/utilities/findSchemaChanges.d.ts +1 -1
  119. package/__dev__/utilities/getDefaultValueAST.d.ts +1 -1
  120. package/__dev__/utilities/getIntrospectionQuery.d.ts +1 -1
  121. package/__dev__/utilities/getOperationAST.d.ts +1 -1
  122. package/__dev__/utilities/index.d.ts +1 -1
  123. package/__dev__/utilities/introspectionFromSchema.d.ts +1 -1
  124. package/__dev__/utilities/lexicographicSortSchema.d.ts +1 -1
  125. package/__dev__/utilities/mapSchemaConfig.d.ts +1 -1
  126. package/__dev__/utilities/printSchema.d.ts +1 -1
  127. package/__dev__/utilities/replaceVariables.d.ts +1 -1
  128. package/__dev__/utilities/resolveSchemaCoordinate.d.ts +1 -1
  129. package/__dev__/utilities/separateOperations.d.ts +1 -1
  130. package/__dev__/utilities/sortValueNode.d.ts +1 -1
  131. package/__dev__/utilities/stripIgnoredCharacters.d.ts +1 -1
  132. package/__dev__/utilities/typeComparators.d.ts +1 -1
  133. package/__dev__/utilities/typeFromAST.d.ts +1 -1
  134. package/__dev__/utilities/typedQueryDocumentNode.d.ts +1 -1
  135. package/__dev__/utilities/validateInputValue.d.ts +1 -1
  136. package/__dev__/utilities/valueFromAST.d.ts +1 -1
  137. package/__dev__/utilities/valueFromASTUntyped.d.ts +1 -1
  138. package/__dev__/utilities/valueToLiteral.d.ts +1 -1
  139. package/__dev__/validation/ValidationContext.d.ts +1 -1
  140. package/__dev__/validation/index.d.ts +1 -1
  141. package/__dev__/validation/rules/DeferStreamDirectiveLabelRule.d.ts +1 -1
  142. package/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.ts +1 -1
  143. package/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.ts +1 -1
  144. package/__dev__/validation/rules/ExecutableDefinitionsRule.d.ts +1 -1
  145. package/__dev__/validation/rules/FieldsOnCorrectTypeRule.d.ts +1 -1
  146. package/__dev__/validation/rules/FragmentsOnCompositeTypesRule.d.ts +1 -1
  147. package/__dev__/validation/rules/KnownArgumentNamesRule.d.ts +1 -1
  148. package/__dev__/validation/rules/KnownDirectivesRule.d.ts +1 -1
  149. package/__dev__/validation/rules/KnownFragmentNamesRule.d.ts +1 -1
  150. package/__dev__/validation/rules/KnownOperationTypesRule.d.ts +1 -1
  151. package/__dev__/validation/rules/KnownTypeNamesRule.d.ts +1 -1
  152. package/__dev__/validation/rules/LoneAnonymousOperationRule.d.ts +1 -1
  153. package/__dev__/validation/rules/LoneSchemaDefinitionRule.d.ts +1 -1
  154. package/__dev__/validation/rules/MaxIntrospectionDepthRule.d.ts +1 -1
  155. package/__dev__/validation/rules/NoFragmentCyclesRule.d.ts +1 -1
  156. package/__dev__/validation/rules/NoUndefinedVariablesRule.d.ts +1 -1
  157. package/__dev__/validation/rules/NoUnusedFragmentsRule.d.ts +1 -1
  158. package/__dev__/validation/rules/NoUnusedVariablesRule.d.ts +1 -1
  159. package/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts +1 -1
  160. package/__dev__/validation/rules/PossibleFragmentSpreadsRule.d.ts +1 -1
  161. package/__dev__/validation/rules/PossibleTypeExtensionsRule.d.ts +1 -1
  162. package/__dev__/validation/rules/ProvidedRequiredArgumentsRule.d.ts +1 -1
  163. package/__dev__/validation/rules/ScalarLeafsRule.d.ts +1 -1
  164. package/__dev__/validation/rules/SingleFieldSubscriptionsRule.d.ts +1 -1
  165. package/__dev__/validation/rules/StreamDirectiveOnListFieldRule.d.ts +1 -1
  166. package/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.d.ts +1 -1
  167. package/__dev__/validation/rules/UniqueArgumentNamesRule.d.ts +1 -1
  168. package/__dev__/validation/rules/UniqueDirectiveNamesRule.d.ts +1 -1
  169. package/__dev__/validation/rules/UniqueDirectivesPerLocationRule.d.ts +1 -1
  170. package/__dev__/validation/rules/UniqueEnumValueNamesRule.d.ts +1 -1
  171. package/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.d.ts +1 -1
  172. package/__dev__/validation/rules/UniqueFragmentNamesRule.d.ts +1 -1
  173. package/__dev__/validation/rules/UniqueInputFieldNamesRule.d.ts +1 -1
  174. package/__dev__/validation/rules/UniqueOperationNamesRule.d.ts +1 -1
  175. package/__dev__/validation/rules/UniqueOperationTypesRule.d.ts +1 -1
  176. package/__dev__/validation/rules/UniqueTypeNamesRule.d.ts +1 -1
  177. package/__dev__/validation/rules/UniqueVariableNamesRule.d.ts +1 -1
  178. package/__dev__/validation/rules/ValuesOfCorrectTypeRule.d.ts +1 -1
  179. package/__dev__/validation/rules/VariablesAreInputTypesRule.d.ts +1 -1
  180. package/__dev__/validation/rules/VariablesInAllowedPositionRule.d.ts +1 -1
  181. package/__dev__/validation/rules/custom/NoDeprecatedCustomRule.d.ts +1 -1
  182. package/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts +1 -1
  183. package/__dev__/validation/specifiedRules.d.ts +1 -1
  184. package/__dev__/validation/validate.d.ts +1 -1
  185. package/__dev__/version.d.ts +1 -1
  186. package/devMode.d.mts +29 -0
  187. package/devMode.d.ts +29 -0
  188. package/devMode.js.map +1 -1
  189. package/devMode.mjs.map +1 -1
  190. package/error/GraphQLError.d.mts +94 -10
  191. package/error/GraphQLError.d.ts +94 -10
  192. package/error/GraphQLError.js +11 -20
  193. package/error/GraphQLError.js.map +1 -1
  194. package/error/GraphQLError.mjs +11 -20
  195. package/error/GraphQLError.mjs.map +1 -1
  196. package/error/ensureGraphQLError.d.mts +2 -0
  197. package/error/ensureGraphQLError.d.ts +2 -0
  198. package/error/ensureGraphQLError.js +0 -3
  199. package/error/ensureGraphQLError.js.map +1 -1
  200. package/error/ensureGraphQLError.mjs +0 -3
  201. package/error/ensureGraphQLError.mjs.map +1 -1
  202. package/error/index.d.mts +6 -0
  203. package/error/index.d.ts +6 -0
  204. package/error/index.js.map +1 -1
  205. package/error/index.mjs.map +1 -1
  206. package/error/locatedError.d.mts +20 -0
  207. package/error/locatedError.d.ts +20 -0
  208. package/error/locatedError.js +0 -6
  209. package/error/locatedError.js.map +1 -1
  210. package/error/locatedError.mjs +0 -6
  211. package/error/locatedError.mjs.map +1 -1
  212. package/error/syntaxError.d.mts +15 -0
  213. package/error/syntaxError.d.ts +15 -0
  214. package/error/syntaxError.js +0 -4
  215. package/error/syntaxError.js.map +1 -1
  216. package/error/syntaxError.mjs +0 -4
  217. package/error/syntaxError.mjs.map +1 -1
  218. package/execution/AbortedGraphQLExecutionError.d.mts +27 -0
  219. package/execution/AbortedGraphQLExecutionError.d.ts +27 -0
  220. package/execution/AbortedGraphQLExecutionError.js.map +1 -1
  221. package/execution/AbortedGraphQLExecutionError.mjs.map +1 -1
  222. package/execution/AsyncWorkTracker.d.mts +1 -1
  223. package/execution/AsyncWorkTracker.d.ts +1 -1
  224. package/execution/AsyncWorkTracker.js +1 -5
  225. package/execution/AsyncWorkTracker.js.map +1 -1
  226. package/execution/AsyncWorkTracker.mjs +1 -5
  227. package/execution/AsyncWorkTracker.mjs.map +1 -1
  228. package/execution/ExecutionArgs.d.mts +101 -0
  229. package/execution/ExecutionArgs.d.ts +101 -0
  230. package/execution/ExecutionArgs.js +3 -0
  231. package/execution/ExecutionArgs.js.map +1 -0
  232. package/execution/ExecutionArgs.mjs +2 -0
  233. package/execution/ExecutionArgs.mjs.map +1 -0
  234. package/execution/Executor.d.mts +44 -40
  235. package/execution/Executor.d.ts +44 -40
  236. package/execution/Executor.js +2 -122
  237. package/execution/Executor.js.map +1 -1
  238. package/execution/Executor.mjs +2 -122
  239. package/execution/Executor.mjs.map +1 -1
  240. package/execution/ExecutorThrowingOnIncremental.js +0 -2
  241. package/execution/ExecutorThrowingOnIncremental.js.map +1 -1
  242. package/execution/ExecutorThrowingOnIncremental.mjs +0 -2
  243. package/execution/ExecutorThrowingOnIncremental.mjs.map +1 -1
  244. package/execution/buildResolveInfo.d.mts +2 -0
  245. package/execution/buildResolveInfo.d.ts +2 -0
  246. package/execution/buildResolveInfo.js +0 -3
  247. package/execution/buildResolveInfo.js.map +1 -1
  248. package/execution/buildResolveInfo.mjs +0 -3
  249. package/execution/buildResolveInfo.mjs.map +1 -1
  250. package/execution/cancellablePromise.d.mts +3 -0
  251. package/execution/cancellablePromise.d.ts +3 -0
  252. package/execution/cancellablePromise.js.map +1 -1
  253. package/execution/cancellablePromise.mjs.map +1 -1
  254. package/execution/collectFields.d.mts +10 -4
  255. package/execution/collectFields.d.ts +10 -4
  256. package/execution/collectFields.js +0 -41
  257. package/execution/collectFields.js.map +1 -1
  258. package/execution/collectFields.mjs +0 -41
  259. package/execution/collectFields.mjs.map +1 -1
  260. package/execution/collectIteratorPromises.d.mts +2 -0
  261. package/execution/collectIteratorPromises.d.ts +2 -0
  262. package/execution/collectIteratorPromises.js +0 -5
  263. package/execution/collectIteratorPromises.js.map +1 -1
  264. package/execution/collectIteratorPromises.mjs +0 -5
  265. package/execution/collectIteratorPromises.mjs.map +1 -1
  266. package/execution/createSharedExecutionContext.d.mts +1 -0
  267. package/execution/createSharedExecutionContext.d.ts +1 -0
  268. package/execution/createSharedExecutionContext.js.map +1 -1
  269. package/execution/createSharedExecutionContext.mjs.map +1 -1
  270. package/execution/execute.d.mts +403 -38
  271. package/execution/execute.d.ts +403 -38
  272. package/execution/execute.js +0 -161
  273. package/execution/execute.js.map +1 -1
  274. package/execution/execute.mjs +0 -161
  275. package/execution/execute.mjs.map +1 -1
  276. package/execution/getStreamUsage.d.mts +4 -1
  277. package/execution/getStreamUsage.d.ts +4 -1
  278. package/execution/getStreamUsage.js +0 -7
  279. package/execution/getStreamUsage.js.map +1 -1
  280. package/execution/getStreamUsage.mjs +0 -7
  281. package/execution/getStreamUsage.mjs.map +1 -1
  282. package/execution/getVariableSignature.d.mts +4 -1
  283. package/execution/getVariableSignature.d.ts +4 -1
  284. package/execution/getVariableSignature.js +0 -2
  285. package/execution/getVariableSignature.js.map +1 -1
  286. package/execution/getVariableSignature.mjs +0 -2
  287. package/execution/getVariableSignature.mjs.map +1 -1
  288. package/execution/hooks.d.mts +3 -7
  289. package/execution/hooks.d.ts +3 -7
  290. package/execution/hooks.js +0 -1
  291. package/execution/hooks.js.map +1 -1
  292. package/execution/hooks.mjs +0 -1
  293. package/execution/hooks.mjs.map +1 -1
  294. package/execution/incremental/Computation.d.mts +1 -1
  295. package/execution/incremental/Computation.d.ts +1 -1
  296. package/execution/incremental/Computation.js +0 -1
  297. package/execution/incremental/Computation.js.map +1 -1
  298. package/execution/incremental/Computation.mjs +0 -1
  299. package/execution/incremental/Computation.mjs.map +1 -1
  300. package/execution/incremental/IncrementalExecutor.d.mts +124 -9
  301. package/execution/incremental/IncrementalExecutor.d.ts +124 -9
  302. package/execution/incremental/IncrementalExecutor.js +1 -31
  303. package/execution/incremental/IncrementalExecutor.js.map +1 -1
  304. package/execution/incremental/IncrementalExecutor.mjs +1 -31
  305. package/execution/incremental/IncrementalExecutor.mjs.map +1 -1
  306. package/execution/incremental/IncrementalPublisher.d.mts +1 -3
  307. package/execution/incremental/IncrementalPublisher.d.ts +1 -3
  308. package/execution/incremental/IncrementalPublisher.js +0 -5
  309. package/execution/incremental/IncrementalPublisher.js.map +1 -1
  310. package/execution/incremental/IncrementalPublisher.mjs +0 -5
  311. package/execution/incremental/IncrementalPublisher.mjs.map +1 -1
  312. package/execution/incremental/Queue.js +3 -64
  313. package/execution/incremental/Queue.js.map +1 -1
  314. package/execution/incremental/Queue.mjs +2 -62
  315. package/execution/incremental/Queue.mjs.map +1 -1
  316. package/execution/incremental/WorkQueue.d.mts +8 -0
  317. package/execution/incremental/WorkQueue.d.ts +8 -0
  318. package/execution/incremental/WorkQueue.js +0 -15
  319. package/execution/incremental/WorkQueue.js.map +1 -1
  320. package/execution/incremental/WorkQueue.mjs +0 -15
  321. package/execution/incremental/WorkQueue.mjs.map +1 -1
  322. package/execution/incremental/buildExecutionPlan.d.mts +3 -0
  323. package/execution/incremental/buildExecutionPlan.d.ts +3 -0
  324. package/execution/incremental/buildExecutionPlan.js.map +1 -1
  325. package/execution/incremental/buildExecutionPlan.mjs.map +1 -1
  326. package/execution/index.d.mts +12 -3
  327. package/execution/index.d.ts +12 -3
  328. package/execution/index.js +4 -1
  329. package/execution/index.js.map +1 -1
  330. package/execution/index.mjs +1 -0
  331. package/execution/index.mjs.map +1 -1
  332. package/execution/legacyIncremental/BranchingIncrementalExecutor.d.mts +175 -0
  333. package/execution/legacyIncremental/BranchingIncrementalExecutor.d.ts +175 -0
  334. package/execution/legacyIncremental/BranchingIncrementalExecutor.js +69 -0
  335. package/execution/legacyIncremental/BranchingIncrementalExecutor.js.map +1 -0
  336. package/execution/legacyIncremental/BranchingIncrementalExecutor.mjs +65 -0
  337. package/execution/legacyIncremental/BranchingIncrementalExecutor.mjs.map +1 -0
  338. package/execution/legacyIncremental/BranchingIncrementalPublisher.d.mts +12 -0
  339. package/execution/legacyIncremental/BranchingIncrementalPublisher.d.ts +12 -0
  340. package/execution/legacyIncremental/BranchingIncrementalPublisher.js +131 -0
  341. package/execution/legacyIncremental/BranchingIncrementalPublisher.js.map +1 -0
  342. package/execution/legacyIncremental/BranchingIncrementalPublisher.mjs +127 -0
  343. package/execution/legacyIncremental/BranchingIncrementalPublisher.mjs.map +1 -0
  344. package/execution/legacyIncremental/legacyExecuteIncrementally.d.mts +165 -0
  345. package/execution/legacyIncremental/legacyExecuteIncrementally.d.ts +165 -0
  346. package/execution/legacyIncremental/legacyExecuteIncrementally.js +17 -0
  347. package/execution/legacyIncremental/legacyExecuteIncrementally.js.map +1 -0
  348. package/execution/legacyIncremental/legacyExecuteIncrementally.mjs +13 -0
  349. package/execution/legacyIncremental/legacyExecuteIncrementally.mjs.map +1 -0
  350. package/execution/mapAsyncIterable.d.mts +2 -0
  351. package/execution/mapAsyncIterable.d.ts +2 -0
  352. package/execution/mapAsyncIterable.js +0 -5
  353. package/execution/mapAsyncIterable.js.map +1 -1
  354. package/execution/mapAsyncIterable.mjs +0 -5
  355. package/execution/mapAsyncIterable.mjs.map +1 -1
  356. package/execution/returnIteratorCatchingErrors.d.mts +1 -0
  357. package/execution/returnIteratorCatchingErrors.d.ts +1 -0
  358. package/execution/returnIteratorCatchingErrors.js +0 -1
  359. package/execution/returnIteratorCatchingErrors.js.map +1 -1
  360. package/execution/returnIteratorCatchingErrors.mjs +0 -1
  361. package/execution/returnIteratorCatchingErrors.mjs.map +1 -1
  362. package/execution/values.d.mts +187 -5
  363. package/execution/values.d.ts +187 -5
  364. package/execution/values.js +14 -55
  365. package/execution/values.js.map +1 -1
  366. package/execution/values.mjs +14 -55
  367. package/execution/values.mjs.map +1 -1
  368. package/execution/withConcurrentAbruptClose.d.mts +2 -0
  369. package/execution/withConcurrentAbruptClose.d.ts +2 -0
  370. package/execution/withConcurrentAbruptClose.js +0 -14
  371. package/execution/withConcurrentAbruptClose.js.map +1 -1
  372. package/execution/withConcurrentAbruptClose.mjs +0 -14
  373. package/execution/withConcurrentAbruptClose.mjs.map +1 -1
  374. package/graphql.d.mts +192 -44
  375. package/graphql.d.ts +192 -44
  376. package/graphql.js +0 -12
  377. package/graphql.js.map +1 -1
  378. package/graphql.mjs +0 -12
  379. package/graphql.mjs.map +1 -1
  380. package/harness.d.mts +17 -0
  381. package/harness.d.ts +17 -0
  382. package/harness.js.map +1 -1
  383. package/harness.mjs.map +1 -1
  384. package/index.d.mts +26 -24
  385. package/index.d.ts +26 -24
  386. package/index.js +9 -96
  387. package/index.js.map +1 -1
  388. package/index.mjs +5 -149
  389. package/index.mjs.map +1 -1
  390. package/jsutils/AccumulatorMap.d.mts +2 -0
  391. package/jsutils/AccumulatorMap.d.ts +2 -0
  392. package/jsutils/AccumulatorMap.js +0 -4
  393. package/jsutils/AccumulatorMap.js.map +1 -1
  394. package/jsutils/AccumulatorMap.mjs +0 -4
  395. package/jsutils/AccumulatorMap.mjs.map +1 -1
  396. package/jsutils/Maybe.d.mts +5 -1
  397. package/jsutils/Maybe.d.ts +5 -1
  398. package/jsutils/Maybe.js.map +1 -1
  399. package/jsutils/Maybe.mjs.map +1 -1
  400. package/jsutils/ObjMap.d.mts +6 -0
  401. package/jsutils/ObjMap.d.ts +6 -0
  402. package/jsutils/ObjMap.js.map +1 -1
  403. package/jsutils/ObjMap.mjs.map +1 -1
  404. package/jsutils/Path.d.mts +30 -0
  405. package/jsutils/Path.d.ts +30 -0
  406. package/jsutils/Path.js +0 -6
  407. package/jsutils/Path.js.map +1 -1
  408. package/jsutils/Path.mjs +0 -6
  409. package/jsutils/Path.mjs.map +1 -1
  410. package/jsutils/PromiseOrValue.d.mts +1 -0
  411. package/jsutils/PromiseOrValue.d.ts +1 -0
  412. package/jsutils/PromiseOrValue.js.map +1 -1
  413. package/jsutils/PromiseOrValue.mjs.map +1 -1
  414. package/jsutils/capitalize.d.mts +2 -0
  415. package/jsutils/capitalize.d.ts +2 -0
  416. package/jsutils/capitalize.js +0 -3
  417. package/jsutils/capitalize.js.map +1 -1
  418. package/jsutils/capitalize.mjs +0 -3
  419. package/jsutils/capitalize.mjs.map +1 -1
  420. package/jsutils/devAssert.d.mts +1 -0
  421. package/jsutils/devAssert.d.ts +1 -0
  422. package/jsutils/devAssert.js.map +1 -1
  423. package/jsutils/devAssert.mjs.map +1 -1
  424. package/jsutils/didYouMean.d.mts +4 -1
  425. package/jsutils/didYouMean.d.ts +4 -1
  426. package/jsutils/didYouMean.js.map +1 -1
  427. package/jsutils/didYouMean.mjs.map +1 -1
  428. package/jsutils/formatList.d.mts +6 -2
  429. package/jsutils/formatList.d.ts +6 -2
  430. package/jsutils/formatList.js +0 -6
  431. package/jsutils/formatList.js.map +1 -1
  432. package/jsutils/formatList.mjs +0 -6
  433. package/jsutils/formatList.mjs.map +1 -1
  434. package/jsutils/getBySet.d.mts +1 -0
  435. package/jsutils/getBySet.d.ts +1 -0
  436. package/jsutils/getBySet.js.map +1 -1
  437. package/jsutils/getBySet.mjs.map +1 -1
  438. package/jsutils/groupBy.d.mts +2 -0
  439. package/jsutils/groupBy.d.ts +2 -0
  440. package/jsutils/groupBy.js +0 -3
  441. package/jsutils/groupBy.js.map +1 -1
  442. package/jsutils/groupBy.mjs +0 -3
  443. package/jsutils/groupBy.mjs.map +1 -1
  444. package/jsutils/identityFunc.d.mts +2 -0
  445. package/jsutils/identityFunc.d.ts +2 -0
  446. package/jsutils/identityFunc.js +0 -3
  447. package/jsutils/identityFunc.js.map +1 -1
  448. package/jsutils/identityFunc.mjs +0 -3
  449. package/jsutils/identityFunc.mjs.map +1 -1
  450. package/jsutils/inspect.d.mts +2 -0
  451. package/jsutils/inspect.d.ts +2 -0
  452. package/jsutils/inspect.js +0 -4
  453. package/jsutils/inspect.js.map +1 -1
  454. package/jsutils/inspect.mjs +0 -4
  455. package/jsutils/inspect.mjs.map +1 -1
  456. package/jsutils/instanceOf.d.mts +2 -0
  457. package/jsutils/instanceOf.d.ts +2 -0
  458. package/jsutils/instanceOf.js +1 -12
  459. package/jsutils/instanceOf.js.map +1 -1
  460. package/jsutils/instanceOf.mjs +1 -12
  461. package/jsutils/instanceOf.mjs.map +1 -1
  462. package/jsutils/invariant.d.mts +1 -0
  463. package/jsutils/invariant.d.ts +1 -0
  464. package/jsutils/invariant.js.map +1 -1
  465. package/jsutils/invariant.mjs.map +1 -1
  466. package/jsutils/isAsyncIterable.d.mts +2 -0
  467. package/jsutils/isAsyncIterable.d.ts +2 -0
  468. package/jsutils/isAsyncIterable.js +0 -4
  469. package/jsutils/isAsyncIterable.js.map +1 -1
  470. package/jsutils/isAsyncIterable.mjs +0 -4
  471. package/jsutils/isAsyncIterable.mjs.map +1 -1
  472. package/jsutils/isIterableObject.d.mts +6 -5
  473. package/jsutils/isIterableObject.d.ts +6 -5
  474. package/jsutils/isIterableObject.js +0 -17
  475. package/jsutils/isIterableObject.js.map +1 -1
  476. package/jsutils/isIterableObject.mjs +0 -17
  477. package/jsutils/isIterableObject.mjs.map +1 -1
  478. package/jsutils/isObjectLike.d.mts +2 -0
  479. package/jsutils/isObjectLike.d.ts +2 -0
  480. package/jsutils/isObjectLike.js +0 -4
  481. package/jsutils/isObjectLike.js.map +1 -1
  482. package/jsutils/isObjectLike.mjs +0 -4
  483. package/jsutils/isObjectLike.mjs.map +1 -1
  484. package/jsutils/isPromise.d.mts +3 -0
  485. package/jsutils/isPromise.d.ts +3 -0
  486. package/jsutils/isPromise.js +0 -4
  487. package/jsutils/isPromise.js.map +1 -1
  488. package/jsutils/isPromise.mjs +0 -4
  489. package/jsutils/isPromise.mjs.map +1 -1
  490. package/jsutils/isSameSet.d.mts +1 -0
  491. package/jsutils/isSameSet.d.ts +1 -0
  492. package/jsutils/isSameSet.js.map +1 -1
  493. package/jsutils/isSameSet.mjs.map +1 -1
  494. package/jsutils/keyMap.d.mts +7 -14
  495. package/jsutils/keyMap.d.ts +7 -14
  496. package/jsutils/keyMap.js +0 -27
  497. package/jsutils/keyMap.js.map +1 -1
  498. package/jsutils/keyMap.mjs +0 -27
  499. package/jsutils/keyMap.mjs.map +1 -1
  500. package/jsutils/keyValMap.d.mts +9 -6
  501. package/jsutils/keyValMap.d.ts +9 -6
  502. package/jsutils/keyValMap.js +0 -17
  503. package/jsutils/keyValMap.js.map +1 -1
  504. package/jsutils/keyValMap.mjs +0 -17
  505. package/jsutils/keyValMap.mjs.map +1 -1
  506. package/jsutils/mapValue.d.mts +2 -0
  507. package/jsutils/mapValue.d.ts +2 -0
  508. package/jsutils/mapValue.js +0 -4
  509. package/jsutils/mapValue.js.map +1 -1
  510. package/jsutils/mapValue.mjs +0 -4
  511. package/jsutils/mapValue.mjs.map +1 -1
  512. package/jsutils/memoize1.d.mts +2 -0
  513. package/jsutils/memoize1.d.ts +2 -0
  514. package/jsutils/memoize1.js +0 -3
  515. package/jsutils/memoize1.js.map +1 -1
  516. package/jsutils/memoize1.mjs +0 -3
  517. package/jsutils/memoize1.mjs.map +1 -1
  518. package/jsutils/memoize2.d.mts +2 -0
  519. package/jsutils/memoize2.d.ts +2 -0
  520. package/jsutils/memoize2.js +0 -3
  521. package/jsutils/memoize2.js.map +1 -1
  522. package/jsutils/memoize2.mjs +0 -3
  523. package/jsutils/memoize2.mjs.map +1 -1
  524. package/jsutils/memoize3.d.mts +2 -0
  525. package/jsutils/memoize3.d.ts +2 -0
  526. package/jsutils/memoize3.js +0 -3
  527. package/jsutils/memoize3.js.map +1 -1
  528. package/jsutils/memoize3.mjs +0 -3
  529. package/jsutils/memoize3.mjs.map +1 -1
  530. package/jsutils/naturalCompare.d.mts +1 -0
  531. package/jsutils/naturalCompare.d.ts +1 -0
  532. package/jsutils/naturalCompare.js +0 -7
  533. package/jsutils/naturalCompare.js.map +1 -1
  534. package/jsutils/naturalCompare.mjs +0 -7
  535. package/jsutils/naturalCompare.mjs.map +1 -1
  536. package/jsutils/printPathArray.d.mts +2 -0
  537. package/jsutils/printPathArray.d.ts +2 -0
  538. package/jsutils/printPathArray.js +0 -3
  539. package/jsutils/printPathArray.js.map +1 -1
  540. package/jsutils/printPathArray.mjs +0 -3
  541. package/jsutils/printPathArray.mjs.map +1 -1
  542. package/jsutils/promiseForObject.d.mts +2 -0
  543. package/jsutils/promiseForObject.d.ts +2 -0
  544. package/jsutils/promiseForObject.js +0 -7
  545. package/jsutils/promiseForObject.js.map +1 -1
  546. package/jsutils/promiseForObject.mjs +0 -7
  547. package/jsutils/promiseForObject.mjs.map +1 -1
  548. package/jsutils/promiseReduce.d.mts +2 -0
  549. package/jsutils/promiseReduce.d.ts +2 -0
  550. package/jsutils/promiseReduce.js +0 -7
  551. package/jsutils/promiseReduce.js.map +1 -1
  552. package/jsutils/promiseReduce.mjs +0 -7
  553. package/jsutils/promiseReduce.mjs.map +1 -1
  554. package/jsutils/promiseWithResolvers.d.mts +2 -0
  555. package/jsutils/promiseWithResolvers.d.ts +2 -0
  556. package/jsutils/promiseWithResolvers.js +0 -5
  557. package/jsutils/promiseWithResolvers.js.map +1 -1
  558. package/jsutils/promiseWithResolvers.mjs +0 -5
  559. package/jsutils/promiseWithResolvers.mjs.map +1 -1
  560. package/jsutils/suggestionList.d.mts +2 -0
  561. package/jsutils/suggestionList.d.ts +2 -0
  562. package/jsutils/suggestionList.js +1 -24
  563. package/jsutils/suggestionList.js.map +1 -1
  564. package/jsutils/suggestionList.mjs +1 -24
  565. package/jsutils/suggestionList.mjs.map +1 -1
  566. package/jsutils/toError.d.mts +2 -0
  567. package/jsutils/toError.d.ts +2 -0
  568. package/jsutils/toError.js +0 -3
  569. package/jsutils/toError.js.map +1 -1
  570. package/jsutils/toError.mjs +0 -3
  571. package/jsutils/toError.mjs.map +1 -1
  572. package/jsutils/toObjMap.d.mts +2 -0
  573. package/jsutils/toObjMap.d.ts +2 -0
  574. package/jsutils/toObjMap.js.map +1 -1
  575. package/jsutils/toObjMap.mjs.map +1 -1
  576. package/language/KindTypeMap.d.mts +1 -0
  577. package/language/KindTypeMap.d.ts +1 -0
  578. package/language/KindTypeMap.js.map +1 -1
  579. package/language/KindTypeMap.mjs.map +1 -1
  580. package/language/ast.d.mts +413 -53
  581. package/language/ast.d.ts +413 -53
  582. package/language/ast.js +0 -20
  583. package/language/ast.js.map +1 -1
  584. package/language/ast.mjs +0 -20
  585. package/language/ast.mjs.map +1 -1
  586. package/language/blockString.d.mts +1 -3
  587. package/language/blockString.d.ts +1 -3
  588. package/language/blockString.js +11 -37
  589. package/language/blockString.js.map +1 -1
  590. package/language/blockString.mjs +11 -37
  591. package/language/blockString.mjs.map +1 -1
  592. package/language/characterClasses.js +2 -45
  593. package/language/characterClasses.js.map +1 -1
  594. package/language/characterClasses.mjs +2 -45
  595. package/language/characterClasses.mjs.map +1 -1
  596. package/language/directiveLocation.d.mts +24 -5
  597. package/language/directiveLocation.d.ts +24 -5
  598. package/language/directiveLocation.js +0 -5
  599. package/language/directiveLocation.js.map +1 -1
  600. package/language/directiveLocation.mjs +0 -5
  601. package/language/directiveLocation.mjs.map +1 -1
  602. package/language/index.d.mts +6 -0
  603. package/language/index.d.ts +6 -0
  604. package/language/index.js +0 -4
  605. package/language/index.js.map +1 -1
  606. package/language/index.mjs +0 -4
  607. package/language/index.mjs.map +1 -1
  608. package/language/kinds.d.mts +3 -0
  609. package/language/kinds.d.ts +3 -0
  610. package/language/kinds.js.map +1 -1
  611. package/language/kinds.mjs.map +1 -1
  612. package/language/kinds_.d.mts +100 -12
  613. package/language/kinds_.d.ts +100 -12
  614. package/language/kinds_.js +0 -13
  615. package/language/kinds_.js.map +1 -1
  616. package/language/kinds_.mjs +0 -13
  617. package/language/kinds_.mjs.map +1 -1
  618. package/language/lexer.d.mts +48 -15
  619. package/language/lexer.d.ts +48 -15
  620. package/language/lexer.js +37 -278
  621. package/language/lexer.js.map +1 -1
  622. package/language/lexer.mjs +37 -278
  623. package/language/lexer.mjs.map +1 -1
  624. package/language/location.d.mts +16 -3
  625. package/language/location.d.ts +16 -3
  626. package/language/location.js +0 -4
  627. package/language/location.js.map +1 -1
  628. package/language/location.mjs +0 -4
  629. package/language/location.mjs.map +1 -1
  630. package/language/parser.d.mts +224 -9
  631. package/language/parser.d.ts +224 -9
  632. package/language/parser.js +0 -375
  633. package/language/parser.js.map +1 -1
  634. package/language/parser.mjs +0 -375
  635. package/language/parser.mjs.map +1 -1
  636. package/language/predicates.d.mts +181 -0
  637. package/language/predicates.d.ts +181 -0
  638. package/language/predicates.js +0 -6
  639. package/language/predicates.js.map +1 -1
  640. package/language/predicates.mjs +0 -6
  641. package/language/predicates.mjs.map +1 -1
  642. package/language/printLocation.d.mts +28 -0
  643. package/language/printLocation.d.ts +28 -0
  644. package/language/printLocation.js +0 -8
  645. package/language/printLocation.js.map +1 -1
  646. package/language/printLocation.mjs +0 -8
  647. package/language/printLocation.mjs.map +1 -1
  648. package/language/printString.d.mts +2 -0
  649. package/language/printString.d.ts +2 -0
  650. package/language/printString.js +5 -11
  651. package/language/printString.js.map +1 -1
  652. package/language/printString.mjs +5 -11
  653. package/language/printString.mjs.map +1 -1
  654. package/language/printer.d.mts +12 -0
  655. package/language/printer.d.ts +12 -0
  656. package/language/printer.js +0 -25
  657. package/language/printer.js.map +1 -1
  658. package/language/printer.mjs +0 -25
  659. package/language/printer.mjs.map +1 -1
  660. package/language/schemaCoordinateLexer.d.mts +14 -0
  661. package/language/schemaCoordinateLexer.d.ts +14 -0
  662. package/language/schemaCoordinateLexer.js +5 -35
  663. package/language/schemaCoordinateLexer.js.map +1 -1
  664. package/language/schemaCoordinateLexer.mjs +5 -35
  665. package/language/schemaCoordinateLexer.mjs.map +1 -1
  666. package/language/source.d.mts +28 -1
  667. package/language/source.d.ts +28 -1
  668. package/language/source.js +0 -12
  669. package/language/source.js.map +1 -1
  670. package/language/source.mjs +0 -12
  671. package/language/source.mjs.map +1 -1
  672. package/language/tokenKind.d.mts +5 -0
  673. package/language/tokenKind.d.ts +5 -0
  674. package/language/tokenKind.js +0 -4
  675. package/language/tokenKind.js.map +1 -1
  676. package/language/tokenKind.mjs +0 -4
  677. package/language/tokenKind.mjs.map +1 -1
  678. package/language/visitor.d.mts +182 -72
  679. package/language/visitor.d.ts +182 -72
  680. package/language/visitor.js +0 -15
  681. package/language/visitor.js.map +1 -1
  682. package/language/visitor.mjs +0 -15
  683. package/language/visitor.mjs.map +1 -1
  684. package/package.json +1 -1
  685. package/type/assertName.d.mts +18 -1
  686. package/type/assertName.d.ts +18 -1
  687. package/type/assertName.js +0 -8
  688. package/type/assertName.js.map +1 -1
  689. package/type/assertName.mjs +0 -8
  690. package/type/assertName.mjs.map +1 -1
  691. package/type/definition.d.mts +3258 -128
  692. package/type/definition.d.ts +3258 -128
  693. package/type/definition.js +5 -252
  694. package/type/definition.js.map +1 -1
  695. package/type/definition.mjs +5 -252
  696. package/type/definition.mjs.map +1 -1
  697. package/type/directives.d.mts +209 -20
  698. package/type/directives.d.ts +209 -20
  699. package/type/directives.js +0 -37
  700. package/type/directives.js.map +1 -1
  701. package/type/directives.mjs +0 -37
  702. package/type/directives.mjs.map +1 -1
  703. package/type/index.d.mts +6 -0
  704. package/type/index.d.ts +6 -0
  705. package/type/index.js +0 -23
  706. package/type/index.js.map +1 -1
  707. package/type/index.mjs +5 -48
  708. package/type/index.mjs.map +1 -1
  709. package/type/introspection.d.mts +36 -0
  710. package/type/introspection.d.ts +36 -0
  711. package/type/introspection.js +1 -6
  712. package/type/introspection.js.map +1 -1
  713. package/type/introspection.mjs +1 -6
  714. package/type/introspection.mjs.map +1 -1
  715. package/type/scalars.d.mts +29 -2
  716. package/type/scalars.d.ts +29 -2
  717. package/type/scalars.js +0 -15
  718. package/type/scalars.js.map +1 -1
  719. package/type/scalars.mjs +0 -15
  720. package/type/scalars.mjs.map +1 -1
  721. package/type/schema.d.mts +507 -31
  722. package/type/schema.d.ts +507 -31
  723. package/type/schema.js +0 -97
  724. package/type/schema.js.map +1 -1
  725. package/type/schema.mjs +0 -97
  726. package/type/schema.mjs.map +1 -1
  727. package/type/validate.d.mts +32 -3
  728. package/type/validate.d.ts +32 -3
  729. package/type/validate.js +0 -112
  730. package/type/validate.js.map +1 -1
  731. package/type/validate.mjs +0 -112
  732. package/type/validate.mjs.map +1 -1
  733. package/utilities/TypeInfo.d.mts +564 -1
  734. package/utilities/TypeInfo.d.ts +564 -1
  735. package/utilities/TypeInfo.js +1 -24
  736. package/utilities/TypeInfo.js.map +1 -1
  737. package/utilities/TypeInfo.mjs +1 -24
  738. package/utilities/TypeInfo.mjs.map +1 -1
  739. package/utilities/astFromValue.d.mts +36 -3
  740. package/utilities/astFromValue.d.ts +36 -3
  741. package/utilities/astFromValue.js +0 -42
  742. package/utilities/astFromValue.js.map +1 -1
  743. package/utilities/astFromValue.mjs +0 -42
  744. package/utilities/astFromValue.mjs.map +1 -1
  745. package/utilities/buildASTSchema.d.mts +66 -6
  746. package/utilities/buildASTSchema.d.ts +66 -6
  747. package/utilities/buildASTSchema.js +0 -21
  748. package/utilities/buildASTSchema.js.map +1 -1
  749. package/utilities/buildASTSchema.mjs +0 -21
  750. package/utilities/buildASTSchema.mjs.map +1 -1
  751. package/utilities/buildClientSchema.d.mts +17 -2
  752. package/utilities/buildClientSchema.d.ts +17 -2
  753. package/utilities/buildClientSchema.js +1 -32
  754. package/utilities/buildClientSchema.js.map +1 -1
  755. package/utilities/buildClientSchema.mjs +0 -30
  756. package/utilities/buildClientSchema.mjs.map +1 -1
  757. package/utilities/coerceInputValue.d.mts +83 -1
  758. package/utilities/coerceInputValue.d.ts +83 -1
  759. package/utilities/coerceInputValue.js +21 -50
  760. package/utilities/coerceInputValue.js.map +1 -1
  761. package/utilities/coerceInputValue.mjs +21 -50
  762. package/utilities/coerceInputValue.mjs.map +1 -1
  763. package/utilities/concatAST.d.mts +12 -0
  764. package/utilities/concatAST.d.ts +12 -0
  765. package/utilities/concatAST.js +0 -5
  766. package/utilities/concatAST.js.map +1 -1
  767. package/utilities/concatAST.mjs +0 -5
  768. package/utilities/concatAST.mjs.map +1 -1
  769. package/utilities/extendSchema.d.mts +58 -3
  770. package/utilities/extendSchema.d.ts +58 -3
  771. package/utilities/extendSchema.js +0 -60
  772. package/utilities/extendSchema.js.map +1 -1
  773. package/utilities/extendSchema.mjs +0 -60
  774. package/utilities/extendSchema.mjs.map +1 -1
  775. package/utilities/findSchemaChanges.d.mts +99 -1
  776. package/utilities/findSchemaChanges.d.ts +99 -1
  777. package/utilities/findSchemaChanges.js +3 -35
  778. package/utilities/findSchemaChanges.js.map +1 -1
  779. package/utilities/findSchemaChanges.mjs +3 -35
  780. package/utilities/findSchemaChanges.mjs.map +1 -1
  781. package/utilities/getDefaultValueAST.d.mts +1 -0
  782. package/utilities/getDefaultValueAST.d.ts +1 -0
  783. package/utilities/getDefaultValueAST.js +0 -2
  784. package/utilities/getDefaultValueAST.js.map +1 -1
  785. package/utilities/getDefaultValueAST.mjs +0 -2
  786. package/utilities/getDefaultValueAST.mjs.map +1 -1
  787. package/utilities/getIntrospectionQuery.d.mts +132 -0
  788. package/utilities/getIntrospectionQuery.d.ts +132 -0
  789. package/utilities/getIntrospectionQuery.js +0 -4
  790. package/utilities/getIntrospectionQuery.js.map +1 -1
  791. package/utilities/getIntrospectionQuery.mjs +0 -4
  792. package/utilities/getIntrospectionQuery.mjs.map +1 -1
  793. package/utilities/getOperationAST.d.mts +15 -0
  794. package/utilities/getOperationAST.d.ts +15 -0
  795. package/utilities/getOperationAST.js +0 -8
  796. package/utilities/getOperationAST.js.map +1 -1
  797. package/utilities/getOperationAST.mjs +0 -8
  798. package/utilities/getOperationAST.mjs.map +1 -1
  799. package/utilities/index.d.mts +18 -3
  800. package/utilities/index.d.ts +18 -3
  801. package/utilities/index.js +0 -27
  802. package/utilities/index.js.map +1 -1
  803. package/utilities/index.mjs +4 -37
  804. package/utilities/index.mjs.map +1 -1
  805. package/utilities/introspectionFromSchema.d.mts +54 -0
  806. package/utilities/introspectionFromSchema.d.ts +54 -0
  807. package/utilities/introspectionFromSchema.js +0 -9
  808. package/utilities/introspectionFromSchema.js.map +1 -1
  809. package/utilities/introspectionFromSchema.mjs +0 -9
  810. package/utilities/introspectionFromSchema.mjs.map +1 -1
  811. package/utilities/lexicographicSortSchema.d.mts +35 -0
  812. package/utilities/lexicographicSortSchema.d.ts +35 -0
  813. package/utilities/lexicographicSortSchema.js +0 -5
  814. package/utilities/lexicographicSortSchema.js.map +1 -1
  815. package/utilities/lexicographicSortSchema.mjs +0 -5
  816. package/utilities/lexicographicSortSchema.mjs.map +1 -1
  817. package/utilities/mapSchemaConfig.d.mts +6 -3
  818. package/utilities/mapSchemaConfig.d.ts +6 -3
  819. package/utilities/mapSchemaConfig.js +0 -10
  820. package/utilities/mapSchemaConfig.js.map +1 -1
  821. package/utilities/mapSchemaConfig.mjs +0 -10
  822. package/utilities/mapSchemaConfig.mjs.map +1 -1
  823. package/utilities/printSchema.d.mts +84 -0
  824. package/utilities/printSchema.d.ts +84 -0
  825. package/utilities/printSchema.js +0 -28
  826. package/utilities/printSchema.js.map +1 -1
  827. package/utilities/printSchema.mjs +0 -28
  828. package/utilities/printSchema.mjs.map +1 -1
  829. package/utilities/replaceVariables.d.mts +36 -0
  830. package/utilities/replaceVariables.d.ts +36 -0
  831. package/utilities/replaceVariables.js +0 -8
  832. package/utilities/replaceVariables.js.map +1 -1
  833. package/utilities/replaceVariables.mjs +0 -8
  834. package/utilities/replaceVariables.mjs.map +1 -1
  835. package/utilities/resolveSchemaCoordinate.d.mts +62 -0
  836. package/utilities/resolveSchemaCoordinate.d.ts +62 -0
  837. package/utilities/resolveSchemaCoordinate.js +0 -56
  838. package/utilities/resolveSchemaCoordinate.js.map +1 -1
  839. package/utilities/resolveSchemaCoordinate.mjs +0 -56
  840. package/utilities/resolveSchemaCoordinate.mjs.map +1 -1
  841. package/utilities/separateOperations.d.mts +30 -0
  842. package/utilities/separateOperations.d.ts +30 -0
  843. package/utilities/separateOperations.js +0 -15
  844. package/utilities/separateOperations.js.map +1 -1
  845. package/utilities/separateOperations.mjs +0 -15
  846. package/utilities/separateOperations.mjs.map +1 -1
  847. package/utilities/sortValueNode.js +0 -7
  848. package/utilities/sortValueNode.js.map +1 -1
  849. package/utilities/sortValueNode.mjs +0 -7
  850. package/utilities/sortValueNode.mjs.map +1 -1
  851. package/utilities/stripIgnoredCharacters.d.mts +13 -6
  852. package/utilities/stripIgnoredCharacters.d.ts +13 -6
  853. package/utilities/stripIgnoredCharacters.js +0 -65
  854. package/utilities/stripIgnoredCharacters.js.map +1 -1
  855. package/utilities/stripIgnoredCharacters.mjs +0 -65
  856. package/utilities/stripIgnoredCharacters.mjs.map +1 -1
  857. package/utilities/typeComparators.d.mts +84 -0
  858. package/utilities/typeComparators.d.ts +84 -0
  859. package/utilities/typeComparators.js +0 -33
  860. package/utilities/typeComparators.js.map +1 -1
  861. package/utilities/typeComparators.mjs +0 -33
  862. package/utilities/typeComparators.mjs.map +1 -1
  863. package/utilities/typeFromAST.d.mts +86 -0
  864. package/utilities/typeFromAST.d.ts +86 -0
  865. package/utilities/typeFromAST.js.map +1 -1
  866. package/utilities/typeFromAST.mjs.map +1 -1
  867. package/utilities/typedQueryDocumentNode.d.mts +4 -0
  868. package/utilities/typedQueryDocumentNode.d.ts +4 -0
  869. package/utilities/typedQueryDocumentNode.js.map +1 -1
  870. package/utilities/typedQueryDocumentNode.mjs.map +1 -1
  871. package/utilities/validateInputValue.d.mts +123 -0
  872. package/utilities/validateInputValue.d.ts +123 -0
  873. package/utilities/validateInputValue.js +0 -20
  874. package/utilities/validateInputValue.js.map +1 -1
  875. package/utilities/validateInputValue.mjs +0 -20
  876. package/utilities/validateInputValue.mjs.map +1 -1
  877. package/utilities/valueFromAST.d.mts +41 -0
  878. package/utilities/valueFromAST.d.ts +41 -0
  879. package/utilities/valueFromAST.js +13 -51
  880. package/utilities/valueFromAST.js.map +1 -1
  881. package/utilities/valueFromAST.mjs +13 -51
  882. package/utilities/valueFromAST.mjs.map +1 -1
  883. package/utilities/valueFromASTUntyped.d.mts +15 -2
  884. package/utilities/valueFromASTUntyped.d.ts +15 -2
  885. package/utilities/valueFromASTUntyped.js +0 -16
  886. package/utilities/valueFromASTUntyped.js.map +1 -1
  887. package/utilities/valueFromASTUntyped.mjs +0 -16
  888. package/utilities/valueFromASTUntyped.mjs.map +1 -1
  889. package/utilities/valueToLiteral.d.mts +30 -1
  890. package/utilities/valueToLiteral.d.ts +30 -1
  891. package/utilities/valueToLiteral.js +7 -40
  892. package/utilities/valueToLiteral.js.map +1 -1
  893. package/utilities/valueToLiteral.mjs +7 -40
  894. package/utilities/valueToLiteral.mjs.map +1 -1
  895. package/validation/ValidationContext.d.mts +490 -0
  896. package/validation/ValidationContext.d.ts +490 -0
  897. package/validation/ValidationContext.js +1 -8
  898. package/validation/ValidationContext.js.map +1 -1
  899. package/validation/ValidationContext.mjs +1 -8
  900. package/validation/ValidationContext.mjs.map +1 -1
  901. package/validation/index.d.mts +7 -0
  902. package/validation/index.d.ts +7 -0
  903. package/validation/index.js +0 -34
  904. package/validation/index.js.map +1 -1
  905. package/validation/index.mjs +0 -34
  906. package/validation/index.mjs.map +1 -1
  907. package/validation/rules/DeferStreamDirectiveLabelRule.d.mts +30 -0
  908. package/validation/rules/DeferStreamDirectiveLabelRule.d.ts +30 -0
  909. package/validation/rules/DeferStreamDirectiveLabelRule.js +0 -5
  910. package/validation/rules/DeferStreamDirectiveLabelRule.js.map +1 -1
  911. package/validation/rules/DeferStreamDirectiveLabelRule.mjs +0 -5
  912. package/validation/rules/DeferStreamDirectiveLabelRule.mjs.map +1 -1
  913. package/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.mts +28 -0
  914. package/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.ts +28 -0
  915. package/validation/rules/DeferStreamDirectiveOnRootFieldRule.js +0 -5
  916. package/validation/rules/DeferStreamDirectiveOnRootFieldRule.js.map +1 -1
  917. package/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs +0 -5
  918. package/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs.map +1 -1
  919. package/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.mts +52 -0
  920. package/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.ts +52 -0
  921. package/validation/rules/DeferStreamDirectiveOnValidOperationsRule.js +0 -5
  922. package/validation/rules/DeferStreamDirectiveOnValidOperationsRule.js.map +1 -1
  923. package/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs +0 -5
  924. package/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs.map +1 -1
  925. package/validation/rules/ExecutableDefinitionsRule.d.mts +28 -0
  926. package/validation/rules/ExecutableDefinitionsRule.d.ts +28 -0
  927. package/validation/rules/ExecutableDefinitionsRule.js +0 -8
  928. package/validation/rules/ExecutableDefinitionsRule.js.map +1 -1
  929. package/validation/rules/ExecutableDefinitionsRule.mjs +0 -8
  930. package/validation/rules/ExecutableDefinitionsRule.mjs.map +1 -1
  931. package/validation/rules/FieldsOnCorrectTypeRule.d.mts +28 -0
  932. package/validation/rules/FieldsOnCorrectTypeRule.d.ts +28 -0
  933. package/validation/rules/FieldsOnCorrectTypeRule.js +0 -27
  934. package/validation/rules/FieldsOnCorrectTypeRule.js.map +1 -1
  935. package/validation/rules/FieldsOnCorrectTypeRule.mjs +0 -27
  936. package/validation/rules/FieldsOnCorrectTypeRule.mjs.map +1 -1
  937. package/validation/rules/FragmentsOnCompositeTypesRule.d.mts +28 -0
  938. package/validation/rules/FragmentsOnCompositeTypesRule.d.ts +28 -0
  939. package/validation/rules/FragmentsOnCompositeTypesRule.js +0 -9
  940. package/validation/rules/FragmentsOnCompositeTypesRule.js.map +1 -1
  941. package/validation/rules/FragmentsOnCompositeTypesRule.mjs +0 -9
  942. package/validation/rules/FragmentsOnCompositeTypesRule.mjs.map +1 -1
  943. package/validation/rules/KnownArgumentNamesRule.d.mts +29 -3
  944. package/validation/rules/KnownArgumentNamesRule.d.ts +29 -3
  945. package/validation/rules/KnownArgumentNamesRule.js +0 -13
  946. package/validation/rules/KnownArgumentNamesRule.js.map +1 -1
  947. package/validation/rules/KnownArgumentNamesRule.mjs +0 -13
  948. package/validation/rules/KnownArgumentNamesRule.mjs.map +1 -1
  949. package/validation/rules/KnownDirectivesRule.d.mts +28 -0
  950. package/validation/rules/KnownDirectivesRule.d.ts +28 -0
  951. package/validation/rules/KnownDirectivesRule.js +0 -10
  952. package/validation/rules/KnownDirectivesRule.js.map +1 -1
  953. package/validation/rules/KnownDirectivesRule.mjs +0 -10
  954. package/validation/rules/KnownDirectivesRule.mjs.map +1 -1
  955. package/validation/rules/KnownFragmentNamesRule.d.mts +28 -0
  956. package/validation/rules/KnownFragmentNamesRule.d.ts +28 -0
  957. package/validation/rules/KnownFragmentNamesRule.js +0 -8
  958. package/validation/rules/KnownFragmentNamesRule.js.map +1 -1
  959. package/validation/rules/KnownFragmentNamesRule.mjs +0 -8
  960. package/validation/rules/KnownFragmentNamesRule.mjs.map +1 -1
  961. package/validation/rules/KnownOperationTypesRule.d.mts +20 -0
  962. package/validation/rules/KnownOperationTypesRule.d.ts +20 -0
  963. package/validation/rules/KnownOperationTypesRule.js +0 -8
  964. package/validation/rules/KnownOperationTypesRule.js.map +1 -1
  965. package/validation/rules/KnownOperationTypesRule.mjs +0 -8
  966. package/validation/rules/KnownOperationTypesRule.mjs.map +1 -1
  967. package/validation/rules/KnownTypeNamesRule.d.mts +28 -0
  968. package/validation/rules/KnownTypeNamesRule.d.ts +28 -0
  969. package/validation/rules/KnownTypeNamesRule.js +0 -8
  970. package/validation/rules/KnownTypeNamesRule.js.map +1 -1
  971. package/validation/rules/KnownTypeNamesRule.mjs +0 -8
  972. package/validation/rules/KnownTypeNamesRule.mjs.map +1 -1
  973. package/validation/rules/LoneAnonymousOperationRule.d.mts +28 -0
  974. package/validation/rules/LoneAnonymousOperationRule.d.ts +28 -0
  975. package/validation/rules/LoneAnonymousOperationRule.js +0 -8
  976. package/validation/rules/LoneAnonymousOperationRule.js.map +1 -1
  977. package/validation/rules/LoneAnonymousOperationRule.mjs +0 -8
  978. package/validation/rules/LoneAnonymousOperationRule.mjs.map +1 -1
  979. package/validation/rules/LoneSchemaDefinitionRule.d.mts +21 -0
  980. package/validation/rules/LoneSchemaDefinitionRule.d.ts +21 -0
  981. package/validation/rules/LoneSchemaDefinitionRule.js +0 -5
  982. package/validation/rules/LoneSchemaDefinitionRule.js.map +1 -1
  983. package/validation/rules/LoneSchemaDefinitionRule.mjs +0 -5
  984. package/validation/rules/LoneSchemaDefinitionRule.mjs.map +1 -1
  985. package/validation/rules/MaxIntrospectionDepthRule.d.mts +31 -0
  986. package/validation/rules/MaxIntrospectionDepthRule.d.ts +31 -0
  987. package/validation/rules/MaxIntrospectionDepthRule.js +0 -14
  988. package/validation/rules/MaxIntrospectionDepthRule.js.map +1 -1
  989. package/validation/rules/MaxIntrospectionDepthRule.mjs +0 -14
  990. package/validation/rules/MaxIntrospectionDepthRule.mjs.map +1 -1
  991. package/validation/rules/NoFragmentCyclesRule.d.mts +28 -0
  992. package/validation/rules/NoFragmentCyclesRule.d.ts +28 -0
  993. package/validation/rules/NoFragmentCyclesRule.js +0 -15
  994. package/validation/rules/NoFragmentCyclesRule.js.map +1 -1
  995. package/validation/rules/NoFragmentCyclesRule.mjs +0 -15
  996. package/validation/rules/NoFragmentCyclesRule.mjs.map +1 -1
  997. package/validation/rules/NoUndefinedVariablesRule.d.mts +28 -0
  998. package/validation/rules/NoUndefinedVariablesRule.d.ts +28 -0
  999. package/validation/rules/NoUndefinedVariablesRule.js +0 -8
  1000. package/validation/rules/NoUndefinedVariablesRule.js.map +1 -1
  1001. package/validation/rules/NoUndefinedVariablesRule.mjs +0 -8
  1002. package/validation/rules/NoUndefinedVariablesRule.mjs.map +1 -1
  1003. package/validation/rules/NoUnusedFragmentsRule.d.mts +28 -0
  1004. package/validation/rules/NoUnusedFragmentsRule.d.ts +28 -0
  1005. package/validation/rules/NoUnusedFragmentsRule.js +0 -8
  1006. package/validation/rules/NoUnusedFragmentsRule.js.map +1 -1
  1007. package/validation/rules/NoUnusedFragmentsRule.mjs +0 -8
  1008. package/validation/rules/NoUnusedFragmentsRule.mjs.map +1 -1
  1009. package/validation/rules/NoUnusedVariablesRule.d.mts +29 -0
  1010. package/validation/rules/NoUnusedVariablesRule.d.ts +29 -0
  1011. package/validation/rules/NoUnusedVariablesRule.js +0 -8
  1012. package/validation/rules/NoUnusedVariablesRule.js.map +1 -1
  1013. package/validation/rules/NoUnusedVariablesRule.mjs +0 -8
  1014. package/validation/rules/NoUnusedVariablesRule.mjs.map +1 -1
  1015. package/validation/rules/OverlappingFieldsCanBeMergedRule.d.mts +33 -0
  1016. package/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts +33 -0
  1017. package/validation/rules/OverlappingFieldsCanBeMergedRule.js +1 -175
  1018. package/validation/rules/OverlappingFieldsCanBeMergedRule.js.map +1 -1
  1019. package/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +1 -175
  1020. package/validation/rules/OverlappingFieldsCanBeMergedRule.mjs.map +1 -1
  1021. package/validation/rules/PossibleFragmentSpreadsRule.d.mts +36 -0
  1022. package/validation/rules/PossibleFragmentSpreadsRule.d.ts +36 -0
  1023. package/validation/rules/PossibleFragmentSpreadsRule.js +0 -7
  1024. package/validation/rules/PossibleFragmentSpreadsRule.js.map +1 -1
  1025. package/validation/rules/PossibleFragmentSpreadsRule.mjs +0 -7
  1026. package/validation/rules/PossibleFragmentSpreadsRule.mjs.map +1 -1
  1027. package/validation/rules/PossibleTypeExtensionsRule.d.mts +21 -0
  1028. package/validation/rules/PossibleTypeExtensionsRule.d.ts +21 -0
  1029. package/validation/rules/PossibleTypeExtensionsRule.js +0 -9
  1030. package/validation/rules/PossibleTypeExtensionsRule.js.map +1 -1
  1031. package/validation/rules/PossibleTypeExtensionsRule.mjs +0 -9
  1032. package/validation/rules/PossibleTypeExtensionsRule.mjs.map +1 -1
  1033. package/validation/rules/ProvidedRequiredArgumentsRule.d.mts +29 -3
  1034. package/validation/rules/ProvidedRequiredArgumentsRule.d.ts +29 -3
  1035. package/validation/rules/ProvidedRequiredArgumentsRule.js +0 -13
  1036. package/validation/rules/ProvidedRequiredArgumentsRule.js.map +1 -1
  1037. package/validation/rules/ProvidedRequiredArgumentsRule.mjs +0 -13
  1038. package/validation/rules/ProvidedRequiredArgumentsRule.mjs.map +1 -1
  1039. package/validation/rules/ScalarLeafsRule.d.mts +28 -0
  1040. package/validation/rules/ScalarLeafsRule.d.ts +28 -0
  1041. package/validation/rules/ScalarLeafsRule.js +0 -6
  1042. package/validation/rules/ScalarLeafsRule.js.map +1 -1
  1043. package/validation/rules/ScalarLeafsRule.mjs +0 -6
  1044. package/validation/rules/ScalarLeafsRule.mjs.map +1 -1
  1045. package/validation/rules/SingleFieldSubscriptionsRule.d.mts +34 -2
  1046. package/validation/rules/SingleFieldSubscriptionsRule.d.ts +34 -2
  1047. package/validation/rules/SingleFieldSubscriptionsRule.js +0 -9
  1048. package/validation/rules/SingleFieldSubscriptionsRule.js.map +1 -1
  1049. package/validation/rules/SingleFieldSubscriptionsRule.mjs +0 -9
  1050. package/validation/rules/SingleFieldSubscriptionsRule.mjs.map +1 -1
  1051. package/validation/rules/StreamDirectiveOnListFieldRule.d.mts +21 -0
  1052. package/validation/rules/StreamDirectiveOnListFieldRule.d.ts +21 -0
  1053. package/validation/rules/StreamDirectiveOnListFieldRule.js +0 -5
  1054. package/validation/rules/StreamDirectiveOnListFieldRule.js.map +1 -1
  1055. package/validation/rules/StreamDirectiveOnListFieldRule.mjs +0 -5
  1056. package/validation/rules/StreamDirectiveOnListFieldRule.mjs.map +1 -1
  1057. package/validation/rules/UniqueArgumentDefinitionNamesRule.d.mts +21 -0
  1058. package/validation/rules/UniqueArgumentDefinitionNamesRule.d.ts +21 -0
  1059. package/validation/rules/UniqueArgumentDefinitionNamesRule.js +0 -6
  1060. package/validation/rules/UniqueArgumentDefinitionNamesRule.js.map +1 -1
  1061. package/validation/rules/UniqueArgumentDefinitionNamesRule.mjs +0 -6
  1062. package/validation/rules/UniqueArgumentDefinitionNamesRule.mjs.map +1 -1
  1063. package/validation/rules/UniqueArgumentNamesRule.d.mts +28 -0
  1064. package/validation/rules/UniqueArgumentNamesRule.d.ts +28 -0
  1065. package/validation/rules/UniqueArgumentNamesRule.js +0 -8
  1066. package/validation/rules/UniqueArgumentNamesRule.js.map +1 -1
  1067. package/validation/rules/UniqueArgumentNamesRule.mjs +0 -8
  1068. package/validation/rules/UniqueArgumentNamesRule.mjs.map +1 -1
  1069. package/validation/rules/UniqueDirectiveNamesRule.d.mts +21 -0
  1070. package/validation/rules/UniqueDirectiveNamesRule.d.ts +21 -0
  1071. package/validation/rules/UniqueDirectiveNamesRule.js +0 -5
  1072. package/validation/rules/UniqueDirectiveNamesRule.js.map +1 -1
  1073. package/validation/rules/UniqueDirectiveNamesRule.mjs +0 -5
  1074. package/validation/rules/UniqueDirectiveNamesRule.mjs.map +1 -1
  1075. package/validation/rules/UniqueDirectivesPerLocationRule.d.mts +28 -0
  1076. package/validation/rules/UniqueDirectivesPerLocationRule.d.ts +28 -0
  1077. package/validation/rules/UniqueDirectivesPerLocationRule.js +0 -11
  1078. package/validation/rules/UniqueDirectivesPerLocationRule.js.map +1 -1
  1079. package/validation/rules/UniqueDirectivesPerLocationRule.mjs +0 -11
  1080. package/validation/rules/UniqueDirectivesPerLocationRule.mjs.map +1 -1
  1081. package/validation/rules/UniqueEnumValueNamesRule.d.mts +21 -0
  1082. package/validation/rules/UniqueEnumValueNamesRule.d.ts +21 -0
  1083. package/validation/rules/UniqueEnumValueNamesRule.js +0 -5
  1084. package/validation/rules/UniqueEnumValueNamesRule.js.map +1 -1
  1085. package/validation/rules/UniqueEnumValueNamesRule.mjs +0 -5
  1086. package/validation/rules/UniqueEnumValueNamesRule.mjs.map +1 -1
  1087. package/validation/rules/UniqueFieldDefinitionNamesRule.d.mts +21 -0
  1088. package/validation/rules/UniqueFieldDefinitionNamesRule.d.ts +21 -0
  1089. package/validation/rules/UniqueFieldDefinitionNamesRule.js +0 -5
  1090. package/validation/rules/UniqueFieldDefinitionNamesRule.js.map +1 -1
  1091. package/validation/rules/UniqueFieldDefinitionNamesRule.mjs +0 -5
  1092. package/validation/rules/UniqueFieldDefinitionNamesRule.mjs.map +1 -1
  1093. package/validation/rules/UniqueFragmentNamesRule.d.mts +28 -0
  1094. package/validation/rules/UniqueFragmentNamesRule.d.ts +28 -0
  1095. package/validation/rules/UniqueFragmentNamesRule.js +0 -7
  1096. package/validation/rules/UniqueFragmentNamesRule.js.map +1 -1
  1097. package/validation/rules/UniqueFragmentNamesRule.mjs +0 -7
  1098. package/validation/rules/UniqueFragmentNamesRule.mjs.map +1 -1
  1099. package/validation/rules/UniqueInputFieldNamesRule.d.mts +32 -0
  1100. package/validation/rules/UniqueInputFieldNamesRule.d.ts +32 -0
  1101. package/validation/rules/UniqueInputFieldNamesRule.js +0 -8
  1102. package/validation/rules/UniqueInputFieldNamesRule.js.map +1 -1
  1103. package/validation/rules/UniqueInputFieldNamesRule.mjs +0 -8
  1104. package/validation/rules/UniqueInputFieldNamesRule.mjs.map +1 -1
  1105. package/validation/rules/UniqueOperationNamesRule.d.mts +28 -0
  1106. package/validation/rules/UniqueOperationNamesRule.d.ts +28 -0
  1107. package/validation/rules/UniqueOperationNamesRule.js +0 -7
  1108. package/validation/rules/UniqueOperationNamesRule.js.map +1 -1
  1109. package/validation/rules/UniqueOperationNamesRule.mjs +0 -7
  1110. package/validation/rules/UniqueOperationNamesRule.mjs.map +1 -1
  1111. package/validation/rules/UniqueOperationTypesRule.d.mts +21 -0
  1112. package/validation/rules/UniqueOperationTypesRule.d.ts +21 -0
  1113. package/validation/rules/UniqueOperationTypesRule.js +0 -5
  1114. package/validation/rules/UniqueOperationTypesRule.js.map +1 -1
  1115. package/validation/rules/UniqueOperationTypesRule.mjs +0 -5
  1116. package/validation/rules/UniqueOperationTypesRule.mjs.map +1 -1
  1117. package/validation/rules/UniqueTypeNamesRule.d.mts +21 -0
  1118. package/validation/rules/UniqueTypeNamesRule.d.ts +21 -0
  1119. package/validation/rules/UniqueTypeNamesRule.js +0 -5
  1120. package/validation/rules/UniqueTypeNamesRule.js.map +1 -1
  1121. package/validation/rules/UniqueTypeNamesRule.mjs +0 -5
  1122. package/validation/rules/UniqueTypeNamesRule.mjs.map +1 -1
  1123. package/validation/rules/UniqueVariableNamesRule.d.mts +28 -0
  1124. package/validation/rules/UniqueVariableNamesRule.d.ts +28 -0
  1125. package/validation/rules/UniqueVariableNamesRule.js +0 -5
  1126. package/validation/rules/UniqueVariableNamesRule.js.map +1 -1
  1127. package/validation/rules/UniqueVariableNamesRule.mjs +0 -5
  1128. package/validation/rules/UniqueVariableNamesRule.mjs.map +1 -1
  1129. package/validation/rules/ValuesOfCorrectTypeRule.d.mts +28 -0
  1130. package/validation/rules/ValuesOfCorrectTypeRule.d.ts +28 -0
  1131. package/validation/rules/ValuesOfCorrectTypeRule.js +1 -21
  1132. package/validation/rules/ValuesOfCorrectTypeRule.js.map +1 -1
  1133. package/validation/rules/ValuesOfCorrectTypeRule.mjs +1 -21
  1134. package/validation/rules/ValuesOfCorrectTypeRule.mjs.map +1 -1
  1135. package/validation/rules/VariablesAreInputTypesRule.d.mts +32 -0
  1136. package/validation/rules/VariablesAreInputTypesRule.d.ts +32 -0
  1137. package/validation/rules/VariablesAreInputTypesRule.js +0 -8
  1138. package/validation/rules/VariablesAreInputTypesRule.js.map +1 -1
  1139. package/validation/rules/VariablesAreInputTypesRule.mjs +0 -8
  1140. package/validation/rules/VariablesAreInputTypesRule.mjs.map +1 -1
  1141. package/validation/rules/VariablesInAllowedPositionRule.d.mts +28 -0
  1142. package/validation/rules/VariablesInAllowedPositionRule.d.ts +28 -0
  1143. package/validation/rules/VariablesInAllowedPositionRule.js +0 -20
  1144. package/validation/rules/VariablesInAllowedPositionRule.js.map +1 -1
  1145. package/validation/rules/VariablesInAllowedPositionRule.mjs +0 -20
  1146. package/validation/rules/VariablesInAllowedPositionRule.mjs.map +1 -1
  1147. package/validation/rules/custom/NoDeprecatedCustomRule.d.mts +41 -0
  1148. package/validation/rules/custom/NoDeprecatedCustomRule.d.ts +41 -0
  1149. package/validation/rules/custom/NoDeprecatedCustomRule.js +0 -10
  1150. package/validation/rules/custom/NoDeprecatedCustomRule.js.map +1 -1
  1151. package/validation/rules/custom/NoDeprecatedCustomRule.mjs +0 -10
  1152. package/validation/rules/custom/NoDeprecatedCustomRule.mjs.map +1 -1
  1153. package/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.mts +28 -0
  1154. package/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts +28 -0
  1155. package/validation/rules/custom/NoSchemaIntrospectionCustomRule.js +0 -10
  1156. package/validation/rules/custom/NoSchemaIntrospectionCustomRule.js.map +1 -1
  1157. package/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs +0 -10
  1158. package/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs.map +1 -1
  1159. package/validation/specifiedRules.d.mts +2 -3
  1160. package/validation/specifiedRules.d.ts +2 -3
  1161. package/validation/specifiedRules.js +0 -46
  1162. package/validation/specifiedRules.js.map +1 -1
  1163. package/validation/specifiedRules.mjs +0 -46
  1164. package/validation/specifiedRules.mjs.map +1 -1
  1165. package/validation/validate.d.mts +65 -7
  1166. package/validation/validate.d.ts +65 -7
  1167. package/validation/validate.js +0 -41
  1168. package/validation/validate.js.map +1 -1
  1169. package/validation/validate.mjs +0 -41
  1170. package/validation/validate.mjs.map +1 -1
  1171. package/version.d.mts +3 -6
  1172. package/version.d.ts +3 -6
  1173. package/version.js +2 -10
  1174. package/version.js.map +1 -1
  1175. package/version.mjs +2 -10
  1176. package/version.mjs.map +1 -1
@@ -1,3 +1,4 @@
1
+ /** @category Types */
1
2
  import type { Maybe } from "../jsutils/Maybe.mjs";
2
3
  import type { ObjMap } from "../jsutils/ObjMap.mjs";
3
4
  import type { Path } from "../jsutils/Path.mjs";
@@ -7,75 +8,989 @@ import type { GraphQLVariableSignature } from "../execution/getVariableSignature
7
8
  import type { VariableValues } from "../execution/values.mjs";
8
9
  import type { GraphQLDirective } from "./directives.mjs";
9
10
  import type { GraphQLSchema } from "./schema.mjs";
11
+ /** These are all of the possible kinds of types. */
12
+ export type GraphQLType = GraphQLNamedType | GraphQLWrappingType;
10
13
  /**
11
- * These are all of the possible kinds of types.
14
+ * Returns true when the value is any GraphQL type.
15
+ * @param type - The GraphQL type to inspect.
16
+ * @returns True when the value is any GraphQL type.
17
+ * @example
18
+ * ```ts
19
+ * import { buildSchema } from 'graphql/utilities';
20
+ * import { GraphQLList, GraphQLString, isType } from 'graphql/type';
21
+ *
22
+ * const schema = buildSchema(`
23
+ * type Query {
24
+ * name: String
25
+ * }
26
+ * `);
27
+ *
28
+ * isType(GraphQLString); // => true
29
+ * isType(new GraphQLList(GraphQLString)); // => true
30
+ * isType(schema.getType('Query')); // => true
31
+ * isType('String'); // => false
32
+ * ```
12
33
  */
13
- export type GraphQLType = GraphQLNamedType | GraphQLWrappingType;
14
34
  export declare function isType(type: unknown): type is GraphQLType;
35
+ /**
36
+ * Returns the value as a GraphQL type, or throws if it is not one.
37
+ * @param type - The GraphQL type to inspect.
38
+ * @returns The value typed as a GraphQL type.
39
+ * @example
40
+ * ```ts
41
+ * import { buildSchema } from 'graphql/utilities';
42
+ * import { assertType } from 'graphql/type';
43
+ *
44
+ * const schema = buildSchema(`
45
+ * type Query {
46
+ * name: String
47
+ * }
48
+ * `);
49
+ *
50
+ * const queryType = assertType(schema.getType('Query'));
51
+ *
52
+ * queryType.toString(); // => 'Query'
53
+ * assertType('Query'); // throws an error
54
+ * ```
55
+ */
15
56
  export declare function assertType(type: unknown): GraphQLType;
16
57
  /**
17
- * There are predicates for each GraphQL schema element.
58
+ * There are predicates for each kind of GraphQL type.
59
+ * @param type - The GraphQL type to inspect.
60
+ * @returns True when the value is a GraphQLScalarType.
61
+ * @example
62
+ * ```ts
63
+ * import { buildSchema } from 'graphql/utilities';
64
+ * import { isScalarType } from 'graphql/type';
65
+ *
66
+ * const schema = buildSchema(`
67
+ * scalar DateTime
68
+ *
69
+ * type Query {
70
+ * createdAt: DateTime
71
+ * }
72
+ * `);
73
+ *
74
+ * isScalarType(schema.getType('DateTime')); // => true
75
+ * isScalarType(schema.getType('Query')); // => false
76
+ * ```
18
77
  */
19
78
  export declare function isScalarType(type: unknown): type is GraphQLScalarType;
79
+ /**
80
+ * Returns the value as a GraphQLScalarType, or throws if it is not one.
81
+ * @param type - The GraphQL type to inspect.
82
+ * @returns The value typed as a GraphQLScalarType.
83
+ * @example
84
+ * ```ts
85
+ * import { buildSchema } from 'graphql/utilities';
86
+ * import { assertScalarType } from 'graphql/type';
87
+ *
88
+ * const schema = buildSchema(`
89
+ * scalar DateTime
90
+ *
91
+ * type Query {
92
+ * createdAt: DateTime
93
+ * }
94
+ * `);
95
+ *
96
+ * const dateTimeType = assertScalarType(schema.getType('DateTime'));
97
+ *
98
+ * dateTimeType.name; // => 'DateTime'
99
+ * assertScalarType(schema.getType('Query')); // throws an error
100
+ * ```
101
+ */
20
102
  export declare function assertScalarType(type: unknown): GraphQLScalarType;
21
- declare const objectSymbol: unique symbol;
103
+ /**
104
+ * Returns true when the value is a GraphQLObjectType.
105
+ * @param type - The GraphQL type to inspect.
106
+ * @returns True when the value is a GraphQLObjectType.
107
+ * @example
108
+ * ```ts
109
+ * import { buildSchema } from 'graphql/utilities';
110
+ * import { isObjectType } from 'graphql/type';
111
+ *
112
+ * const schema = buildSchema(`
113
+ * input ReviewInput {
114
+ * stars: Int!
115
+ * }
116
+ *
117
+ * type User {
118
+ * name: String
119
+ * }
120
+ *
121
+ * type Query {
122
+ * user: User
123
+ * }
124
+ * `);
125
+ *
126
+ * isObjectType(schema.getType('User')); // => true
127
+ * isObjectType(schema.getType('ReviewInput')); // => false
128
+ * ```
129
+ */
22
130
  export declare function isObjectType(type: unknown): type is GraphQLObjectType;
131
+ /**
132
+ * Returns the value as a GraphQLObjectType, or throws if it is not one.
133
+ * @param type - The GraphQL type to inspect.
134
+ * @returns The value typed as a GraphQLObjectType.
135
+ * @example
136
+ * ```ts
137
+ * import { buildSchema } from 'graphql/utilities';
138
+ * import { assertObjectType } from 'graphql/type';
139
+ *
140
+ * const schema = buildSchema(`
141
+ * input ReviewInput {
142
+ * stars: Int!
143
+ * }
144
+ *
145
+ * type User {
146
+ * name: String
147
+ * }
148
+ *
149
+ * type Query {
150
+ * user: User
151
+ * }
152
+ * `);
153
+ *
154
+ * const userType = assertObjectType(schema.getType('User'));
155
+ *
156
+ * Object.keys(userType.getFields()); // => ['name']
157
+ * assertObjectType(schema.getType('ReviewInput')); // throws an error
158
+ * ```
159
+ */
23
160
  export declare function assertObjectType(type: unknown): GraphQLObjectType;
161
+ /**
162
+ * Returns true when the value is a resolved GraphQL field definition.
163
+ * @param field - Value to inspect.
164
+ * @returns True when the value is a GraphQLField.
165
+ * @example
166
+ * ```ts
167
+ * import { buildSchema } from 'graphql/utilities';
168
+ * import { isField } from 'graphql/type';
169
+ *
170
+ * const schema = buildSchema('type Query { greeting: String }');
171
+ * const field = schema.getQueryType().getFields().greeting;
172
+ *
173
+ * isField(field); // => true
174
+ * isField(schema.getQueryType()); // => false
175
+ * ```
176
+ */
24
177
  export declare function isField(field: unknown): field is GraphQLField;
178
+ /**
179
+ * Returns the value as a GraphQLField, or throws if it is not one.
180
+ * @param field - Value to inspect.
181
+ * @returns The value typed as a GraphQLField.
182
+ * @example
183
+ * ```ts
184
+ * import { buildSchema } from 'graphql/utilities';
185
+ * import { assertField } from 'graphql/type';
186
+ *
187
+ * const schema = buildSchema('type Query { greeting: String }');
188
+ * const field = assertField(schema.getQueryType().getFields().greeting);
189
+ *
190
+ * field.name; // => 'greeting'
191
+ * assertField(schema.getQueryType()); // throws an error
192
+ * ```
193
+ */
25
194
  export declare function assertField(field: unknown): GraphQLField;
195
+ /**
196
+ * Returns true when the value is a resolved GraphQL argument definition.
197
+ * @param arg - Value to inspect.
198
+ * @returns True when the value is a GraphQLArgument.
199
+ * @example
200
+ * ```ts
201
+ * import { buildSchema } from 'graphql/utilities';
202
+ * import { isArgument } from 'graphql/type';
203
+ *
204
+ * const schema = buildSchema('type Query { greeting(name: String): String }');
205
+ * const arg = schema.getQueryType().getFields().greeting.args[0];
206
+ *
207
+ * isArgument(arg); // => true
208
+ * isArgument(schema.getQueryType()); // => false
209
+ * ```
210
+ */
26
211
  export declare function isArgument(arg: unknown): arg is GraphQLArgument;
212
+ /**
213
+ * Returns the value as a GraphQLArgument, or throws if it is not one.
214
+ * @param arg - Value to inspect.
215
+ * @returns The value typed as a GraphQLArgument.
216
+ * @example
217
+ * ```ts
218
+ * import { buildSchema } from 'graphql/utilities';
219
+ * import { assertArgument } from 'graphql/type';
220
+ *
221
+ * const schema = buildSchema('type Query { greeting(name: String): String }');
222
+ * const arg = assertArgument(schema.getQueryType().getFields().greeting.args[0]);
223
+ *
224
+ * arg.name; // => 'name'
225
+ * assertArgument(schema.getQueryType()); // throws an error
226
+ * ```
227
+ */
27
228
  export declare function assertArgument(arg: unknown): GraphQLArgument;
229
+ /**
230
+ * Returns true when the value is a GraphQLInterfaceType.
231
+ * @param type - The GraphQL type to inspect.
232
+ * @returns True when the value is a GraphQLInterfaceType.
233
+ * @example
234
+ * ```ts
235
+ * import { buildSchema } from 'graphql/utilities';
236
+ * import { isInterfaceType } from 'graphql/type';
237
+ *
238
+ * const schema = buildSchema(`
239
+ * interface Node {
240
+ * id: ID!
241
+ * }
242
+ *
243
+ * type User implements Node {
244
+ * id: ID!
245
+ * }
246
+ *
247
+ * type Query {
248
+ * node: Node
249
+ * }
250
+ * `);
251
+ *
252
+ * isInterfaceType(schema.getType('Node')); // => true
253
+ * isInterfaceType(schema.getType('User')); // => false
254
+ * ```
255
+ */
28
256
  export declare function isInterfaceType(type: unknown): type is GraphQLInterfaceType;
257
+ /**
258
+ * Returns the value as a GraphQLInterfaceType, or throws if it is not one.
259
+ * @param type - The GraphQL type to inspect.
260
+ * @returns The value typed as a GraphQLInterfaceType.
261
+ * @example
262
+ * ```ts
263
+ * import { buildSchema } from 'graphql/utilities';
264
+ * import { assertInterfaceType } from 'graphql/type';
265
+ *
266
+ * const schema = buildSchema(`
267
+ * interface Node {
268
+ * id: ID!
269
+ * }
270
+ *
271
+ * type User implements Node {
272
+ * id: ID!
273
+ * }
274
+ *
275
+ * type Query {
276
+ * node: Node
277
+ * }
278
+ * `);
279
+ *
280
+ * const nodeType = assertInterfaceType(schema.getType('Node'));
281
+ *
282
+ * nodeType.name; // => 'Node'
283
+ * assertInterfaceType(schema.getType('User')); // throws an error
284
+ * ```
285
+ */
29
286
  export declare function assertInterfaceType(type: unknown): GraphQLInterfaceType;
287
+ /**
288
+ * Returns true when the value is a GraphQLUnionType.
289
+ * @param type - The GraphQL type to inspect.
290
+ * @returns True when the value is a GraphQLUnionType.
291
+ * @example
292
+ * ```ts
293
+ * import { buildSchema } from 'graphql/utilities';
294
+ * import { isUnionType } from 'graphql/type';
295
+ *
296
+ * const schema = buildSchema(`
297
+ * type Photo {
298
+ * url: String!
299
+ * }
300
+ *
301
+ * type Video {
302
+ * url: String!
303
+ * }
304
+ *
305
+ * union Media = Photo | Video
306
+ *
307
+ * type Query {
308
+ * media: [Media]
309
+ * }
310
+ * `);
311
+ *
312
+ * isUnionType(schema.getType('Media')); // => true
313
+ * isUnionType(schema.getType('Photo')); // => false
314
+ * ```
315
+ */
30
316
  export declare function isUnionType(type: unknown): type is GraphQLUnionType;
317
+ /**
318
+ * Returns the value as a GraphQLUnionType, or throws if it is not one.
319
+ * @param type - The GraphQL type to inspect.
320
+ * @returns The value typed as a GraphQLUnionType.
321
+ * @example
322
+ * ```ts
323
+ * import { buildSchema } from 'graphql/utilities';
324
+ * import { assertUnionType } from 'graphql/type';
325
+ *
326
+ * const schema = buildSchema(`
327
+ * type Photo {
328
+ * url: String!
329
+ * }
330
+ *
331
+ * type Video {
332
+ * url: String!
333
+ * }
334
+ *
335
+ * union Media = Photo | Video
336
+ *
337
+ * type Query {
338
+ * media: [Media]
339
+ * }
340
+ * `);
341
+ *
342
+ * const mediaType = assertUnionType(schema.getType('Media'));
343
+ *
344
+ * mediaType.getTypes().map((type) => type.name); // => ['Photo', 'Video']
345
+ * assertUnionType(schema.getType('Photo')); // throws an error
346
+ * ```
347
+ */
31
348
  export declare function assertUnionType(type: unknown): GraphQLUnionType;
349
+ /**
350
+ * Returns true when the value is a GraphQLEnumType.
351
+ * @param type - The GraphQL type to inspect.
352
+ * @returns True when the value is a GraphQLEnumType.
353
+ * @example
354
+ * ```ts
355
+ * import { buildSchema } from 'graphql/utilities';
356
+ * import { isEnumType } from 'graphql/type';
357
+ *
358
+ * const schema = buildSchema(`
359
+ * enum Episode {
360
+ * NEW_HOPE
361
+ * EMPIRE
362
+ * }
363
+ *
364
+ * type Query {
365
+ * favoriteEpisode: Episode
366
+ * }
367
+ * `);
368
+ *
369
+ * isEnumType(schema.getType('Episode')); // => true
370
+ * isEnumType(schema.getType('Query')); // => false
371
+ * ```
372
+ */
32
373
  export declare function isEnumType(type: unknown): type is GraphQLEnumType;
374
+ /**
375
+ * Returns the value as a GraphQLEnumType, or throws if it is not one.
376
+ * @param type - The GraphQL type to inspect.
377
+ * @returns The value typed as a GraphQLEnumType.
378
+ * @example
379
+ * ```ts
380
+ * import { buildSchema } from 'graphql/utilities';
381
+ * import { assertEnumType } from 'graphql/type';
382
+ *
383
+ * const schema = buildSchema(`
384
+ * enum Episode {
385
+ * NEW_HOPE
386
+ * EMPIRE
387
+ * }
388
+ *
389
+ * type Query {
390
+ * favoriteEpisode: Episode
391
+ * }
392
+ * `);
393
+ *
394
+ * const episodeType = assertEnumType(schema.getType('Episode'));
395
+ *
396
+ * episodeType.getValues().map((value) => value.name); // => ['NEW_HOPE', 'EMPIRE']
397
+ * assertEnumType(schema.getType('Query')); // throws an error
398
+ * ```
399
+ */
33
400
  export declare function assertEnumType(type: unknown): GraphQLEnumType;
401
+ /**
402
+ * Returns true when the value is a resolved GraphQL enum value definition.
403
+ * @param value - Value to inspect.
404
+ * @returns True when the value is a GraphQLEnumValue.
405
+ * @example
406
+ * ```ts
407
+ * import { buildSchema } from 'graphql/utilities';
408
+ * import { assertEnumType, isEnumValue } from 'graphql/type';
409
+ *
410
+ * const schema = buildSchema('enum Episode { NEW_HOPE } type Query { episode: Episode }');
411
+ * const enumValue = assertEnumType(schema.getType('Episode')).getValues()[0];
412
+ *
413
+ * isEnumValue(enumValue); // => true
414
+ * isEnumValue(schema.getType('Episode')); // => false
415
+ * ```
416
+ */
34
417
  export declare function isEnumValue(value: unknown): value is GraphQLEnumValue;
418
+ /**
419
+ * Returns the value as a GraphQLEnumValue, or throws if it is not one.
420
+ * @param value - Value to inspect.
421
+ * @returns The value typed as a GraphQLEnumValue.
422
+ * @example
423
+ * ```ts
424
+ * import { buildSchema } from 'graphql/utilities';
425
+ * import { assertEnumType, assertEnumValue } from 'graphql/type';
426
+ *
427
+ * const schema = buildSchema('enum Episode { NEW_HOPE } type Query { episode: Episode }');
428
+ * const enumValue = assertEnumValue(
429
+ * assertEnumType(schema.getType('Episode')).getValues()[0],
430
+ * );
431
+ *
432
+ * enumValue.name; // => 'NEW_HOPE'
433
+ * assertEnumValue(schema.getType('Episode')); // throws an error
434
+ * ```
435
+ */
35
436
  export declare function assertEnumValue(value: unknown): GraphQLEnumValue;
437
+ /**
438
+ * Returns true when the value is a GraphQLInputObjectType.
439
+ * @param type - The GraphQL type to inspect.
440
+ * @returns True when the value is a GraphQLInputObjectType.
441
+ * @example
442
+ * ```ts
443
+ * import { buildSchema } from 'graphql/utilities';
444
+ * import { isInputObjectType } from 'graphql/type';
445
+ *
446
+ * const schema = buildSchema(`
447
+ * input ReviewInput {
448
+ * stars: Int!
449
+ * }
450
+ *
451
+ * type Review {
452
+ * stars: Int!
453
+ * }
454
+ *
455
+ * type Query {
456
+ * review(input: ReviewInput): Review
457
+ * }
458
+ * `);
459
+ *
460
+ * isInputObjectType(schema.getType('ReviewInput')); // => true
461
+ * isInputObjectType(schema.getType('Review')); // => false
462
+ * ```
463
+ */
36
464
  export declare function isInputObjectType(type: unknown): type is GraphQLInputObjectType;
465
+ /**
466
+ * Returns the value as a GraphQLInputObjectType, or throws if it is not one.
467
+ * @param type - The GraphQL type to inspect.
468
+ * @returns The value typed as a GraphQLInputObjectType.
469
+ * @example
470
+ * ```ts
471
+ * import { buildSchema } from 'graphql/utilities';
472
+ * import { assertInputObjectType } from 'graphql/type';
473
+ *
474
+ * const schema = buildSchema(`
475
+ * input ReviewInput {
476
+ * stars: Int!
477
+ * }
478
+ *
479
+ * type Review {
480
+ * stars: Int!
481
+ * }
482
+ *
483
+ * type Query {
484
+ * review(input: ReviewInput): Review
485
+ * }
486
+ * `);
487
+ *
488
+ * const inputType = assertInputObjectType(schema.getType('ReviewInput'));
489
+ *
490
+ * Object.keys(inputType.getFields()); // => ['stars']
491
+ * assertInputObjectType(schema.getType('Review')); // throws an error
492
+ * ```
493
+ */
37
494
  export declare function assertInputObjectType(type: unknown): GraphQLInputObjectType;
495
+ /**
496
+ * Returns true when the value is a resolved GraphQL input field definition.
497
+ * @param field - Value to inspect.
498
+ * @returns True when the value is a GraphQLInputField.
499
+ * @example
500
+ * ```ts
501
+ * import { buildSchema } from 'graphql/utilities';
502
+ * import { assertInputObjectType, isInputField } from 'graphql/type';
503
+ *
504
+ * const schema = buildSchema('input ReviewInput { stars: Int } type Query { ok: Boolean }');
505
+ * const inputField = assertInputObjectType(schema.getType('ReviewInput')).getFields().stars;
506
+ *
507
+ * isInputField(inputField); // => true
508
+ * isInputField(schema.getQueryType()); // => false
509
+ * ```
510
+ */
38
511
  export declare function isInputField(field: unknown): field is GraphQLInputField;
512
+ /**
513
+ * Returns the value as a GraphQLInputField, or throws if it is not one.
514
+ * @param field - Value to inspect.
515
+ * @returns The value typed as a GraphQLInputField.
516
+ * @example
517
+ * ```ts
518
+ * import { buildSchema } from 'graphql/utilities';
519
+ * import { assertInputField, assertInputObjectType } from 'graphql/type';
520
+ *
521
+ * const schema = buildSchema('input ReviewInput { stars: Int } type Query { ok: Boolean }');
522
+ * const inputField = assertInputField(
523
+ * assertInputObjectType(schema.getType('ReviewInput')).getFields().stars,
524
+ * );
525
+ *
526
+ * inputField.name; // => 'stars'
527
+ * assertInputField(schema.getQueryType()); // throws an error
528
+ * ```
529
+ */
39
530
  export declare function assertInputField(field: unknown): GraphQLInputField;
531
+ /**
532
+ * Returns true when the value is a GraphQLList.
533
+ * @param type - The GraphQL type to inspect.
534
+ * @returns True when the value is a GraphQLList.
535
+ * @example
536
+ * ```ts
537
+ * import { buildSchema } from 'graphql/utilities';
538
+ * import { GraphQLList, GraphQLString, isListType } from 'graphql/type';
539
+ *
540
+ * const schema = buildSchema(`
541
+ * type Query {
542
+ * tags: [String!]!
543
+ * }
544
+ * `);
545
+ *
546
+ * const tagsField = schema.getQueryType()?.getFields().tags;
547
+ *
548
+ * isListType(new GraphQLList(GraphQLString)); // => true
549
+ * isListType(GraphQLString); // => false
550
+ * isListType(tagsField?.type); // => false
551
+ * ```
552
+ */
40
553
  export declare function isListType(type: GraphQLInputType): type is GraphQLList<GraphQLInputType>;
554
+ /**
555
+ * Returns true when the output type is a GraphQLList.
556
+ * @param type - The GraphQL output type to inspect.
557
+ * @returns True when the output type is a list type.
558
+ * @example
559
+ * ```ts
560
+ * import { buildSchema } from 'graphql/utilities';
561
+ * import { getNullableType, isListType } from 'graphql/type';
562
+ *
563
+ * const schema = buildSchema(`
564
+ * type Query {
565
+ * tags: [String!]!
566
+ * }
567
+ * `);
568
+ *
569
+ * const tagsField = schema.getQueryType()?.getFields().tags;
570
+ * const nullableTagsType = getNullableType(tagsField?.type);
571
+ *
572
+ * isListType(nullableTagsType); // => true
573
+ * ```
574
+ */
41
575
  export declare function isListType(type: GraphQLOutputType): type is GraphQLList<GraphQLOutputType>;
576
+ /**
577
+ * Returns true when the value is a GraphQLList.
578
+ * @param type - The value to inspect.
579
+ * @returns True when the value is a list type.
580
+ * @example
581
+ * ```ts
582
+ * import { isListType } from 'graphql/type';
583
+ *
584
+ * isListType('[String]'); // => false
585
+ * isListType(null); // => false
586
+ * ```
587
+ */
42
588
  export declare function isListType(type: unknown): type is GraphQLList<GraphQLType>;
589
+ /**
590
+ * Returns the value as a GraphQLList, or throws if it is not one.
591
+ * @param type - The GraphQL type to inspect.
592
+ * @returns The value typed as a GraphQLList.
593
+ * @example
594
+ * ```ts
595
+ * import { GraphQLList, GraphQLString, assertListType } from 'graphql/type';
596
+ *
597
+ * const listType = assertListType(new GraphQLList(GraphQLString));
598
+ *
599
+ * listType.ofType; // => GraphQLString
600
+ * assertListType(GraphQLString); // throws an error
601
+ * ```
602
+ */
43
603
  export declare function assertListType(type: unknown): GraphQLList<GraphQLType>;
604
+ /**
605
+ * Returns true when the value is a GraphQLNonNull.
606
+ * @param type - The GraphQL type to inspect.
607
+ * @returns True when the value is a GraphQLNonNull.
608
+ * @example
609
+ * ```ts
610
+ * import { buildSchema } from 'graphql/utilities';
611
+ * import { GraphQLNonNull, GraphQLString, isNonNullType } from 'graphql/type';
612
+ *
613
+ * const schema = buildSchema(`
614
+ * type Query {
615
+ * name: String!
616
+ * nickname: String
617
+ * }
618
+ * `);
619
+ *
620
+ * const fields = schema.getQueryType()?.getFields();
621
+ *
622
+ * isNonNullType(new GraphQLNonNull(GraphQLString)); // => true
623
+ * isNonNullType(fields?.name.type); // => true
624
+ * isNonNullType(fields?.nickname.type); // => false
625
+ * ```
626
+ */
44
627
  export declare function isNonNullType(type: GraphQLInputType): type is GraphQLNonNull<GraphQLNullableInputType>;
628
+ /**
629
+ * Returns true when the output type is a GraphQLNonNull.
630
+ * @param type - The GraphQL output type to inspect.
631
+ * @returns True when the output type is a non-null type.
632
+ * @example
633
+ * ```ts
634
+ * import { buildSchema } from 'graphql/utilities';
635
+ * import { isNonNullType } from 'graphql/type';
636
+ *
637
+ * const schema = buildSchema(`
638
+ * type Query {
639
+ * name: String!
640
+ * nickname: String
641
+ * }
642
+ * `);
643
+ *
644
+ * const fields = schema.getQueryType()?.getFields();
645
+ *
646
+ * isNonNullType(fields?.name.type); // => true
647
+ * isNonNullType(fields?.nickname.type); // => false
648
+ * ```
649
+ */
45
650
  export declare function isNonNullType(type: GraphQLOutputType): type is GraphQLNonNull<GraphQLNullableOutputType>;
651
+ /**
652
+ * Returns true when the value is a GraphQLNonNull.
653
+ * @param type - The value to inspect.
654
+ * @returns True when the value is a non-null type.
655
+ * @example
656
+ * ```ts
657
+ * import { isNonNullType } from 'graphql/type';
658
+ *
659
+ * isNonNullType('String!'); // => false
660
+ * isNonNullType(null); // => false
661
+ * ```
662
+ */
46
663
  export declare function isNonNullType(type: unknown): type is GraphQLNonNull<GraphQLNullableType>;
47
- export declare function assertNonNullType(type: unknown): GraphQLNonNull<GraphQLNullableType>;
48
664
  /**
49
- * These types may be used as input types for arguments and directives.
665
+ * Returns the value as a GraphQLNonNull, or throws if it is not one.
666
+ * @param type - The GraphQL type to inspect.
667
+ * @returns The value typed as a GraphQLNonNull.
668
+ * @example
669
+ * ```ts
670
+ * import { GraphQLNonNull, GraphQLString, assertNonNullType } from 'graphql/type';
671
+ *
672
+ * const nonNullType = assertNonNullType(new GraphQLNonNull(GraphQLString));
673
+ *
674
+ * nonNullType.ofType; // => GraphQLString
675
+ * assertNonNullType(GraphQLString); // throws an error
676
+ * ```
50
677
  */
678
+ export declare function assertNonNullType(type: unknown): GraphQLNonNull<GraphQLNullableType>;
679
+ /** These types may be used as input types for arguments and directives. */
51
680
  export type GraphQLNullableInputType = GraphQLNamedInputType | GraphQLList<GraphQLInputType>;
681
+ /** These types may be used as input types for arguments and directives. */
52
682
  export type GraphQLInputType = GraphQLNullableInputType | GraphQLNonNull<GraphQLNullableInputType>;
683
+ /**
684
+ * Returns true when the value can be used as a GraphQL input type.
685
+ * @param type - The GraphQL type to inspect.
686
+ * @returns True when the value can be used as a GraphQL input type.
687
+ * @example
688
+ * ```ts
689
+ * import { buildSchema } from 'graphql/utilities';
690
+ * import { isInputType } from 'graphql/type';
691
+ *
692
+ * const schema = buildSchema(`
693
+ * input ReviewInput {
694
+ * stars: Int!
695
+ * }
696
+ *
697
+ * type Review {
698
+ * stars: Int!
699
+ * }
700
+ *
701
+ * type Query {
702
+ * review(input: ReviewInput): Review
703
+ * }
704
+ * `);
705
+ *
706
+ * isInputType(schema.getType('ReviewInput')); // => true
707
+ * isInputType(schema.getType('Review')); // => false
708
+ * ```
709
+ */
53
710
  export declare function isInputType(type: unknown): type is GraphQLInputType;
54
- export declare function assertInputType(type: unknown): GraphQLInputType;
55
711
  /**
56
- * These types may be used as output types as the result of fields.
712
+ * Returns the value as a GraphQL input type, or throws if it is not one.
713
+ * @param type - The GraphQL type to inspect.
714
+ * @returns The value typed as a GraphQL input type.
715
+ * @example
716
+ * ```ts
717
+ * import { buildSchema } from 'graphql/utilities';
718
+ * import { assertInputType } from 'graphql/type';
719
+ *
720
+ * const schema = buildSchema(`
721
+ * input ReviewInput {
722
+ * stars: Int!
723
+ * }
724
+ *
725
+ * type Review {
726
+ * stars: Int!
727
+ * }
728
+ *
729
+ * type Query {
730
+ * review(input: ReviewInput): Review
731
+ * }
732
+ * `);
733
+ *
734
+ * const inputType = assertInputType(schema.getType('ReviewInput'));
735
+ *
736
+ * inputType.toString(); // => 'ReviewInput'
737
+ * assertInputType(schema.getType('Review')); // throws an error
738
+ * ```
57
739
  */
740
+ export declare function assertInputType(type: unknown): GraphQLInputType;
741
+ /** These types may be used as output types as the result of fields. */
58
742
  export type GraphQLNullableOutputType = GraphQLNamedOutputType | GraphQLList<GraphQLOutputType>;
743
+ /** These types may be used as output types as the result of fields. */
59
744
  export type GraphQLOutputType = GraphQLNullableOutputType | GraphQLNonNull<GraphQLNullableOutputType>;
745
+ /**
746
+ * Returns true when the value can be used as a GraphQL output type.
747
+ * @param type - The GraphQL type to inspect.
748
+ * @returns True when the value can be used as a GraphQL output type.
749
+ * @example
750
+ * ```ts
751
+ * import { buildSchema } from 'graphql/utilities';
752
+ * import { isOutputType } from 'graphql/type';
753
+ *
754
+ * const schema = buildSchema(`
755
+ * input ReviewInput {
756
+ * stars: Int!
757
+ * }
758
+ *
759
+ * type Review {
760
+ * stars: Int!
761
+ * }
762
+ *
763
+ * type Query {
764
+ * review(input: ReviewInput): Review
765
+ * }
766
+ * `);
767
+ *
768
+ * isOutputType(schema.getType('Review')); // => true
769
+ * isOutputType(schema.getType('ReviewInput')); // => false
770
+ * ```
771
+ */
60
772
  export declare function isOutputType(type: unknown): type is GraphQLOutputType;
61
- export declare function assertOutputType(type: unknown): GraphQLOutputType;
62
773
  /**
63
- * These types may describe types which may be leaf values.
774
+ * Returns the value as a GraphQL output type, or throws if it is not one.
775
+ * @param type - The GraphQL type to inspect.
776
+ * @returns The value typed as a GraphQL output type.
777
+ * @example
778
+ * ```ts
779
+ * import { buildSchema } from 'graphql/utilities';
780
+ * import { assertOutputType } from 'graphql/type';
781
+ *
782
+ * const schema = buildSchema(`
783
+ * input ReviewInput {
784
+ * stars: Int!
785
+ * }
786
+ *
787
+ * type Review {
788
+ * stars: Int!
789
+ * }
790
+ *
791
+ * type Query {
792
+ * review(input: ReviewInput): Review
793
+ * }
794
+ * `);
795
+ *
796
+ * const outputType = assertOutputType(schema.getType('Review'));
797
+ *
798
+ * outputType.toString(); // => 'Review'
799
+ * assertOutputType(schema.getType('ReviewInput')); // throws an error
800
+ * ```
64
801
  */
802
+ export declare function assertOutputType(type: unknown): GraphQLOutputType;
803
+ /** These types may describe types which may be leaf values. */
65
804
  export type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType;
805
+ /**
806
+ * Returns true when the value is a GraphQL scalar or enum type.
807
+ * @param type - The GraphQL type to inspect.
808
+ * @returns True when the value is a GraphQL scalar or enum type.
809
+ * @example
810
+ * ```ts
811
+ * import { buildSchema } from 'graphql/utilities';
812
+ * import { isLeafType } from 'graphql/type';
813
+ *
814
+ * const schema = buildSchema(`
815
+ * enum Episode {
816
+ * NEW_HOPE
817
+ * }
818
+ *
819
+ * type Review {
820
+ * stars: Int!
821
+ * }
822
+ *
823
+ * type Query {
824
+ * episode: Episode
825
+ * review: Review
826
+ * }
827
+ * `);
828
+ *
829
+ * isLeafType(schema.getType('Episode')); // => true
830
+ * isLeafType(schema.getType('String')); // => true
831
+ * isLeafType(schema.getType('Review')); // => false
832
+ * ```
833
+ */
66
834
  export declare function isLeafType(type: unknown): type is GraphQLLeafType;
67
- export declare function assertLeafType(type: unknown): GraphQLLeafType;
68
835
  /**
69
- * These types may describe the parent context of a selection set.
836
+ * Returns the value as a GraphQL leaf type, or throws if it is not one.
837
+ * @param type - The GraphQL type to inspect.
838
+ * @returns The value typed as a GraphQL leaf type.
839
+ * @example
840
+ * ```ts
841
+ * import { buildSchema } from 'graphql/utilities';
842
+ * import { assertLeafType } from 'graphql/type';
843
+ *
844
+ * const schema = buildSchema(`
845
+ * enum Episode {
846
+ * NEW_HOPE
847
+ * }
848
+ *
849
+ * type Review {
850
+ * stars: Int!
851
+ * }
852
+ *
853
+ * type Query {
854
+ * episode: Episode
855
+ * review: Review
856
+ * }
857
+ * `);
858
+ *
859
+ * const episodeType = assertLeafType(schema.getType('Episode'));
860
+ *
861
+ * episodeType.toString(); // => 'Episode'
862
+ * assertLeafType(schema.getType('Review')); // throws an error
863
+ * ```
70
864
  */
865
+ export declare function assertLeafType(type: unknown): GraphQLLeafType;
866
+ /** These types may describe the parent context of a selection set. */
71
867
  export type GraphQLCompositeType = GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType;
868
+ /**
869
+ * Returns true when the value is a GraphQL object, interface, or union type.
870
+ * @param type - The GraphQL type to inspect.
871
+ * @returns True when the value is a GraphQL object, interface, or union type.
872
+ * @example
873
+ * ```ts
874
+ * import { buildSchema } from 'graphql/utilities';
875
+ * import { isCompositeType } from 'graphql/type';
876
+ *
877
+ * const schema = buildSchema(`
878
+ * interface Node {
879
+ * id: ID!
880
+ * }
881
+ *
882
+ * type User implements Node {
883
+ * id: ID!
884
+ * }
885
+ *
886
+ * union SearchResult = User
887
+ *
888
+ * type Query {
889
+ * node: Node
890
+ * search: [SearchResult]
891
+ * }
892
+ * `);
893
+ *
894
+ * isCompositeType(schema.getType('User')); // => true
895
+ * isCompositeType(schema.getType('Node')); // => true
896
+ * isCompositeType(schema.getType('SearchResult')); // => true
897
+ * isCompositeType(schema.getType('String')); // => false
898
+ * ```
899
+ */
72
900
  export declare function isCompositeType(type: unknown): type is GraphQLCompositeType;
73
- export declare function assertCompositeType(type: unknown): GraphQLCompositeType;
74
901
  /**
75
- * These types may describe the parent context of a selection set.
902
+ * Returns the value as a GraphQL composite type, or throws if it is not one.
903
+ * @param type - The GraphQL type to inspect.
904
+ * @returns The value typed as a GraphQL composite type.
905
+ * @example
906
+ * ```ts
907
+ * import { buildSchema } from 'graphql/utilities';
908
+ * import { assertCompositeType } from 'graphql/type';
909
+ *
910
+ * const schema = buildSchema(`
911
+ * interface Node {
912
+ * id: ID!
913
+ * }
914
+ *
915
+ * type User implements Node {
916
+ * id: ID!
917
+ * }
918
+ *
919
+ * type Query {
920
+ * node: Node
921
+ * }
922
+ * `);
923
+ *
924
+ * const userType = assertCompositeType(schema.getType('User'));
925
+ *
926
+ * userType.toString(); // => 'User'
927
+ * assertCompositeType(schema.getType('String')); // throws an error
928
+ * ```
76
929
  */
930
+ export declare function assertCompositeType(type: unknown): GraphQLCompositeType;
931
+ /** These types may describe the parent context of a selection set. */
77
932
  export type GraphQLAbstractType = GraphQLInterfaceType | GraphQLUnionType;
933
+ /**
934
+ * Returns true when the value is a GraphQL interface or union type.
935
+ * @param type - The GraphQL type to inspect.
936
+ * @returns True when the value is a GraphQL interface or union type.
937
+ * @example
938
+ * ```ts
939
+ * import { buildSchema } from 'graphql/utilities';
940
+ * import { isAbstractType } from 'graphql/type';
941
+ *
942
+ * const schema = buildSchema(`
943
+ * interface Node {
944
+ * id: ID!
945
+ * }
946
+ *
947
+ * type User implements Node {
948
+ * id: ID!
949
+ * }
950
+ *
951
+ * union SearchResult = User
952
+ *
953
+ * type Query {
954
+ * node: Node
955
+ * search: [SearchResult]
956
+ * }
957
+ * `);
958
+ *
959
+ * isAbstractType(schema.getType('Node')); // => true
960
+ * isAbstractType(schema.getType('SearchResult')); // => true
961
+ * isAbstractType(schema.getType('User')); // => false
962
+ * ```
963
+ */
78
964
  export declare function isAbstractType(type: unknown): type is GraphQLAbstractType;
965
+ /**
966
+ * Returns the value as a GraphQL abstract type, or throws if it is not one.
967
+ * @param type - The GraphQL type to inspect.
968
+ * @returns The value typed as a GraphQL abstract type.
969
+ * @example
970
+ * ```ts
971
+ * import { buildSchema } from 'graphql/utilities';
972
+ * import { assertAbstractType } from 'graphql/type';
973
+ *
974
+ * const schema = buildSchema(`
975
+ * interface Node {
976
+ * id: ID!
977
+ * }
978
+ *
979
+ * type User implements Node {
980
+ * id: ID!
981
+ * }
982
+ *
983
+ * type Query {
984
+ * node: Node
985
+ * }
986
+ * `);
987
+ *
988
+ * const nodeType = assertAbstractType(schema.getType('Node'));
989
+ *
990
+ * nodeType.toString(); // => 'Node'
991
+ * assertAbstractType(schema.getType('User')); // throws an error
992
+ * ```
993
+ */
79
994
  export declare function assertAbstractType(type: unknown): GraphQLAbstractType;
80
995
  /**
81
996
  * List Type Wrapper
@@ -83,9 +998,8 @@ export declare function assertAbstractType(type: unknown): GraphQLAbstractType;
83
998
  * A list is a wrapping type which points to another type.
84
999
  * Lists are often created within the context of defining the fields of
85
1000
  * an object type.
86
- *
87
- * Example:
88
- *
1001
+ * @typeParam T - The GraphQL type wrapped by this list type.
1002
+ * @example
89
1003
  * ```ts
90
1004
  * const PersonType = new GraphQLObjectType({
91
1005
  * name: 'Person',
@@ -97,11 +1011,56 @@ export declare function assertAbstractType(type: unknown): GraphQLAbstractType;
97
1011
  * ```
98
1012
  */
99
1013
  export declare class GraphQLList<T extends GraphQLType> implements GraphQLSchemaElement {
100
- readonly __kind: symbol;
1014
+ /** The type wrapped by this list or non-null type. */
101
1015
  readonly ofType: T;
1016
+ private readonly __GraphQLListTypeBrand;
1017
+ /**
1018
+ * Creates a GraphQLList instance.
1019
+ * @param ofType - The type to wrap.
1020
+ * @example
1021
+ * ```ts
1022
+ * import { GraphQLList, GraphQLString } from 'graphql/type';
1023
+ *
1024
+ * const stringList = new GraphQLList(GraphQLString);
1025
+ *
1026
+ * stringList.ofType; // => GraphQLString
1027
+ * String(stringList); // => '[String]'
1028
+ * ```
1029
+ */
102
1030
  constructor(ofType: T);
1031
+ /**
1032
+ * Returns the value used by `Object.prototype.toString`.
1033
+ * @returns The built-in string tag for this object.
1034
+ */
103
1035
  get [Symbol.toStringTag](): string;
1036
+ /**
1037
+ * Returns this wrapping type as a GraphQL type-reference string.
1038
+ * @returns The GraphQL type-reference string.
1039
+ * @example
1040
+ * ```ts
1041
+ * import { GraphQLList, GraphQLNonNull, GraphQLString } from 'graphql/type';
1042
+ *
1043
+ * const stringList = new GraphQLList(GraphQLString);
1044
+ * const requiredStringList = new GraphQLList(new GraphQLNonNull(GraphQLString));
1045
+ *
1046
+ * stringList.toString(); // => '[String]'
1047
+ * requiredStringList.toString(); // => '[String!]'
1048
+ * ```
1049
+ */
104
1050
  toString(): string;
1051
+ /**
1052
+ * Returns the JSON representation used when this object is serialized.
1053
+ * @returns The JSON-serializable representation.
1054
+ * @example
1055
+ * ```ts
1056
+ * import { GraphQLList, GraphQLString } from 'graphql/type';
1057
+ *
1058
+ * const stringList = new GraphQLList(GraphQLString);
1059
+ *
1060
+ * stringList.toJSON(); // => '[String]'
1061
+ * JSON.stringify({ type: stringList }); // => '{"type":"[String]"}'
1062
+ * ```
1063
+ */
105
1064
  toJSON(): string;
106
1065
  }
107
1066
  /**
@@ -112,9 +1071,8 @@ export declare class GraphQLList<T extends GraphQLType> implements GraphQLSchema
112
1071
  * an error is raised if this ever occurs during a request. It is useful for
113
1072
  * fields which you can make a strong guarantee on non-nullability, for example
114
1073
  * usually the id field of a database row will never be null.
115
- *
116
- * Example:
117
- *
1074
+ * @typeParam T - The nullable GraphQL type wrapped by this non-null type.
1075
+ * @example
118
1076
  * ```ts
119
1077
  * const RowType = new GraphQLObjectType({
120
1078
  * name: 'Row',
@@ -123,46 +1081,332 @@ export declare class GraphQLList<T extends GraphQLType> implements GraphQLSchema
123
1081
  * })
124
1082
  * })
125
1083
  * ```
1084
+ *
126
1085
  * Note: the enforcement of non-nullability occurs within the executor.
127
1086
  */
128
1087
  export declare class GraphQLNonNull<T extends GraphQLNullableType> implements GraphQLSchemaElement {
129
- readonly __kind: symbol;
1088
+ /** The type wrapped by this list or non-null type. */
130
1089
  readonly ofType: T;
1090
+ private readonly __GraphQLNonNullTypeBrand;
1091
+ /**
1092
+ * Creates a GraphQLNonNull instance.
1093
+ * @param ofType - The type to wrap.
1094
+ * @example
1095
+ * ```ts
1096
+ * import { GraphQLNonNull, GraphQLString } from 'graphql/type';
1097
+ *
1098
+ * const requiredString = new GraphQLNonNull(GraphQLString);
1099
+ *
1100
+ * requiredString.ofType; // => GraphQLString
1101
+ * String(requiredString); // => 'String!'
1102
+ * ```
1103
+ */
131
1104
  constructor(ofType: T);
1105
+ /**
1106
+ * Returns the value used by `Object.prototype.toString`.
1107
+ * @returns The built-in string tag for this object.
1108
+ */
132
1109
  get [Symbol.toStringTag](): string;
1110
+ /**
1111
+ * Returns this wrapping type as a GraphQL type-reference string.
1112
+ * @returns The GraphQL type-reference string.
1113
+ * @example
1114
+ * ```ts
1115
+ * import { GraphQLList, GraphQLNonNull, GraphQLString } from 'graphql/type';
1116
+ *
1117
+ * const requiredString = new GraphQLNonNull(GraphQLString);
1118
+ * const requiredStringList = new GraphQLNonNull(
1119
+ * new GraphQLList(GraphQLString),
1120
+ * );
1121
+ *
1122
+ * requiredString.toString(); // => 'String!'
1123
+ * requiredStringList.toString(); // => '[String]!'
1124
+ * ```
1125
+ */
133
1126
  toString(): string;
1127
+ /**
1128
+ * Returns the JSON representation used when this object is serialized.
1129
+ * @returns The JSON-serializable representation.
1130
+ * @example
1131
+ * ```ts
1132
+ * import { GraphQLNonNull, GraphQLString } from 'graphql/type';
1133
+ *
1134
+ * const requiredString = new GraphQLNonNull(GraphQLString);
1135
+ *
1136
+ * requiredString.toJSON(); // => 'String!'
1137
+ * JSON.stringify({ type: requiredString }); // => '{"type":"String!"}'
1138
+ * ```
1139
+ */
134
1140
  toJSON(): string;
135
1141
  }
1142
+ /** These types wrap and modify other types */
1143
+ export type GraphQLWrappingType = GraphQLList<GraphQLType> | GraphQLNonNull<GraphQLNullableType>;
136
1144
  /**
137
- * These types wrap and modify other types
1145
+ * Returns true when the value is a GraphQL list or non-null wrapper type.
1146
+ * @param type - The GraphQL type to inspect.
1147
+ * @returns True when the value is a GraphQL list or non-null wrapper type.
1148
+ * @example
1149
+ * ```ts
1150
+ * import {
1151
+ * GraphQLList,
1152
+ * GraphQLNonNull,
1153
+ * GraphQLString,
1154
+ * isWrappingType,
1155
+ * } from 'graphql/type';
1156
+ *
1157
+ * isWrappingType(new GraphQLList(GraphQLString)); // => true
1158
+ * isWrappingType(new GraphQLNonNull(GraphQLString)); // => true
1159
+ * isWrappingType(GraphQLString); // => false
1160
+ * ```
138
1161
  */
139
- export type GraphQLWrappingType = GraphQLList<GraphQLType> | GraphQLNonNull<GraphQLNullableType>;
140
1162
  export declare function isWrappingType(type: unknown): type is GraphQLWrappingType;
141
- export declare function assertWrappingType(type: unknown): GraphQLWrappingType;
142
1163
  /**
143
- * These types can all accept null as a value.
1164
+ * Returns the value as a GraphQL wrapping type, or throws if it is not one.
1165
+ * @param type - The GraphQL type to inspect.
1166
+ * @returns The value typed as a GraphQL wrapping type.
1167
+ * @example
1168
+ * ```ts
1169
+ * import { GraphQLList, GraphQLString, assertWrappingType } from 'graphql/type';
1170
+ *
1171
+ * const wrappingType = assertWrappingType(new GraphQLList(GraphQLString));
1172
+ *
1173
+ * wrappingType.toString(); // => '[String]'
1174
+ * assertWrappingType(GraphQLString); // throws an error
1175
+ * ```
144
1176
  */
1177
+ export declare function assertWrappingType(type: unknown): GraphQLWrappingType;
1178
+ /** These types can all accept null as a value. */
145
1179
  export type GraphQLNullableType = GraphQLNamedType | GraphQLList<GraphQLType>;
1180
+ /**
1181
+ * Returns true when the value is a GraphQL type that can accept null.
1182
+ * @param type - The GraphQL type to inspect.
1183
+ * @returns True when the value is a GraphQL type that can accept null.
1184
+ * @example
1185
+ * ```ts
1186
+ * import { GraphQLNonNull, GraphQLString, isNullableType } from 'graphql/type';
1187
+ *
1188
+ * isNullableType(GraphQLString); // => true
1189
+ * isNullableType(new GraphQLNonNull(GraphQLString)); // => false
1190
+ * isNullableType(null); // => false
1191
+ * ```
1192
+ */
146
1193
  export declare function isNullableType(type: unknown): type is GraphQLNullableType;
1194
+ /**
1195
+ * Returns the value as a nullable GraphQL type, or throws if it is not one.
1196
+ * @param type - The GraphQL type to inspect.
1197
+ * @returns The value typed as a nullable GraphQL type.
1198
+ * @example
1199
+ * ```ts
1200
+ * import {
1201
+ * GraphQLNonNull,
1202
+ * GraphQLString,
1203
+ * assertNullableType,
1204
+ * } from 'graphql/type';
1205
+ *
1206
+ * const nullableType = assertNullableType(GraphQLString);
1207
+ *
1208
+ * nullableType; // => GraphQLString
1209
+ * assertNullableType(new GraphQLNonNull(GraphQLString)); // throws an error
1210
+ * ```
1211
+ */
147
1212
  export declare function assertNullableType(type: unknown): GraphQLNullableType;
1213
+ /**
1214
+ * Returns the nullable type.
1215
+ * @param type - The GraphQL type to inspect.
1216
+ * @returns The nullable type after removing one non-null wrapper, if present.
1217
+ * @example
1218
+ * ```ts
1219
+ * import { getNullableType } from 'graphql/type';
1220
+ *
1221
+ * getNullableType(null); // => undefined
1222
+ * getNullableType(undefined); // => undefined
1223
+ * ```
1224
+ */
148
1225
  export declare function getNullableType(type: undefined | null): void;
1226
+ /**
1227
+ * Returns the nullable type after removing one non-null wrapper.
1228
+ * @param type - A nullable type or non-null wrapper.
1229
+ * @returns The nullable type after removing one non-null wrapper, if present.
1230
+ * @typeParam T - The nullable GraphQL type returned after removing one non-null wrapper.
1231
+ * @example
1232
+ * ```ts
1233
+ * import {
1234
+ * GraphQLList,
1235
+ * GraphQLNonNull,
1236
+ * GraphQLString,
1237
+ * getNullableType,
1238
+ * } from 'graphql/type';
1239
+ *
1240
+ * const requiredString = new GraphQLNonNull(GraphQLString);
1241
+ * const stringList = new GraphQLList(GraphQLString);
1242
+ *
1243
+ * getNullableType(requiredString); // => GraphQLString
1244
+ * getNullableType(stringList); // => stringList
1245
+ * ```
1246
+ */
149
1247
  export declare function getNullableType<T extends GraphQLNullableType>(type: T | GraphQLNonNull<T>): T;
150
- export declare function getNullableType(type: Maybe<GraphQLType>): GraphQLNullableType | undefined;
151
1248
  /**
152
- * These named types do not include modifiers like List or NonNull.
1249
+ * Returns the nullable type after removing one non-null wrapper.
1250
+ * @param type - The GraphQL type to inspect.
1251
+ * @returns The nullable type after removing one non-null wrapper, if present.
1252
+ * @example
1253
+ * ```ts
1254
+ * import {
1255
+ * GraphQLList,
1256
+ * GraphQLNonNull,
1257
+ * GraphQLString,
1258
+ * getNullableType,
1259
+ * } from 'graphql/type';
1260
+ *
1261
+ * const requiredStringList = new GraphQLNonNull(
1262
+ * new GraphQLList(GraphQLString),
1263
+ * );
1264
+ *
1265
+ * getNullableType(requiredStringList).toString(); // => '[String]'
1266
+ * getNullableType(GraphQLString); // => GraphQLString
1267
+ * ```
153
1268
  */
1269
+ export declare function getNullableType(type: Maybe<GraphQLType>): GraphQLNullableType | undefined;
1270
+ /** These named types do not include modifiers like List or NonNull. */
154
1271
  export type GraphQLNamedType = GraphQLNamedInputType | GraphQLNamedOutputType;
1272
+ /** A named GraphQL type that can be used as an input type. */
155
1273
  export type GraphQLNamedInputType = GraphQLScalarType | GraphQLEnumType | GraphQLInputObjectType;
1274
+ /** A named GraphQL type that can be used as an output type. */
156
1275
  export type GraphQLNamedOutputType = GraphQLScalarType | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType;
1276
+ /**
1277
+ * Returns true when the value is a GraphQL named type.
1278
+ * @param type - The GraphQL type to inspect.
1279
+ * @returns True when the value is a GraphQL named type.
1280
+ * @example
1281
+ * ```ts
1282
+ * import { GraphQLList, GraphQLString, isNamedType } from 'graphql/type';
1283
+ *
1284
+ * isNamedType(GraphQLString); // => true
1285
+ * isNamedType(new GraphQLList(GraphQLString)); // => false
1286
+ * isNamedType(null); // => false
1287
+ * ```
1288
+ */
157
1289
  export declare function isNamedType(type: unknown): type is GraphQLNamedType;
1290
+ /**
1291
+ * Returns the value as a GraphQL named type, or throws if it is not one.
1292
+ * @param type - The GraphQL type to inspect.
1293
+ * @returns The value typed as a GraphQL named type.
1294
+ * @example
1295
+ * ```ts
1296
+ * import { GraphQLList, GraphQLString, assertNamedType } from 'graphql/type';
1297
+ *
1298
+ * const namedType = assertNamedType(GraphQLString);
1299
+ *
1300
+ * namedType.name; // => 'String'
1301
+ * assertNamedType(new GraphQLList(GraphQLString)); // throws an error
1302
+ * ```
1303
+ */
158
1304
  export declare function assertNamedType(type: unknown): GraphQLNamedType;
1305
+ /**
1306
+ * Returns the named type.
1307
+ * @param type - The GraphQL type to inspect.
1308
+ * @returns The named type after unwrapping all list and non-null wrappers.
1309
+ * @example
1310
+ * ```ts
1311
+ * import { getNamedType } from 'graphql/type';
1312
+ *
1313
+ * getNamedType(null); // => undefined
1314
+ * getNamedType(undefined); // => undefined
1315
+ * ```
1316
+ */
159
1317
  export declare function getNamedType(type: undefined | null): void;
1318
+ /**
1319
+ * Returns the named input type after unwrapping all list and non-null wrappers.
1320
+ * @param type - The GraphQL input type to inspect.
1321
+ * @returns The named input type after unwrapping all wrappers.
1322
+ * @example
1323
+ * ```ts
1324
+ * import { buildSchema } from 'graphql/utilities';
1325
+ * import { getNamedType } from 'graphql/type';
1326
+ *
1327
+ * const schema = buildSchema(`
1328
+ * input ReviewInput {
1329
+ * stars: Int!
1330
+ * }
1331
+ *
1332
+ * type Query {
1333
+ * review(input: [ReviewInput!]!): Boolean
1334
+ * }
1335
+ * `);
1336
+ *
1337
+ * const inputArg = schema.getQueryType()?.getFields().review.args[0];
1338
+ *
1339
+ * getNamedType(inputArg?.type).toString(); // => 'ReviewInput'
1340
+ * ```
1341
+ */
160
1342
  export declare function getNamedType(type: GraphQLInputType): GraphQLNamedInputType;
1343
+ /**
1344
+ * Returns the named output type after unwrapping all list and non-null wrappers.
1345
+ * @param type - The GraphQL output type to inspect.
1346
+ * @returns The named output type after unwrapping all wrappers.
1347
+ * @example
1348
+ * ```ts
1349
+ * import { buildSchema } from 'graphql/utilities';
1350
+ * import { getNamedType } from 'graphql/type';
1351
+ *
1352
+ * const schema = buildSchema(`
1353
+ * type User {
1354
+ * name: String
1355
+ * }
1356
+ *
1357
+ * type Query {
1358
+ * users: [User!]!
1359
+ * }
1360
+ * `);
1361
+ *
1362
+ * const usersField = schema.getQueryType()?.getFields().users;
1363
+ *
1364
+ * getNamedType(usersField?.type).toString(); // => 'User'
1365
+ * ```
1366
+ */
161
1367
  export declare function getNamedType(type: GraphQLOutputType): GraphQLNamedOutputType;
1368
+ /**
1369
+ * Returns the named type after unwrapping all list and non-null wrappers.
1370
+ * @param type - The GraphQL type to inspect.
1371
+ * @returns The named type after unwrapping all wrappers.
1372
+ * @example
1373
+ * ```ts
1374
+ * import {
1375
+ * GraphQLList,
1376
+ * GraphQLNonNull,
1377
+ * GraphQLString,
1378
+ * getNamedType,
1379
+ * } from 'graphql/type';
1380
+ *
1381
+ * const nestedType = new GraphQLNonNull(
1382
+ * new GraphQLList(new GraphQLNonNull(GraphQLString)),
1383
+ * );
1384
+ *
1385
+ * getNamedType(nestedType); // => GraphQLString
1386
+ * ```
1387
+ */
162
1388
  export declare function getNamedType(type: GraphQLType): GraphQLNamedType;
1389
+ /**
1390
+ * Returns the named type after unwrapping all list and non-null wrappers.
1391
+ * @param type - The GraphQL type to inspect.
1392
+ * @returns The named type after unwrapping all wrappers, or undefined for nullish input.
1393
+ * @example
1394
+ * ```ts
1395
+ * import {
1396
+ * GraphQLList,
1397
+ * GraphQLString,
1398
+ * getNamedType,
1399
+ * } from 'graphql/type';
1400
+ *
1401
+ * getNamedType(new GraphQLList(GraphQLString)); // => GraphQLString
1402
+ * getNamedType(undefined); // => undefined
1403
+ * ```
1404
+ */
163
1405
  export declare function getNamedType(type: Maybe<GraphQLType>): GraphQLNamedType | undefined;
164
1406
  /**
165
1407
  * An interface for all Schema Elements.
1408
+ *
1409
+ * @internal
166
1410
  */
167
1411
  export interface GraphQLSchemaElement {
168
1412
  toString: () => string;
@@ -171,14 +1415,50 @@ export interface GraphQLSchemaElement {
171
1415
  /**
172
1416
  * Used while defining GraphQL types to allow for circular references in
173
1417
  * otherwise immutable type definitions.
1418
+ * @typeParam T - The element type returned by the thunk or array.
174
1419
  */
175
1420
  export type ThunkReadonlyArray<T> = (() => ReadonlyArray<T>) | ReadonlyArray<T>;
1421
+ /**
1422
+ * A thunk that resolves to an object map.
1423
+ * @typeParam T - Value type stored in the object map.
1424
+ */
176
1425
  export type ThunkObjMap<T> = (() => ObjMap<T>) | ObjMap<T>;
1426
+ /**
1427
+ * Resolves a thunked readonly array.
1428
+ * @param thunk - The thunk or value to resolve.
1429
+ * @returns The resolved readonly array.
1430
+ * @typeParam T - The element type resolved from the thunk or array.
1431
+ * @example
1432
+ * ```ts
1433
+ * import { GraphQLString, resolveReadonlyArrayThunk } from 'graphql/type';
1434
+ *
1435
+ * const lazyFields = resolveReadonlyArrayThunk(() => [GraphQLString]);
1436
+ * const fields = resolveReadonlyArrayThunk([GraphQLString]);
1437
+ *
1438
+ * lazyFields; // => [GraphQLString]
1439
+ * fields; // => [GraphQLString]
1440
+ * ```
1441
+ */
177
1442
  export declare function resolveReadonlyArrayThunk<T>(thunk: ThunkReadonlyArray<T>): ReadonlyArray<T>;
1443
+ /**
1444
+ * Resolves a thunked object map.
1445
+ * @param thunk - The thunk or value to resolve.
1446
+ * @returns The resolved object map.
1447
+ * @typeParam T - The object-map value type resolved from the thunk or map.
1448
+ * @example
1449
+ * ```ts
1450
+ * import { GraphQLString, resolveObjMapThunk } from 'graphql/type';
1451
+ *
1452
+ * const lazyFields = resolveObjMapThunk(() => ({ name: GraphQLString }));
1453
+ * const fields = resolveObjMapThunk({ name: GraphQLString });
1454
+ *
1455
+ * lazyFields.name; // => GraphQLString
1456
+ * fields.name; // => GraphQLString
1457
+ * ```
1458
+ */
178
1459
  export declare function resolveObjMapThunk<T>(thunk: ThunkObjMap<T>): ObjMap<T>;
179
1460
  /**
180
1461
  * Custom extensions
181
- *
182
1462
  * @remarks
183
1463
  * Use a unique identifier name for your extension, for example the name of
184
1464
  * your library or project. Do not use a shortened identifier as this increases
@@ -191,45 +1471,17 @@ export interface GraphQLScalarTypeExtensions {
191
1471
  /**
192
1472
  * Scalar Type Definition
193
1473
  *
194
- * The leaf values of any request and input values to arguments are
195
- * Scalars (or Enums) and are defined with a name and a series of functions
196
- * used to parse input from ast or variables and to ensure validity.
1474
+ * Scalar types define the leaf values of a GraphQL response and the input
1475
+ * values accepted by arguments and input object fields. A scalar type has a
1476
+ * name and coercion functions that validate and convert runtime values and
1477
+ * GraphQL literals.
197
1478
  *
198
1479
  * If a type's coerceOutputValue function returns `null` or does not return a
199
1480
  * value (i.e. it returns `undefined`) then an error will be raised and a
200
- * `null` value will be returned in the response. It is always better to
201
- * validate.
202
- *
203
- * Example:
204
- *
205
- * ```ts
206
- * function ensureOdd(value) {
207
- * if (!Number.isFinite(value)) {
208
- * throw new Error(
209
- * `Scalar "Odd" cannot represent "${value}" since it is not a finite number.`,
210
- * );
211
- * }
212
- *
213
- * if (value % 2 === 0) {
214
- * throw new Error(`Scalar "Odd" cannot represent "${value}" since it is even.`);
215
- * }
216
- * }
217
- *
218
- * const OddType = new GraphQLScalarType({
219
- * name: 'Odd',
220
- * coerceOutputValue(value) {
221
- * return ensureOdd(value);
222
- * },
223
- * coerceInputValue(value) {
224
- * return ensureOdd(value);
225
- * }
226
- * valueToLiteral(value) {
227
- * return parse(`${ensureOdd(value)`);
228
- * }
229
- * });
230
- * ```
231
- *
232
- * Custom scalars behavior is defined via the following functions:
1481
+ * `null` value will be returned in the response. Prefer validating inputs
1482
+ * before execution so clients receive input diagnostics before result coercion
1483
+ * fails.
1484
+ * Custom scalar behavior is defined via the following functions:
233
1485
  *
234
1486
  * - coerceOutputValue(value): Implements "Result Coercion". Given an internal value,
235
1487
  * produces an external value valid for this type. Returns undefined or
@@ -241,7 +1493,7 @@ export interface GraphQLScalarTypeExtensions {
241
1493
  * invalid values.
242
1494
  *
243
1495
  * - coerceInputLiteral(ast): Implements "Input Coercion" for constant literals.
244
- * Given an GraphQL literal (AST) (for example, an argument value), produces
1496
+ * Given a GraphQL literal (AST) (for example, an argument value), produces
245
1497
  * an internal value valid for this type. Returns undefined or throws an
246
1498
  * error to indicate invalid values.
247
1499
  *
@@ -261,51 +1513,259 @@ export interface GraphQLScalarTypeExtensions {
261
1513
  * non-specified replacement of variables embedded within complex scalars.
262
1514
  * Replaced by the combination of the `replaceVariables()` utility and the
263
1515
  * `coerceInputLiteral()` method.
1516
+ * @typeParam TInternal - Internal runtime representation for this scalar.
1517
+ * @typeParam TExternal - External representation accepted from or returned to callers.
1518
+ * @example
1519
+ * ```ts
1520
+ * import { GraphQLScalarType, Kind } from 'graphql';
1521
+ *
1522
+ * const ensureOdd = (value) => {
1523
+ * if (!Number.isFinite(value)) {
1524
+ * throw new Error(
1525
+ * `Scalar "Odd" cannot represent "${value}" since it is not a finite number.`,
1526
+ * );
1527
+ * }
264
1528
  *
1529
+ * if (value % 2 === 0) {
1530
+ * throw new Error(`Scalar "Odd" cannot represent "${value}" since it is even.`);
1531
+ * }
1532
+ *
1533
+ * return value;
1534
+ * };
1535
+ *
1536
+ * const OddType = new GraphQLScalarType({
1537
+ * name: 'Odd',
1538
+ * coerceOutputValue: (value) => {
1539
+ * return ensureOdd(value);
1540
+ * },
1541
+ * coerceInputValue: (value) => {
1542
+ * return ensureOdd(value);
1543
+ * },
1544
+ * valueToLiteral: (value) => {
1545
+ * return { kind: Kind.INT, value: String(ensureOdd(value)) };
1546
+ * }
1547
+ * });
1548
+ * ```
265
1549
  */
266
1550
  export declare class GraphQLScalarType<TInternal = unknown, TExternal = TInternal> implements GraphQLSchemaElement {
267
- readonly __kind: symbol;
1551
+ /** The GraphQL name for this schema element. */
268
1552
  name: string;
1553
+ /** Human-readable description for this schema element, if provided. */
269
1554
  description: Maybe<string>;
1555
+ /** URL identifying the behavior specified for this custom scalar. */
270
1556
  specifiedByURL: Maybe<string>;
271
- /** @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18 */
1557
+ /**
1558
+ * Deprecated legacy serializer used to convert internal values for response
1559
+ * output. Use `coerceOutputValue()` instead.
1560
+ * @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18
1561
+ */
272
1562
  serialize: GraphQLScalarSerializer<TExternal>;
273
- /** @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18 */
1563
+ /**
1564
+ * Deprecated legacy parser used to convert externally provided input values.
1565
+ * Use `coerceInputValue()` instead.
1566
+ * @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18
1567
+ */
274
1568
  parseValue: GraphQLScalarValueParser<TInternal>;
275
- /** @deprecated use `replaceVariables()` and `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18 */
1569
+ /**
1570
+ * Deprecated legacy parser used to convert externally provided input
1571
+ * literals. Use `replaceVariables()` and `coerceInputLiteral()` instead.
1572
+ * @deprecated use `replaceVariables()` and `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18
1573
+ */
276
1574
  parseLiteral: GraphQLScalarLiteralParser<TInternal>;
1575
+ /** Coercer used to convert internal scalar values for response output. */
277
1576
  coerceOutputValue: GraphQLScalarOutputValueCoercer<TExternal>;
1577
+ /** Coercer used to convert externally provided scalar input values. */
278
1578
  coerceInputValue: GraphQLScalarInputValueCoercer<TInternal>;
1579
+ /** Coercer used to convert GraphQL scalar input literals. */
279
1580
  coerceInputLiteral: GraphQLScalarInputLiteralCoercer<TInternal> | undefined;
1581
+ /** Converter used to produce GraphQL literals from runtime input values. */
280
1582
  valueToLiteral: GraphQLScalarValueToLiteral | undefined;
1583
+ /** Extension fields to include in the formatted result. */
281
1584
  extensions: Readonly<GraphQLScalarTypeExtensions>;
1585
+ /** AST node from which this schema element was built, if available. */
282
1586
  astNode: Maybe<ScalarTypeDefinitionNode>;
1587
+ /** AST extension nodes applied to this schema element. */
283
1588
  extensionASTNodes: ReadonlyArray<ScalarTypeExtensionNode>;
1589
+ /**
1590
+ * Creates a GraphQLScalarType instance.
1591
+ * @param config - Configuration describing this object.
1592
+ * @example
1593
+ * ```ts
1594
+ * import { Kind, parse } from 'graphql/language';
1595
+ * import { GraphQLScalarType } from 'graphql/type';
1596
+ *
1597
+ * const document = parse(`
1598
+ * "Odd integer values."
1599
+ * scalar Odd @specifiedBy(url: "https://example.com/odd")
1600
+ *
1601
+ * extend scalar Odd @specifiedBy(url: "https://example.com/odd-v2")
1602
+ * `);
1603
+ *
1604
+ * const Odd = new GraphQLScalarType({
1605
+ * name: 'Odd',
1606
+ * description: 'Odd integer values.',
1607
+ * specifiedByURL: 'https://example.com/odd',
1608
+ * coerceOutputValue: (value) => {
1609
+ * if (typeof value !== 'number' || value % 2 === 0) {
1610
+ * throw new TypeError('Odd can only produce odd numbers.');
1611
+ * }
1612
+ * return value;
1613
+ * },
1614
+ * coerceInputValue: (value) => {
1615
+ * if (typeof value !== 'number' || value % 2 === 0) {
1616
+ * throw new TypeError('Odd can only accept odd numbers.');
1617
+ * }
1618
+ * return value;
1619
+ * },
1620
+ * coerceInputLiteral: (ast) => {
1621
+ * if (ast.kind !== Kind.INT) {
1622
+ * throw new TypeError('Odd can only accept integer literals.');
1623
+ * }
1624
+ * const value = Number(ast.value);
1625
+ * if (value % 2 === 0) {
1626
+ * throw new TypeError('Odd can only accept odd integer literals.');
1627
+ * }
1628
+ * return value;
1629
+ * },
1630
+ * valueToLiteral: (value) => {
1631
+ * return { kind: Kind.INT, value: String(ensureOdd(value)) };
1632
+ * },
1633
+ * extensions: { numeric: true },
1634
+ * astNode: document.definitions[0],
1635
+ * extensionASTNodes: [ document.definitions[1] ],
1636
+ * });
1637
+ *
1638
+ * Odd.description; // => 'Odd integer values.'
1639
+ * Odd.specifiedByURL; // => 'https://example.com/odd'
1640
+ * Odd.coerceOutputValue(3); // => 3
1641
+ * Odd.coerceInputValue(5); // => 5
1642
+ * Odd.extensions; // => { numeric: true }
1643
+ * ```
1644
+ */
284
1645
  constructor(config: Readonly<GraphQLScalarTypeConfig<TInternal, TExternal>>);
1646
+ /**
1647
+ * Returns the value used by `Object.prototype.toString`.
1648
+ * @returns The built-in string tag for this object.
1649
+ */
285
1650
  get [Symbol.toStringTag](): string;
1651
+ /**
1652
+ * Returns a normalized configuration object for this object.
1653
+ * @returns A configuration object that can be used to recreate this object.
1654
+ * @example
1655
+ * ```ts
1656
+ * import { GraphQLScalarType } from 'graphql/type';
1657
+ *
1658
+ * const Url = new GraphQLScalarType({
1659
+ * name: 'Url',
1660
+ * description: 'An absolute URL string.',
1661
+ * specifiedByURL: 'https://url.spec.whatwg.org/',
1662
+ * });
1663
+ *
1664
+ * const config = Url.toConfig();
1665
+ * const UrlCopy = new GraphQLScalarType(config);
1666
+ *
1667
+ * config.name; // => 'Url'
1668
+ * config.specifiedByURL; // => 'https://url.spec.whatwg.org/'
1669
+ * UrlCopy.name; // => Url.name
1670
+ * ```
1671
+ */
286
1672
  toConfig(): GraphQLScalarTypeNormalizedConfig<TInternal, TExternal>;
1673
+ /**
1674
+ * Returns the schema coordinate identifying this scalar type.
1675
+ * @returns The schema coordinate for this scalar type.
1676
+ * @example
1677
+ * ```ts
1678
+ * import { GraphQLScalarType } from 'graphql/type';
1679
+ *
1680
+ * const DateTime = new GraphQLScalarType({ name: 'DateTime' });
1681
+ *
1682
+ * DateTime.toString(); // => 'DateTime'
1683
+ * String(DateTime); // => 'DateTime'
1684
+ * ```
1685
+ */
287
1686
  toString(): string;
1687
+ /**
1688
+ * Returns the JSON representation used when this object is serialized.
1689
+ * @returns The JSON-serializable representation.
1690
+ * @example
1691
+ * ```ts
1692
+ * import { GraphQLScalarType } from 'graphql/type';
1693
+ *
1694
+ * const DateTime = new GraphQLScalarType({ name: 'DateTime' });
1695
+ *
1696
+ * DateTime.toJSON(); // => 'DateTime'
1697
+ * JSON.stringify({ type: DateTime }); // => '{"type":"DateTime"}'
1698
+ * ```
1699
+ */
288
1700
  toJSON(): string;
289
1701
  }
1702
+ /**
1703
+ * Deprecated function type that serializes a runtime value as a scalar output
1704
+ * value. Use `GraphQLScalarOutputValueCoercer` instead.
1705
+ * @typeParam TExternal - External representation accepted from or returned to callers.
1706
+ * @deprecated Use GraphQLScalarOutputValueCoercer instead. Will be removed in v18.
1707
+ */
290
1708
  export type GraphQLScalarSerializer<TExternal> = (outputValue: unknown) => TExternal;
1709
+ /**
1710
+ * Function used to coerce internal scalar values for response output.
1711
+ * @typeParam TExternal - External representation accepted from or returned to callers.
1712
+ */
291
1713
  export type GraphQLScalarOutputValueCoercer<TExternal> = (outputValue: unknown) => TExternal;
1714
+ /**
1715
+ * Deprecated function type that parses a runtime input value as a scalar input
1716
+ * value. Use `GraphQLScalarInputValueCoercer` instead.
1717
+ * @typeParam TInternal - Internal runtime representation for this scalar.
1718
+ * @deprecated Use GraphQLScalarInputValueCoercer instead. Will be removed in v18.
1719
+ */
292
1720
  export type GraphQLScalarValueParser<TInternal> = (inputValue: unknown) => TInternal;
1721
+ /**
1722
+ * Function used to coerce externally provided scalar input values.
1723
+ * @typeParam TInternal - Internal runtime representation for this scalar.
1724
+ */
293
1725
  export type GraphQLScalarInputValueCoercer<TInternal> = (inputValue: unknown) => TInternal;
1726
+ /**
1727
+ * Deprecated function type that parses a GraphQL value literal as a scalar
1728
+ * input value. Use `GraphQLScalarInputLiteralCoercer` instead.
1729
+ * @typeParam TInternal - Internal runtime representation for this scalar.
1730
+ * @deprecated Use GraphQLScalarInputLiteralCoercer instead. Will be removed in v18.
1731
+ */
294
1732
  export type GraphQLScalarLiteralParser<TInternal> = (valueNode: ValueNode, variables: Maybe<ObjMap<unknown>>) => Maybe<TInternal>;
1733
+ /**
1734
+ * Function used to coerce GraphQL scalar input literals.
1735
+ * @typeParam TInternal - Internal runtime representation for this scalar.
1736
+ */
295
1737
  export type GraphQLScalarInputLiteralCoercer<TInternal> = (valueNode: ConstValueNode) => Maybe<TInternal>;
1738
+ /** @internal */
296
1739
  export type GraphQLScalarValueToLiteral = (inputValue: unknown) => ConstValueNode | undefined;
1740
+ /**
1741
+ * Configuration used to construct a GraphQLScalarType.
1742
+ * @typeParam TInternal - Internal runtime representation for this scalar.
1743
+ * @typeParam TExternal - External representation accepted from or returned to callers.
1744
+ */
297
1745
  export interface GraphQLScalarTypeConfig<TInternal, TExternal> {
1746
+ /** The GraphQL name for this schema element. */
298
1747
  name: string;
1748
+ /** Human-readable description for this schema element, if provided. */
299
1749
  description?: Maybe<string>;
1750
+ /** URL identifying the behavior specified for this custom scalar. */
300
1751
  specifiedByURL?: Maybe<string>;
301
- /** Serializes an internal value to include in a response. */
302
- /** @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18 */
1752
+ /**
1753
+ * Deprecated legacy serializer used to convert internal values for response
1754
+ * output. Use `coerceOutputValue()` instead.
1755
+ * @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18
1756
+ */
303
1757
  serialize?: GraphQLScalarSerializer<TExternal> | undefined;
304
- /** Parses an externally provided value to use as an input. */
305
- /** @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18 */
1758
+ /**
1759
+ * Deprecated legacy parser used to convert externally provided input values.
1760
+ * Use `coerceInputValue()` instead.
1761
+ * @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18
1762
+ */
306
1763
  parseValue?: GraphQLScalarValueParser<TInternal> | undefined;
307
- /** Parses an externally provided literal value to use as an input. */
308
- /** @deprecated use `replaceVariables()` and `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18 */
1764
+ /**
1765
+ * Deprecated legacy parser used to convert externally provided input
1766
+ * literals. Use `replaceVariables()` and `coerceInputLiteral()` instead.
1767
+ * @deprecated use `replaceVariables()` and `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18
1768
+ */
309
1769
  parseLiteral?: GraphQLScalarLiteralParser<TInternal> | undefined;
310
1770
  /** Coerces an internal value to include in a response. */
311
1771
  coerceOutputValue?: GraphQLScalarOutputValueCoercer<TExternal> | undefined;
@@ -315,10 +1775,14 @@ export interface GraphQLScalarTypeConfig<TInternal, TExternal> {
315
1775
  coerceInputLiteral?: GraphQLScalarInputLiteralCoercer<TInternal> | undefined;
316
1776
  /** Translates an externally provided value to a literal (AST). */
317
1777
  valueToLiteral?: GraphQLScalarValueToLiteral | undefined;
1778
+ /** Extension fields to include in the formatted result. */
318
1779
  extensions?: Maybe<Readonly<GraphQLScalarTypeExtensions>>;
1780
+ /** AST node from which this schema element was built, if available. */
319
1781
  astNode?: Maybe<ScalarTypeDefinitionNode>;
1782
+ /** AST extension nodes applied to this schema element. */
320
1783
  extensionASTNodes?: Maybe<ReadonlyArray<ScalarTypeExtensionNode>>;
321
1784
  }
1785
+ /** @internal */
322
1786
  export interface GraphQLScalarTypeNormalizedConfig<TInternal, TExternal> extends GraphQLScalarTypeConfig<TInternal, TExternal> {
323
1787
  serialize: GraphQLScalarSerializer<TExternal>;
324
1788
  parseValue: GraphQLScalarValueParser<TInternal>;
@@ -331,15 +1795,15 @@ export interface GraphQLScalarTypeNormalizedConfig<TInternal, TExternal> extends
331
1795
  }
332
1796
  /**
333
1797
  * Custom extensions
334
- *
335
1798
  * @remarks
336
1799
  * Use a unique identifier name for your extension, for example the name of
337
1800
  * your library or project. Do not use a shortened identifier as this increases
338
1801
  * the risk of conflicts. We recommend you add at most one extension field,
339
1802
  * an object which can contain all the values you need.
340
- *
341
1803
  * We've provided these template arguments because this is an open type and
342
1804
  * you may find them useful.
1805
+ * @typeParam _TSource - Reserved source type parameter for extension typing.
1806
+ * @typeParam _TContext - Reserved context type parameter for extension typing.
343
1807
  */
344
1808
  export interface GraphQLObjectTypeExtensions<_TSource = any, _TContext = any> {
345
1809
  [attributeName: string | symbol]: unknown;
@@ -349,9 +1813,10 @@ export interface GraphQLObjectTypeExtensions<_TSource = any, _TContext = any> {
349
1813
  *
350
1814
  * Almost all of the GraphQL types you define will be object types. Object types
351
1815
  * have a name, but most importantly describe their fields.
352
- *
353
- * Example:
354
- *
1816
+ * @typeParam TSource - Source object type passed to resolvers.
1817
+ * @typeParam TContext - Context object type passed to resolvers.
1818
+ * @typeParam TAbstract - Runtime value type used for abstract type resolution.
1819
+ * @example
355
1820
  * ```ts
356
1821
  * const AddressType = new GraphQLObjectType({
357
1822
  * name: 'Address',
@@ -360,20 +1825,18 @@ export interface GraphQLObjectTypeExtensions<_TSource = any, _TContext = any> {
360
1825
  * number: { type: GraphQLInt },
361
1826
  * formatted: {
362
1827
  * type: GraphQLString,
363
- * resolve(obj) {
1828
+ * resolve: (obj) => {
364
1829
  * return obj.number + ' ' + obj.street
365
1830
  * }
366
1831
  * }
367
1832
  * }
368
1833
  * });
369
1834
  * ```
370
- *
1835
+ * @example
371
1836
  * When two types need to refer to each other, or a type needs to refer to
372
1837
  * itself in a field, you can use a function expression (aka a closure or a
373
1838
  * thunk) to supply the fields lazily.
374
1839
  *
375
- * Example:
376
- *
377
1840
  * ```ts
378
1841
  * const PersonType = new GraphQLObjectType({
379
1842
  * name: 'Person',
@@ -385,42 +1848,297 @@ export interface GraphQLObjectTypeExtensions<_TSource = any, _TContext = any> {
385
1848
  * ```
386
1849
  */
387
1850
  export declare class GraphQLObjectType<TSource = any, TContext = any, TAbstract = any> implements GraphQLSchemaElement {
388
- readonly __kind: typeof objectSymbol;
1851
+ /** The GraphQL name for this schema element. */
389
1852
  name: string;
1853
+ /** Human-readable description for this schema element, if provided. */
390
1854
  description: Maybe<string>;
1855
+ /** Predicate used to determine whether a runtime value belongs to this object type. */
391
1856
  isTypeOf: Maybe<GraphQLIsTypeOfFn<TAbstract, TContext>>;
1857
+ /** Extension fields to include in the formatted result. */
392
1858
  extensions: Readonly<GraphQLObjectTypeExtensions<TSource, TContext>>;
1859
+ /** AST node from which this schema element was built, if available. */
393
1860
  astNode: Maybe<ObjectTypeDefinitionNode>;
1861
+ /** AST extension nodes applied to this schema element. */
394
1862
  extensionASTNodes: ReadonlyArray<ObjectTypeExtensionNode>;
395
1863
  private _fields;
396
1864
  private _interfaces;
1865
+ /**
1866
+ * Creates a GraphQLObjectType instance.
1867
+ * @param config - Configuration describing this object.
1868
+ * @example
1869
+ * ```ts
1870
+ * // Configure an object type with interfaces, fields, arguments, and metadata.
1871
+ * import { parse } from 'graphql/language';
1872
+ * import {
1873
+ * GraphQLID,
1874
+ * GraphQLInterfaceType,
1875
+ * GraphQLNonNull,
1876
+ * GraphQLObjectType,
1877
+ * GraphQLString,
1878
+ * } from 'graphql/type';
1879
+ *
1880
+ * const document = parse(`
1881
+ * type User implements Node {
1882
+ * id: ID!
1883
+ * name(format: String = "short"): String
1884
+ * }
1885
+ *
1886
+ * extend type User {
1887
+ * displayName: String
1888
+ * }
1889
+ * `);
1890
+ * const definition = document.definitions[0];
1891
+ * const nameField = definition.fields[1];
1892
+ * const formatArg = nameField.arguments[0];
1893
+ *
1894
+ * const Node = new GraphQLInterfaceType({
1895
+ * name: 'Node',
1896
+ * fields: {
1897
+ * id: { type: new GraphQLNonNull(GraphQLID) },
1898
+ * },
1899
+ * });
1900
+ *
1901
+ * const User = new GraphQLObjectType({
1902
+ * name: 'User',
1903
+ * description: 'A registered user.',
1904
+ * interfaces: [Node],
1905
+ * fields: {
1906
+ * id: { type: new GraphQLNonNull(GraphQLID) },
1907
+ * name: {
1908
+ * description: 'The formatted user name.',
1909
+ * type: GraphQLString,
1910
+ * args: {
1911
+ * format: {
1912
+ * description: 'Controls the name format.',
1913
+ * type: GraphQLString,
1914
+ * default: { value: 'short' },
1915
+ * deprecationReason: 'Use locale instead.',
1916
+ * extensions: { public: true },
1917
+ * astNode: formatArg,
1918
+ * },
1919
+ * },
1920
+ * resolve: (user, { format }) => {
1921
+ * return format === 'long' ? user.fullName : user.name;
1922
+ * },
1923
+ * deprecationReason: 'Use displayName.',
1924
+ * extensions: { cacheSeconds: 60 },
1925
+ * astNode: nameField,
1926
+ * },
1927
+ * },
1928
+ * isTypeOf: (value) => {
1929
+ * return typeof value === 'object' && value != null && 'id' in value;
1930
+ * },
1931
+ * extensions: { entity: 'User' },
1932
+ * astNode: definition,
1933
+ * extensionASTNodes: [ document.definitions[1] ],
1934
+ * });
1935
+ *
1936
+ * User.name; // => 'User'
1937
+ * User.getInterfaces(); // => [Node]
1938
+ * Object.keys(User.getFields()); // => ['id', 'name']
1939
+ * User.getFields().name.args[0].default.value; // => 'short'
1940
+ * User.extensions; // => { entity: 'User' }
1941
+ * ```
1942
+ * @example
1943
+ * ```ts
1944
+ * // This variant configures a subscription field with subscribe and resolve functions.
1945
+ * import { GraphQLObjectType, GraphQLString } from 'graphql/type';
1946
+ *
1947
+ * const Subscription = new GraphQLObjectType({
1948
+ * name: 'Subscription',
1949
+ * fields: {
1950
+ * greeting: {
1951
+ * type: GraphQLString,
1952
+ * subscribe: async function* () {
1953
+ * yield { greeting: 'Hello!' };
1954
+ * },
1955
+ * resolve: (event) => {
1956
+ * return event.greeting;
1957
+ * },
1958
+ * },
1959
+ * },
1960
+ * });
1961
+ *
1962
+ * typeof Subscription.getFields().greeting.subscribe; // => 'function'
1963
+ * ```
1964
+ */
397
1965
  constructor(config: Readonly<GraphQLObjectTypeConfig<TSource, TContext, TAbstract>>);
1966
+ /**
1967
+ * Returns the value used by `Object.prototype.toString`.
1968
+ * @returns The built-in string tag for this object.
1969
+ */
398
1970
  get [Symbol.toStringTag](): string;
1971
+ /**
1972
+ * Returns the fields defined by this type.
1973
+ * @returns The fields keyed by field name.
1974
+ * @example
1975
+ * ```ts
1976
+ * import { buildSchema } from 'graphql/utilities';
1977
+ * import { assertObjectType } from 'graphql/type';
1978
+ *
1979
+ * const schema = buildSchema(`
1980
+ * type User {
1981
+ * id: ID!
1982
+ * name: String
1983
+ * }
1984
+ *
1985
+ * type Query {
1986
+ * viewer: User
1987
+ * }
1988
+ * `);
1989
+ *
1990
+ * const User = assertObjectType(schema.getType('User'));
1991
+ * const fields = User.getFields();
1992
+ *
1993
+ * Object.keys(fields); // => ['id', 'name']
1994
+ * String(fields.id.type); // => 'ID!'
1995
+ * ```
1996
+ */
399
1997
  getFields(): GraphQLFieldMap<TSource, TContext>;
1998
+ /**
1999
+ * Returns the interfaces implemented by this type.
2000
+ * @returns The implemented interfaces.
2001
+ * @example
2002
+ * ```ts
2003
+ * import { buildSchema } from 'graphql/utilities';
2004
+ * import { assertObjectType } from 'graphql/type';
2005
+ *
2006
+ * const schema = buildSchema(`
2007
+ * interface Node {
2008
+ * id: ID!
2009
+ * }
2010
+ *
2011
+ * type User implements Node {
2012
+ * id: ID!
2013
+ * }
2014
+ *
2015
+ * type Query {
2016
+ * viewer: User
2017
+ * }
2018
+ * `);
2019
+ *
2020
+ * const User = assertObjectType(schema.getType('User'));
2021
+ *
2022
+ * User.getInterfaces().map((type) => type.name); // => ['Node']
2023
+ * ```
2024
+ */
400
2025
  getInterfaces(): ReadonlyArray<GraphQLInterfaceType>;
2026
+ /**
2027
+ * Returns a normalized configuration object for this object.
2028
+ * @returns A configuration object that can be used to recreate this object.
2029
+ * @example
2030
+ * ```ts
2031
+ * import { GraphQLObjectType, GraphQLString } from 'graphql/type';
2032
+ *
2033
+ * const User = new GraphQLObjectType({
2034
+ * name: 'User',
2035
+ * fields: {
2036
+ * name: { type: GraphQLString },
2037
+ * },
2038
+ * });
2039
+ *
2040
+ * const config = User.toConfig();
2041
+ * const UserCopy = new GraphQLObjectType(config);
2042
+ *
2043
+ * config.fields.name.type; // => GraphQLString
2044
+ * UserCopy.getFields().name.type; // => GraphQLString
2045
+ * ```
2046
+ */
401
2047
  toConfig(): GraphQLObjectTypeNormalizedConfig<TSource, TContext, TAbstract>;
2048
+ /**
2049
+ * Returns the schema coordinate identifying this object type.
2050
+ * @returns The schema coordinate for this object type.
2051
+ * @example
2052
+ * ```ts
2053
+ * import { buildSchema } from 'graphql/utilities';
2054
+ * import { assertObjectType } from 'graphql/type';
2055
+ *
2056
+ * const schema = buildSchema(`
2057
+ * type User {
2058
+ * name: String
2059
+ * }
2060
+ *
2061
+ * type Query {
2062
+ * viewer: User
2063
+ * }
2064
+ * `);
2065
+ *
2066
+ * const User = assertObjectType(schema.getType('User'));
2067
+ *
2068
+ * User.toString(); // => 'User'
2069
+ * ```
2070
+ */
402
2071
  toString(): string;
2072
+ /**
2073
+ * Returns the JSON representation used when this object is serialized.
2074
+ * @returns The JSON-serializable representation.
2075
+ * @example
2076
+ * ```ts
2077
+ * import { GraphQLObjectType, GraphQLString } from 'graphql/type';
2078
+ *
2079
+ * const User = new GraphQLObjectType({
2080
+ * name: 'User',
2081
+ * fields: { name: { type: GraphQLString } },
2082
+ * });
2083
+ *
2084
+ * User.toJSON(); // => 'User'
2085
+ * JSON.stringify({ type: User }); // => '{"type":"User"}'
2086
+ * ```
2087
+ */
403
2088
  toJSON(): string;
404
2089
  }
2090
+ /**
2091
+ * Configuration used to construct a GraphQLObjectType.
2092
+ * @typeParam TSource - Source object type passed to resolvers.
2093
+ * @typeParam TContext - Context object type passed to resolvers.
2094
+ * @typeParam TAbstract - Runtime value type used for abstract type resolution.
2095
+ */
405
2096
  export interface GraphQLObjectTypeConfig<TSource, TContext, TAbstract = unknown> {
2097
+ /** The GraphQL name for this schema element. */
406
2098
  name: string;
2099
+ /** Human-readable description for this schema element, if provided. */
407
2100
  description?: Maybe<string>;
2101
+ /** Interfaces implemented by this object or interface type. */
408
2102
  interfaces?: ThunkReadonlyArray<GraphQLInterfaceType> | undefined;
2103
+ /** Fields declared by this object, interface, input object, or literal. */
409
2104
  fields: ThunkObjMap<GraphQLFieldConfig<TSource, TContext>>;
2105
+ /** Predicate used to determine whether a runtime value belongs to this object type. */
410
2106
  isTypeOf?: Maybe<GraphQLIsTypeOfFn<TAbstract, TContext>>;
2107
+ /** Extension fields to include in the formatted result. */
411
2108
  extensions?: Maybe<Readonly<GraphQLObjectTypeExtensions<TSource, TContext>>>;
2109
+ /** AST node from which this schema element was built, if available. */
412
2110
  astNode?: Maybe<ObjectTypeDefinitionNode>;
2111
+ /** AST extension nodes applied to this schema element. */
413
2112
  extensionASTNodes?: Maybe<ReadonlyArray<ObjectTypeExtensionNode>>;
414
2113
  }
2114
+ /** @internal */
415
2115
  export interface GraphQLObjectTypeNormalizedConfig<TSource, TContext, TAbstract = unknown> extends GraphQLObjectTypeConfig<TSource, TContext, TAbstract> {
416
2116
  interfaces: ReadonlyArray<GraphQLInterfaceType>;
417
2117
  fields: GraphQLFieldNormalizedConfigMap<TSource, TContext>;
418
2118
  extensions: Readonly<GraphQLObjectTypeExtensions<TSource, TContext>>;
419
2119
  extensionASTNodes: ReadonlyArray<ObjectTypeExtensionNode>;
420
2120
  }
2121
+ /**
2122
+ * Resolves the concrete object type for an abstract GraphQL type.
2123
+ * @typeParam TSource - Source object type passed to resolvers.
2124
+ * @typeParam TContext - Context object type passed to resolvers.
2125
+ */
421
2126
  export type GraphQLTypeResolver<TSource, TContext> = (value: TSource, context: TContext, info: GraphQLResolveInfo, abstractType: GraphQLAbstractType) => PromiseOrValue<string | undefined>;
2127
+ /**
2128
+ * Checks whether a runtime value belongs to a GraphQL object type.
2129
+ * @typeParam TAbstract - Runtime value type used for abstract type resolution.
2130
+ * @typeParam TContext - Context object type passed to resolvers.
2131
+ */
422
2132
  export type GraphQLIsTypeOfFn<TAbstract, TContext> = (value: TAbstract, context: TContext, info: GraphQLResolveInfo) => PromiseOrValue<boolean>;
2133
+ /**
2134
+ * Resolves the runtime value for a GraphQL field.
2135
+ * @typeParam TSource - Source object type passed to resolvers.
2136
+ * @typeParam TContext - Context object type passed to resolvers.
2137
+ * @typeParam TArgs - Argument object type passed to resolvers.
2138
+ * @typeParam TResult - Result value type.
2139
+ */
423
2140
  export type GraphQLFieldResolver<TSource, TContext, TArgs = any, TResult = unknown> = (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TResult;
2141
+ /** Utilities available from resolver info for tracking asynchronous work. */
424
2142
  export interface GraphQLResolveInfoHelpers {
425
2143
  /**
426
2144
  * Promise.all wrapper that allows rejected branches to be tracked
@@ -445,56 +2163,90 @@ export interface GraphQLResolveInfoHelpers {
445
2163
  * ]);
446
2164
  */
447
2165
  readonly promiseAll: <T>(values: ReadonlyArray<PromiseLike<T> | T>) => Promise<Array<T>>;
2166
+ /** Tracks asynchronous work that should delay execution completion hooks. */
448
2167
  readonly track: (maybePromises: ReadonlyArray<unknown>) => void;
449
2168
  }
2169
+ /** Information about the currently executing GraphQL field. */
450
2170
  export interface GraphQLResolveInfo {
2171
+ /** The field name referenced by this schema coordinate. */
451
2172
  readonly fieldName: string;
2173
+ /** AST field nodes that contributed to the current field execution. */
452
2174
  readonly fieldNodes: ReadonlyArray<FieldNode>;
2175
+ /** GraphQL output type declared for the current field. */
453
2176
  readonly returnType: GraphQLOutputType;
2177
+ /** Object type that owns the current field. */
454
2178
  readonly parentType: GraphQLObjectType;
2179
+ /** Response path where this error occurred during execution. */
455
2180
  readonly path: Path;
2181
+ /** The schema used for validation or execution. */
456
2182
  readonly schema: GraphQLSchema;
2183
+ /** Fragment definitions in the operation document keyed by fragment name. */
457
2184
  readonly fragments: ObjMap<FragmentDefinitionNode>;
2185
+ /** Initial root value passed to the operation. */
458
2186
  readonly rootValue: unknown;
2187
+ /** The operation selected for execution. */
459
2188
  readonly operation: OperationDefinitionNode;
2189
+ /**
2190
+ * Coerced variable values and source metadata for this operation. Resolver
2191
+ * code that needs runtime variable values should read `variableValues.coerced`.
2192
+ */
460
2193
  readonly variableValues: VariableValues;
2194
+ /** Returns the AbortSignal supplied for this execution, if any. */
461
2195
  readonly getAbortSignal: () => AbortSignal | undefined;
2196
+ /** Returns helper functions for tracking asynchronous resolver work. */
462
2197
  readonly getAsyncHelpers: () => GraphQLResolveInfoHelpers;
463
2198
  }
464
2199
  /**
465
2200
  * Custom extensions
466
- *
467
2201
  * @remarks
468
2202
  * Use a unique identifier name for your extension, for example the name of
469
2203
  * your library or project. Do not use a shortened identifier as this increases
470
2204
  * the risk of conflicts. We recommend you add at most one extension field,
471
2205
  * an object which can contain all the values you need.
472
- *
473
2206
  * We've provided these template arguments because this is an open type and
474
2207
  * you may find them useful.
2208
+ * @typeParam _TSource - Reserved source type parameter for extension typing.
2209
+ * @typeParam _TContext - Reserved context type parameter for extension typing.
2210
+ * @typeParam _TArgs - Reserved argument type parameter for extension typing.
475
2211
  */
476
2212
  export interface GraphQLFieldExtensions<_TSource, _TContext, _TArgs = any> {
477
2213
  [attributeName: string | symbol]: unknown;
478
2214
  }
2215
+ /**
2216
+ * Configuration used to define a GraphQL field.
2217
+ * @typeParam TSource - Source object type passed to resolvers.
2218
+ * @typeParam TContext - Context object type passed to resolvers.
2219
+ * @typeParam TArgs - Argument object type passed to resolvers.
2220
+ */
479
2221
  export interface GraphQLFieldConfig<TSource, TContext, TArgs = any> {
2222
+ /** Human-readable description for this schema element, if provided. */
480
2223
  description?: Maybe<string>;
2224
+ /** The GraphQL type reference or runtime type for this element. */
481
2225
  type: GraphQLOutputType;
2226
+ /** Arguments accepted by this field or directive. */
482
2227
  args?: GraphQLFieldConfigArgumentMap | undefined;
2228
+ /** Resolver function used to produce this field value. */
483
2229
  resolve?: GraphQLFieldResolver<TSource, TContext, TArgs> | undefined;
2230
+ /** Resolver function used to create a subscription event stream for this field. */
484
2231
  subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs> | undefined;
2232
+ /** Reason this element is deprecated, if one was provided. */
485
2233
  deprecationReason?: Maybe<string>;
2234
+ /** Extension fields to include in the formatted result. */
486
2235
  extensions?: Maybe<Readonly<GraphQLFieldExtensions<TSource, TContext, TArgs>>>;
2236
+ /** AST node from which this schema element was built, if available. */
487
2237
  astNode?: Maybe<FieldDefinitionNode>;
488
2238
  }
2239
+ /** @internal */
489
2240
  export interface GraphQLFieldNormalizedConfig<TSource, TContext, TArgs = any> extends GraphQLFieldConfig<TSource, TContext, TArgs> {
490
2241
  args: GraphQLFieldNormalizedConfigArgumentMap;
491
2242
  extensions: Readonly<GraphQLFieldExtensions<TSource, TContext, TArgs>>;
492
2243
  }
2244
+ /** A map of argument names to argument configuration objects. */
493
2245
  export type GraphQLFieldConfigArgumentMap = ObjMap<GraphQLArgumentConfig>;
2246
+ /** @internal */
494
2247
  export type GraphQLFieldNormalizedConfigArgumentMap = ObjMap<GraphQLArgumentNormalizedConfig>;
495
2248
  /**
496
2249
  * Custom extensions
497
- *
498
2250
  * @remarks
499
2251
  * Use a unique identifier name for your extension, for example the name of
500
2252
  * your library or project. Do not use a shortened identifier as this increases
@@ -504,69 +2256,330 @@ export type GraphQLFieldNormalizedConfigArgumentMap = ObjMap<GraphQLArgumentNorm
504
2256
  export interface GraphQLArgumentExtensions {
505
2257
  [attributeName: string | symbol]: unknown;
506
2258
  }
2259
+ /** Configuration used to define a GraphQL argument. */
507
2260
  export interface GraphQLArgumentConfig {
2261
+ /** Human-readable description for this schema element, if provided. */
508
2262
  description?: Maybe<string>;
2263
+ /** The GraphQL type reference or runtime type for this element. */
509
2264
  type: GraphQLInputType;
510
- /** @deprecated use default instead, defaultValue will be removed in v18 **/
2265
+ /**
2266
+ * Deprecated legacy default value for this argument. Use `default` instead.
2267
+ * @deprecated use `default` instead, `defaultValue` will be removed in v18
2268
+ */
511
2269
  defaultValue?: unknown;
2270
+ /** Default value represented as either a runtime value or a GraphQL literal. */
512
2271
  default?: GraphQLDefaultInput | undefined;
2272
+ /** Reason this element is deprecated, if one was provided. */
513
2273
  deprecationReason?: Maybe<string>;
2274
+ /** Extension fields to include in the formatted result. */
514
2275
  extensions?: Maybe<Readonly<GraphQLArgumentExtensions>>;
2276
+ /** AST node from which this schema element was built, if available. */
515
2277
  astNode?: Maybe<InputValueDefinitionNode>;
516
2278
  }
2279
+ /** @internal */
517
2280
  export interface GraphQLArgumentNormalizedConfig extends GraphQLArgumentConfig {
518
2281
  default: GraphQLDefaultInput | undefined;
519
2282
  extensions: Readonly<GraphQLArgumentExtensions>;
520
2283
  }
2284
+ /**
2285
+ * A map of field names to field configuration objects.
2286
+ * @typeParam TSource - Source object type passed to resolvers.
2287
+ * @typeParam TContext - Context object type passed to resolvers.
2288
+ */
521
2289
  export type GraphQLFieldConfigMap<TSource, TContext> = ObjMap<GraphQLFieldConfig<TSource, TContext>>;
2290
+ /** @internal */
522
2291
  export type GraphQLFieldNormalizedConfigMap<TSource, TContext> = ObjMap<GraphQLFieldNormalizedConfig<TSource, TContext>>;
2292
+ /**
2293
+ * A resolved GraphQL field definition.
2294
+ * @typeParam TSource - Source object type passed to resolvers.
2295
+ * @typeParam TContext - Context object type passed to resolvers.
2296
+ * @typeParam TArgs - Argument object type passed to resolvers.
2297
+ */
523
2298
  export declare class GraphQLField<TSource = any, TContext = any, TArgs = any> implements GraphQLSchemaElement {
524
- readonly __kind: symbol;
2299
+ /** Object or interface type that owns this field, if known. */
525
2300
  parentType: GraphQLObjectType<TSource, TContext> | GraphQLInterfaceType<TSource, TContext> | undefined;
2301
+ /** The GraphQL name for this schema element. */
526
2302
  name: string;
2303
+ /** Human-readable description for this schema element, if provided. */
527
2304
  description: Maybe<string>;
2305
+ /** The GraphQL type reference or runtime type for this element. */
528
2306
  type: GraphQLOutputType;
2307
+ /** Arguments accepted by this field or directive. */
529
2308
  args: ReadonlyArray<GraphQLArgument>;
2309
+ /** Resolver function used to produce this field value. */
530
2310
  resolve?: GraphQLFieldResolver<TSource, TContext, TArgs> | undefined;
2311
+ /** Resolver function used to create a subscription event stream for this field. */
531
2312
  subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs> | undefined;
2313
+ /** Reason this element is deprecated, if one was provided. */
532
2314
  deprecationReason: Maybe<string>;
2315
+ /** Extension fields to include in the formatted result. */
533
2316
  extensions: Readonly<GraphQLFieldExtensions<TSource, TContext, TArgs>>;
2317
+ /** AST node from which this schema element was built, if available. */
534
2318
  astNode: Maybe<FieldDefinitionNode>;
2319
+ /**
2320
+ * Creates a resolved GraphQL field definition.
2321
+ * @param parentType - Object or interface type that owns this field, if known.
2322
+ * @param name - Field name.
2323
+ * @param config - Field configuration.
2324
+ * @example
2325
+ * ```ts
2326
+ * import { parse } from 'graphql/language';
2327
+ * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type';
2328
+ *
2329
+ * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });
2330
+ * const document = parse('type Query { greeting: String }');
2331
+ * const fieldNode = document.definitions[0].fields[0];
2332
+ * const field = new GraphQLField(Query, 'greeting', {
2333
+ * description: 'Greeting text.',
2334
+ * type: GraphQLString,
2335
+ * args: {
2336
+ * name: { type: GraphQLString, default: { value: 'world' } },
2337
+ * },
2338
+ * resolve: (_source, { name }) => `Hello, ${name}!`,
2339
+ * subscribe: async function* () {
2340
+ * yield { greeting: 'Hello!' };
2341
+ * },
2342
+ * deprecationReason: 'Use hello.',
2343
+ * extensions: { cacheSeconds: 60 },
2344
+ * astNode: fieldNode,
2345
+ * });
2346
+ *
2347
+ * field.parentType; // => Query
2348
+ * field.name; // => 'greeting'
2349
+ * field.args[0].default.value; // => 'world'
2350
+ * typeof field.subscribe; // => 'function'
2351
+ * field.deprecationReason; // => 'Use hello.'
2352
+ * field.astNode; // => fieldNode
2353
+ * ```
2354
+ */
535
2355
  constructor(parentType: GraphQLObjectType<TSource, TContext> | GraphQLInterfaceType<TSource, TContext> | undefined, name: string, config: GraphQLFieldConfig<TSource, TContext, TArgs>);
2356
+ /**
2357
+ * Returns the value used by `Object.prototype.toString`.
2358
+ * @returns The built-in string tag for this object.
2359
+ */
536
2360
  get [Symbol.toStringTag](): string;
2361
+ /**
2362
+ * Returns a normalized configuration object for this field.
2363
+ * @returns A configuration object that can be used to recreate this field.
2364
+ * @example
2365
+ * ```ts
2366
+ * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type';
2367
+ *
2368
+ * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });
2369
+ * const field = new GraphQLField(Query, 'greeting', {
2370
+ * type: GraphQLString,
2371
+ * extensions: { cacheSeconds: 60 },
2372
+ * });
2373
+ *
2374
+ * field.toConfig().type; // => GraphQLString
2375
+ * field.toConfig().extensions; // => { cacheSeconds: 60 }
2376
+ * ```
2377
+ */
537
2378
  toConfig(): GraphQLFieldNormalizedConfig<TSource, TContext, TArgs>;
2379
+ /**
2380
+ * Returns this field as a schema coordinate string.
2381
+ * @returns The field coordinate.
2382
+ * @example
2383
+ * ```ts
2384
+ * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type';
2385
+ *
2386
+ * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });
2387
+ * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });
2388
+ *
2389
+ * field.toString(); // => 'Query.greeting'
2390
+ * ```
2391
+ */
538
2392
  toString(): string;
2393
+ /**
2394
+ * Returns the JSON representation used when this object is serialized.
2395
+ * @returns The field coordinate.
2396
+ * @example
2397
+ * ```ts
2398
+ * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type';
2399
+ *
2400
+ * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });
2401
+ * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });
2402
+ *
2403
+ * JSON.stringify(field); // => '"Query.greeting"'
2404
+ * ```
2405
+ */
539
2406
  toJSON(): string;
540
2407
  }
2408
+ /** A resolved GraphQL argument definition. */
541
2409
  export declare class GraphQLArgument implements GraphQLSchemaElement {
542
- readonly __kind: symbol;
2410
+ /** Field or directive that owns this argument. */
543
2411
  parent: GraphQLField | GraphQLDirective;
2412
+ /** The GraphQL name for this schema element. */
544
2413
  name: string;
2414
+ /** Human-readable description for this schema element, if provided. */
545
2415
  description: Maybe<string>;
2416
+ /** The GraphQL type reference or runtime type for this element. */
546
2417
  type: GraphQLInputType;
2418
+ /**
2419
+ * Deprecated legacy default value used when no explicit value is supplied.
2420
+ * Use `default` instead.
2421
+ * @deprecated use `default` instead, `defaultValue` will be removed in v18
2422
+ */
547
2423
  defaultValue: unknown;
2424
+ /** Default value represented as either a runtime value or a GraphQL literal. */
548
2425
  default: GraphQLDefaultInput | undefined;
2426
+ /** Reason this element is deprecated, if one was provided. */
549
2427
  deprecationReason: Maybe<string>;
2428
+ /** Extension fields to include in the formatted result. */
550
2429
  extensions: Readonly<GraphQLArgumentExtensions>;
2430
+ /** AST node from which this schema element was built, if available. */
551
2431
  astNode: Maybe<InputValueDefinitionNode>;
2432
+ /**
2433
+ * Creates a resolved GraphQL argument definition.
2434
+ * @param parent - Field or directive that owns this argument.
2435
+ * @param name - Argument name.
2436
+ * @param config - Argument configuration.
2437
+ * @example
2438
+ * ```ts
2439
+ * import {
2440
+ * GraphQLArgument,
2441
+ * GraphQLField,
2442
+ * GraphQLObjectType,
2443
+ * GraphQLString,
2444
+ * } from 'graphql/type';
2445
+ *
2446
+ * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });
2447
+ * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });
2448
+ * const arg = new GraphQLArgument(field, 'name', {
2449
+ * type: GraphQLString,
2450
+ * default: { value: 'world' },
2451
+ * });
2452
+ *
2453
+ * arg.parent; // => field
2454
+ * arg.name; // => 'name'
2455
+ * arg.default.value; // => 'world'
2456
+ * ```
2457
+ */
552
2458
  constructor(parent: GraphQLField | GraphQLDirective, name: string, config: GraphQLArgumentConfig);
2459
+ /**
2460
+ * Returns the value used by `Object.prototype.toString`.
2461
+ * @returns The built-in string tag for this object.
2462
+ */
553
2463
  get [Symbol.toStringTag](): string;
2464
+ /**
2465
+ * Returns a normalized configuration object for this argument.
2466
+ * @returns A configuration object that can be used to recreate this argument.
2467
+ * @example
2468
+ * ```ts
2469
+ * import {
2470
+ * GraphQLArgument,
2471
+ * GraphQLField,
2472
+ * GraphQLObjectType,
2473
+ * GraphQLString,
2474
+ * } from 'graphql/type';
2475
+ *
2476
+ * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });
2477
+ * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });
2478
+ * const arg = new GraphQLArgument(field, 'name', {
2479
+ * type: GraphQLString,
2480
+ * default: { value: 'world' },
2481
+ * });
2482
+ *
2483
+ * arg.toConfig().default.value; // => 'world'
2484
+ * ```
2485
+ */
554
2486
  toConfig(): GraphQLArgumentNormalizedConfig;
2487
+ /**
2488
+ * Returns this argument as a schema coordinate string.
2489
+ * @returns The argument coordinate.
2490
+ * @example
2491
+ * ```ts
2492
+ * import {
2493
+ * GraphQLArgument,
2494
+ * GraphQLField,
2495
+ * GraphQLObjectType,
2496
+ * GraphQLString,
2497
+ * } from 'graphql/type';
2498
+ *
2499
+ * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });
2500
+ * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });
2501
+ * const arg = new GraphQLArgument(field, 'name', { type: GraphQLString });
2502
+ *
2503
+ * arg.toString(); // => 'Query.greeting(name:)'
2504
+ * ```
2505
+ */
555
2506
  toString(): string;
2507
+ /**
2508
+ * Returns the JSON representation used when this object is serialized.
2509
+ * @returns The argument coordinate.
2510
+ * @example
2511
+ * ```ts
2512
+ * import {
2513
+ * GraphQLArgument,
2514
+ * GraphQLField,
2515
+ * GraphQLObjectType,
2516
+ * GraphQLString,
2517
+ * } from 'graphql/type';
2518
+ *
2519
+ * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });
2520
+ * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });
2521
+ * const arg = new GraphQLArgument(field, 'name', { type: GraphQLString });
2522
+ *
2523
+ * JSON.stringify(arg); // => '"Query.greeting(name:)"'
2524
+ * ```
2525
+ */
556
2526
  toJSON(): string;
557
2527
  }
2528
+ /**
2529
+ * Returns true when the argument is non-null and has no default value.
2530
+ * @param arg - The argument definition to inspect.
2531
+ * @returns True when the argument is non-null and has no default value.
2532
+ * @example
2533
+ * ```ts
2534
+ * import {
2535
+ * GraphQLArgument,
2536
+ * GraphQLField,
2537
+ * GraphQLInt,
2538
+ * GraphQLNonNull,
2539
+ * GraphQLObjectType,
2540
+ * GraphQLString,
2541
+ * isRequiredArgument,
2542
+ * } from 'graphql/type';
2543
+ *
2544
+ * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });
2545
+ * const field = new GraphQLField(Query, 'reviews', { type: GraphQLString });
2546
+ * const requiredArgument = new GraphQLArgument(field, 'id', {
2547
+ * type: new GraphQLNonNull(GraphQLInt),
2548
+ * });
2549
+ * const optionalArgument = new GraphQLArgument(field, 'name', {
2550
+ * type: GraphQLString,
2551
+ * });
2552
+ * const argumentWithDefault = new GraphQLArgument(field, 'limit', {
2553
+ * type: new GraphQLNonNull(GraphQLInt),
2554
+ * default: { value: 10 },
2555
+ * });
2556
+ *
2557
+ * isRequiredArgument(requiredArgument); // => true
2558
+ * isRequiredArgument(optionalArgument); // => false
2559
+ * isRequiredArgument(argumentWithDefault); // => false
2560
+ * ```
2561
+ */
558
2562
  export declare function isRequiredArgument(arg: GraphQLArgument | GraphQLVariableSignature): boolean;
2563
+ /**
2564
+ * A map of field names to resolved field definitions.
2565
+ * @typeParam TSource - Source object type passed to resolvers.
2566
+ * @typeParam TContext - Context object type passed to resolvers.
2567
+ */
559
2568
  export type GraphQLFieldMap<TSource, TContext> = ObjMap<GraphQLField<TSource, TContext>>;
2569
+ /** Default input represented as either a runtime value or a GraphQL literal. */
560
2570
  export type GraphQLDefaultInput = {
2571
+ /** Runtime default value. */
561
2572
  value: unknown;
2573
+ /** GraphQL literal default value is not provided in this variant. */
562
2574
  literal?: never;
563
2575
  } | {
2576
+ /** GraphQL literal default value. */
564
2577
  literal: ConstValueNode;
2578
+ /** Runtime default value is not provided in this variant. */
565
2579
  value?: never;
566
2580
  };
567
2581
  /**
568
2582
  * Custom extensions
569
- *
570
2583
  * @remarks
571
2584
  * Use a unique identifier name for your extension, for example the name of
572
2585
  * your library or project. Do not use a shortened identifier as this increases
@@ -583,9 +2596,9 @@ export interface GraphQLInterfaceTypeExtensions {
583
2596
  * is used to describe what types are possible, what fields are in common across
584
2597
  * all types, as well as a function to determine which type is actually used
585
2598
  * when the field is resolved.
586
- *
587
- * Example:
588
- *
2599
+ * @typeParam TSource - Source object type passed to resolvers.
2600
+ * @typeParam TContext - Context object type passed to resolvers.
2601
+ * @example
589
2602
  * ```ts
590
2603
  * const EntityType = new GraphQLInterfaceType({
591
2604
  * name: 'Entity',
@@ -596,27 +2609,223 @@ export interface GraphQLInterfaceTypeExtensions {
596
2609
  * ```
597
2610
  */
598
2611
  export declare class GraphQLInterfaceType<TSource = any, TContext = any> implements GraphQLSchemaElement {
599
- readonly __kind: symbol;
2612
+ /** The GraphQL name for this schema element. */
600
2613
  name: string;
2614
+ /** Human-readable description for this schema element, if provided. */
601
2615
  description: Maybe<string>;
2616
+ /** Function that resolves the concrete object type for this abstract type. */
602
2617
  resolveType: Maybe<GraphQLTypeResolver<TSource, TContext>>;
2618
+ /** Extension fields to include in the formatted result. */
603
2619
  extensions: Readonly<GraphQLInterfaceTypeExtensions>;
2620
+ /** AST node from which this schema element was built, if available. */
604
2621
  astNode: Maybe<InterfaceTypeDefinitionNode>;
2622
+ /** AST extension nodes applied to this schema element. */
605
2623
  extensionASTNodes: ReadonlyArray<InterfaceTypeExtensionNode>;
606
2624
  private _fields;
607
2625
  private _interfaces;
2626
+ /**
2627
+ * Creates a GraphQLInterfaceType instance.
2628
+ * @param config - Configuration describing this object.
2629
+ * @example
2630
+ * ```ts
2631
+ * import { parse } from 'graphql/language';
2632
+ * import { GraphQLID, GraphQLInterfaceType, GraphQLNonNull } from 'graphql/type';
2633
+ *
2634
+ * const document = parse(`
2635
+ * interface Node {
2636
+ * id: ID!
2637
+ * }
2638
+ *
2639
+ * interface Resource implements Node {
2640
+ * id: ID!
2641
+ * }
2642
+ *
2643
+ * extend interface Resource {
2644
+ * url: String
2645
+ * }
2646
+ * `);
2647
+ *
2648
+ * const Node = new GraphQLInterfaceType({
2649
+ * name: 'Node',
2650
+ * fields: {
2651
+ * id: { type: new GraphQLNonNull(GraphQLID) },
2652
+ * },
2653
+ * });
2654
+ *
2655
+ * const Resource = new GraphQLInterfaceType({
2656
+ * name: 'Resource',
2657
+ * description: 'An addressable resource.',
2658
+ * interfaces: [Node],
2659
+ * fields: {
2660
+ * id: { type: new GraphQLNonNull(GraphQLID) },
2661
+ * },
2662
+ * resolveType: (value) => {
2663
+ * return typeof value === 'object' && value != null && 'url' in value
2664
+ * ? 'WebPage'
2665
+ * : null;
2666
+ * },
2667
+ * extensions: { abstract: true },
2668
+ * astNode: document.definitions[1],
2669
+ * extensionASTNodes: [ document.definitions[2] ],
2670
+ * });
2671
+ *
2672
+ * Resource.name; // => 'Resource'
2673
+ * Resource.getInterfaces(); // => [Node]
2674
+ * Object.keys(Resource.getFields()); // => ['id']
2675
+ * Resource.extensions; // => { abstract: true }
2676
+ * ```
2677
+ */
608
2678
  constructor(config: Readonly<GraphQLInterfaceTypeConfig<TSource, TContext>>);
2679
+ /**
2680
+ * Returns the value used by `Object.prototype.toString`.
2681
+ * @returns The built-in string tag for this object.
2682
+ */
609
2683
  get [Symbol.toStringTag](): string;
2684
+ /**
2685
+ * Returns the fields defined by this type.
2686
+ * @returns The fields keyed by field name.
2687
+ * @example
2688
+ * ```ts
2689
+ * import { buildSchema } from 'graphql/utilities';
2690
+ * import { assertInterfaceType } from 'graphql/type';
2691
+ *
2692
+ * const schema = buildSchema(`
2693
+ * interface Node {
2694
+ * id: ID!
2695
+ * }
2696
+ *
2697
+ * type User implements Node {
2698
+ * id: ID!
2699
+ * }
2700
+ *
2701
+ * type Query {
2702
+ * node: Node
2703
+ * }
2704
+ * `);
2705
+ *
2706
+ * const Node = assertInterfaceType(schema.getType('Node'));
2707
+ * const fields = Node.getFields();
2708
+ *
2709
+ * Object.keys(fields); // => ['id']
2710
+ * String(fields.id.type); // => 'ID!'
2711
+ * ```
2712
+ */
610
2713
  getFields(): GraphQLFieldMap<TSource, TContext>;
2714
+ /**
2715
+ * Returns the interfaces implemented by this type.
2716
+ * @returns The implemented interfaces.
2717
+ * @example
2718
+ * ```ts
2719
+ * import { buildSchema } from 'graphql/utilities';
2720
+ * import { assertInterfaceType } from 'graphql/type';
2721
+ *
2722
+ * const schema = buildSchema(`
2723
+ * interface Resource {
2724
+ * url: String!
2725
+ * }
2726
+ *
2727
+ * interface Image implements Resource {
2728
+ * url: String!
2729
+ * width: Int
2730
+ * }
2731
+ *
2732
+ * type Photo implements Resource & Image {
2733
+ * url: String!
2734
+ * width: Int
2735
+ * }
2736
+ *
2737
+ * type Query {
2738
+ * image: Image
2739
+ * }
2740
+ * `);
2741
+ *
2742
+ * const Image = assertInterfaceType(schema.getType('Image'));
2743
+ *
2744
+ * Image.getInterfaces().map((type) => type.name); // => ['Resource']
2745
+ * ```
2746
+ */
611
2747
  getInterfaces(): ReadonlyArray<GraphQLInterfaceType>;
2748
+ /**
2749
+ * Returns a normalized configuration object for this object.
2750
+ * @returns A configuration object that can be used to recreate this object.
2751
+ * @example
2752
+ * ```ts
2753
+ * import { GraphQLID, GraphQLInterfaceType, GraphQLNonNull } from 'graphql/type';
2754
+ *
2755
+ * const Node = new GraphQLInterfaceType({
2756
+ * name: 'Node',
2757
+ * fields: {
2758
+ * id: { type: new GraphQLNonNull(GraphQLID) },
2759
+ * },
2760
+ * });
2761
+ *
2762
+ * const config = Node.toConfig();
2763
+ * const NodeCopy = new GraphQLInterfaceType(config);
2764
+ *
2765
+ * String(config.fields.id.type); // => 'ID!'
2766
+ * String(NodeCopy.getFields().id.type); // => 'ID!'
2767
+ * ```
2768
+ */
612
2769
  toConfig(): GraphQLInterfaceTypeNormalizedConfig<TSource, TContext>;
2770
+ /**
2771
+ * Returns the schema coordinate identifying this interface type.
2772
+ * @returns The schema coordinate for this interface type.
2773
+ * @example
2774
+ * ```ts
2775
+ * import { buildSchema } from 'graphql/utilities';
2776
+ * import { assertInterfaceType } from 'graphql/type';
2777
+ *
2778
+ * const schema = buildSchema(`
2779
+ * interface Node {
2780
+ * id: ID!
2781
+ * }
2782
+ *
2783
+ * type User implements Node {
2784
+ * id: ID!
2785
+ * }
2786
+ *
2787
+ * type Query {
2788
+ * node: Node
2789
+ * }
2790
+ * `);
2791
+ *
2792
+ * const Node = assertInterfaceType(schema.getType('Node'));
2793
+ *
2794
+ * Node.toString(); // => 'Node'
2795
+ * ```
2796
+ */
613
2797
  toString(): string;
2798
+ /**
2799
+ * Returns the JSON representation used when this object is serialized.
2800
+ * @returns The JSON-serializable representation.
2801
+ * @example
2802
+ * ```ts
2803
+ * import { GraphQLInterfaceType, GraphQLString } from 'graphql/type';
2804
+ *
2805
+ * const Named = new GraphQLInterfaceType({
2806
+ * name: 'Named',
2807
+ * fields: { name: { type: GraphQLString } },
2808
+ * });
2809
+ *
2810
+ * Named.toJSON(); // => 'Named'
2811
+ * JSON.stringify({ type: Named }); // => '{"type":"Named"}'
2812
+ * ```
2813
+ */
614
2814
  toJSON(): string;
615
2815
  }
2816
+ /**
2817
+ * Configuration used to construct a GraphQLInterfaceType.
2818
+ * @typeParam TSource - Source object type passed to resolvers.
2819
+ * @typeParam TContext - Context object type passed to resolvers.
2820
+ */
616
2821
  export interface GraphQLInterfaceTypeConfig<TSource, TContext> {
2822
+ /** The GraphQL name for this schema element. */
617
2823
  name: string;
2824
+ /** Human-readable description for this schema element, if provided. */
618
2825
  description?: Maybe<string>;
2826
+ /** Interfaces implemented by this object or interface type. */
619
2827
  interfaces?: ThunkReadonlyArray<GraphQLInterfaceType> | undefined;
2828
+ /** Fields declared by this object, interface, input object, or literal. */
620
2829
  fields: ThunkObjMap<GraphQLFieldConfig<TSource, TContext>>;
621
2830
  /**
622
2831
  * Optionally provide a custom type resolver function. If one is not provided,
@@ -624,10 +2833,14 @@ export interface GraphQLInterfaceTypeConfig<TSource, TContext> {
624
2833
  * Object type.
625
2834
  */
626
2835
  resolveType?: Maybe<GraphQLTypeResolver<TSource, TContext>>;
2836
+ /** Extension fields to include in the formatted result. */
627
2837
  extensions?: Maybe<Readonly<GraphQLInterfaceTypeExtensions>>;
2838
+ /** AST node from which this schema element was built, if available. */
628
2839
  astNode?: Maybe<InterfaceTypeDefinitionNode>;
2840
+ /** AST extension nodes applied to this schema element. */
629
2841
  extensionASTNodes?: Maybe<ReadonlyArray<InterfaceTypeExtensionNode>>;
630
2842
  }
2843
+ /** @internal */
631
2844
  export interface GraphQLInterfaceTypeNormalizedConfig<TSource, TContext> extends GraphQLInterfaceTypeConfig<TSource, TContext> {
632
2845
  interfaces: ReadonlyArray<GraphQLInterfaceType>;
633
2846
  fields: GraphQLFieldNormalizedConfigMap<TSource, TContext>;
@@ -636,7 +2849,6 @@ export interface GraphQLInterfaceTypeNormalizedConfig<TSource, TContext> extends
636
2849
  }
637
2850
  /**
638
2851
  * Custom extensions
639
- *
640
2852
  * @remarks
641
2853
  * Use a unique identifier name for your extension, for example the name of
642
2854
  * your library or project. Do not use a shortened identifier as this increases
@@ -652,14 +2864,14 @@ export interface GraphQLUnionTypeExtensions {
652
2864
  * When a field can return one of a heterogeneous set of types, a Union type
653
2865
  * is used to describe what types are possible as well as providing a function
654
2866
  * to determine which type is actually used when the field is resolved.
655
- *
656
- * Example:
657
- *
2867
+ * @typeParam TSource - Source object type passed to resolvers.
2868
+ * @typeParam TContext - Context object type passed to resolvers.
2869
+ * @example
658
2870
  * ```ts
659
2871
  * const PetType = new GraphQLUnionType({
660
2872
  * name: 'Pet',
661
- * types: [ DogType, CatType ],
662
- * resolveType(value) {
2873
+ * types: [DogType, CatType],
2874
+ * resolveType: (value) => {
663
2875
  * if (value instanceof Dog) {
664
2876
  * return DogType;
665
2877
  * }
@@ -671,24 +2883,183 @@ export interface GraphQLUnionTypeExtensions {
671
2883
  * ```
672
2884
  */
673
2885
  export declare class GraphQLUnionType<TSource = any, TContext = any> implements GraphQLSchemaElement {
674
- readonly __kind: symbol;
2886
+ /** The GraphQL name for this schema element. */
675
2887
  name: string;
2888
+ /** Human-readable description for this schema element, if provided. */
676
2889
  description: Maybe<string>;
2890
+ /** Function that resolves the concrete object type for this abstract type. */
677
2891
  resolveType: Maybe<GraphQLTypeResolver<TSource, TContext>>;
2892
+ /** Extension fields to include in the formatted result. */
678
2893
  extensions: Readonly<GraphQLUnionTypeExtensions>;
2894
+ /** AST node from which this schema element was built, if available. */
679
2895
  astNode: Maybe<UnionTypeDefinitionNode>;
2896
+ /** AST extension nodes applied to this schema element. */
680
2897
  extensionASTNodes: ReadonlyArray<UnionTypeExtensionNode>;
681
2898
  private _types;
2899
+ /**
2900
+ * Creates a GraphQLUnionType instance.
2901
+ * @param config - Configuration describing this object.
2902
+ * @example
2903
+ * ```ts
2904
+ * import { parse } from 'graphql/language';
2905
+ * import { GraphQLObjectType, GraphQLString, GraphQLUnionType } from 'graphql/type';
2906
+ *
2907
+ * const document = parse(`
2908
+ * union Media = Photo | Video
2909
+ *
2910
+ * extend union Media = Audio
2911
+ * `);
2912
+ *
2913
+ * const Photo = new GraphQLObjectType({
2914
+ * name: 'Photo',
2915
+ * fields: { url: { type: GraphQLString } },
2916
+ * });
2917
+ * const Video = new GraphQLObjectType({
2918
+ * name: 'Video',
2919
+ * fields: { url: { type: GraphQLString } },
2920
+ * });
2921
+ *
2922
+ * const Media = new GraphQLUnionType({
2923
+ * name: 'Media',
2924
+ * description: 'Media that can appear in a search result.',
2925
+ * types: [Photo, Video],
2926
+ * resolveType: (value) => {
2927
+ * return typeof value === 'object' && value != null && 'duration' in value
2928
+ * ? 'Video'
2929
+ * : 'Photo';
2930
+ * },
2931
+ * extensions: { searchable: true },
2932
+ * astNode: document.definitions[0],
2933
+ * extensionASTNodes: [ document.definitions[1] ],
2934
+ * });
2935
+ *
2936
+ * Media.description; // => 'Media that can appear in a search result.'
2937
+ * Media.getTypes().map((type) => type.name); // => ['Photo', 'Video']
2938
+ * Media.extensions; // => { searchable: true }
2939
+ * ```
2940
+ */
682
2941
  constructor(config: Readonly<GraphQLUnionTypeConfig<TSource, TContext>>);
2942
+ /**
2943
+ * Returns the value used by `Object.prototype.toString`.
2944
+ * @returns The built-in string tag for this object.
2945
+ */
683
2946
  get [Symbol.toStringTag](): string;
2947
+ /**
2948
+ * Returns the object types included in this union.
2949
+ * @returns The union member object types.
2950
+ * @example
2951
+ * ```ts
2952
+ * import { buildSchema } from 'graphql/utilities';
2953
+ * import { assertUnionType } from 'graphql/type';
2954
+ *
2955
+ * const schema = buildSchema(`
2956
+ * type Photo {
2957
+ * url: String!
2958
+ * }
2959
+ *
2960
+ * type Video {
2961
+ * url: String!
2962
+ * }
2963
+ *
2964
+ * union Media = Photo | Video
2965
+ *
2966
+ * type Query {
2967
+ * media: [Media]
2968
+ * }
2969
+ * `);
2970
+ *
2971
+ * const Media = assertUnionType(schema.getType('Media'));
2972
+ *
2973
+ * Media.getTypes().map((type) => type.name); // => ['Photo', 'Video']
2974
+ * ```
2975
+ */
684
2976
  getTypes(): ReadonlyArray<GraphQLObjectType>;
2977
+ /**
2978
+ * Returns a normalized configuration object for this object.
2979
+ * @returns A configuration object that can be used to recreate this object.
2980
+ * @example
2981
+ * ```ts
2982
+ * import { GraphQLObjectType, GraphQLString, GraphQLUnionType } from 'graphql/type';
2983
+ *
2984
+ * const Photo = new GraphQLObjectType({
2985
+ * name: 'Photo',
2986
+ * fields: { url: { type: GraphQLString } },
2987
+ * });
2988
+ * const Video = new GraphQLObjectType({
2989
+ * name: 'Video',
2990
+ * fields: { url: { type: GraphQLString } },
2991
+ * });
2992
+ * const Media = new GraphQLUnionType({
2993
+ * name: 'Media',
2994
+ * types: [Photo, Video],
2995
+ * });
2996
+ *
2997
+ * const config = Media.toConfig();
2998
+ * const MediaCopy = new GraphQLUnionType(config);
2999
+ *
3000
+ * MediaCopy.getTypes().map((type) => type.name); // => ['Photo', 'Video']
3001
+ * ```
3002
+ */
685
3003
  toConfig(): GraphQLUnionTypeNormalizedConfig<TSource, TContext>;
3004
+ /**
3005
+ * Returns the schema coordinate identifying this union type.
3006
+ * @returns The schema coordinate for this union type.
3007
+ * @example
3008
+ * ```ts
3009
+ * import { buildSchema } from 'graphql/utilities';
3010
+ * import { assertUnionType } from 'graphql/type';
3011
+ *
3012
+ * const schema = buildSchema(`
3013
+ * type Photo {
3014
+ * url: String!
3015
+ * }
3016
+ *
3017
+ * union SearchResult = Photo
3018
+ *
3019
+ * type Query {
3020
+ * search: [SearchResult]
3021
+ * }
3022
+ * `);
3023
+ *
3024
+ * const SearchResult = assertUnionType(schema.getType('SearchResult'));
3025
+ *
3026
+ * SearchResult.toString(); // => 'SearchResult'
3027
+ * ```
3028
+ */
686
3029
  toString(): string;
3030
+ /**
3031
+ * Returns the JSON representation used when this object is serialized.
3032
+ * @returns The JSON-serializable representation.
3033
+ * @example
3034
+ * ```ts
3035
+ * import { GraphQLObjectType, GraphQLString, GraphQLUnionType } from 'graphql/type';
3036
+ *
3037
+ * const Photo = new GraphQLObjectType({
3038
+ * name: 'Photo',
3039
+ * fields: { url: { type: GraphQLString } },
3040
+ * });
3041
+ * const SearchResult = new GraphQLUnionType({
3042
+ * name: 'SearchResult',
3043
+ * types: [Photo],
3044
+ * });
3045
+ *
3046
+ * SearchResult.toJSON(); // => 'SearchResult'
3047
+ * JSON.stringify({ type: SearchResult }); // => '{"type":"SearchResult"}'
3048
+ * ```
3049
+ */
687
3050
  toJSON(): string;
688
3051
  }
3052
+ /**
3053
+ * Configuration used to construct a GraphQLUnionType.
3054
+ * @typeParam TSource - Source object type passed to resolvers.
3055
+ * @typeParam TContext - Context object type passed to resolvers.
3056
+ */
689
3057
  export interface GraphQLUnionTypeConfig<TSource, TContext> {
3058
+ /** The GraphQL name for this schema element. */
690
3059
  name: string;
3060
+ /** Human-readable description for this schema element, if provided. */
691
3061
  description?: Maybe<string>;
3062
+ /** Object types that belong to this union type. */
692
3063
  types: ThunkReadonlyArray<GraphQLObjectType>;
693
3064
  /**
694
3065
  * Optionally provide a custom type resolver function. If one is not provided,
@@ -696,10 +3067,14 @@ export interface GraphQLUnionTypeConfig<TSource, TContext> {
696
3067
  * Object type.
697
3068
  */
698
3069
  resolveType?: Maybe<GraphQLTypeResolver<TSource, TContext>>;
3070
+ /** Extension fields to include in the formatted result. */
699
3071
  extensions?: Maybe<Readonly<GraphQLUnionTypeExtensions>>;
3072
+ /** AST node from which this schema element was built, if available. */
700
3073
  astNode?: Maybe<UnionTypeDefinitionNode>;
3074
+ /** AST extension nodes applied to this schema element. */
701
3075
  extensionASTNodes?: Maybe<ReadonlyArray<UnionTypeExtensionNode>>;
702
3076
  }
3077
+ /** @internal */
703
3078
  export interface GraphQLUnionTypeNormalizedConfig<TSource, TContext> extends GraphQLUnionTypeConfig<TSource, TContext> {
704
3079
  types: ReadonlyArray<GraphQLObjectType>;
705
3080
  extensions: Readonly<GraphQLUnionTypeExtensions>;
@@ -707,7 +3082,6 @@ export interface GraphQLUnionTypeNormalizedConfig<TSource, TContext> extends Gra
707
3082
  }
708
3083
  /**
709
3084
  * Custom extensions
710
- *
711
3085
  * @remarks
712
3086
  * Use a unique identifier name for your extension, for example the name of
713
3087
  * your library or project. Do not use a shortened identifier as this increases
@@ -720,72 +3094,417 @@ export interface GraphQLEnumTypeExtensions {
720
3094
  /**
721
3095
  * Enum Type Definition
722
3096
  *
723
- * Some leaf values of requests and input values are Enums. GraphQL coerces
724
- * Enum values as strings, however internally Enums can be represented by any
725
- * kind of type, often integers.
726
- *
727
- * Example:
728
- *
3097
+ * Enum types define leaf values whose serialized form is one of a fixed set
3098
+ * of GraphQL enum names. Internally, enum values can map to any runtime value,
3099
+ * often integers.
3100
+ * @example
729
3101
  * ```ts
3102
+ * import { GraphQLEnumType } from 'graphql/type';
3103
+ *
730
3104
  * const RGBType = new GraphQLEnumType({
731
3105
  * name: 'RGB',
732
3106
  * values: {
733
3107
  * RED: { value: 0 },
734
3108
  * GREEN: { value: 1 },
735
- * BLUE: { value: 2 }
736
- * }
3109
+ * BLUE: { value: 2 },
3110
+ * },
737
3111
  * });
3112
+ *
3113
+ * RGBType.getValue('GREEN')?.value; // => 1
738
3114
  * ```
739
3115
  *
740
3116
  * Note: If a value is not provided in a definition, the name of the enum value
741
3117
  * will be used as its internal value.
742
3118
  */
743
3119
  export declare class GraphQLEnumType/* <T> */ implements GraphQLSchemaElement {
744
- readonly __kind: symbol;
3120
+ /** The GraphQL name for this schema element. */
745
3121
  name: string;
3122
+ /** Human-readable description for this schema element, if provided. */
746
3123
  description: Maybe<string>;
3124
+ /** Extension fields to include in the formatted result. */
747
3125
  extensions: Readonly<GraphQLEnumTypeExtensions>;
3126
+ /** AST node from which this schema element was built, if available. */
748
3127
  astNode: Maybe<EnumTypeDefinitionNode>;
3128
+ /** AST extension nodes applied to this schema element. */
749
3129
  extensionASTNodes: ReadonlyArray<EnumTypeExtensionNode>;
750
3130
  private _values;
751
3131
  private _valueLookup;
752
3132
  private _nameLookup;
3133
+ /**
3134
+ * Creates a GraphQLEnumType instance.
3135
+ * @param config - Configuration describing this object.
3136
+ * @example
3137
+ * ```ts
3138
+ * import { parse } from 'graphql/language';
3139
+ * import { GraphQLEnumType } from 'graphql/type';
3140
+ *
3141
+ * const document = parse(`
3142
+ * enum Episode {
3143
+ * NEW_HOPE
3144
+ * EMPIRE
3145
+ * JEDI
3146
+ * }
3147
+ *
3148
+ * extend enum Episode {
3149
+ * FORCE_AWAKENS
3150
+ * }
3151
+ * `);
3152
+ * const definition = document.definitions[0];
3153
+ *
3154
+ * const Episode = new GraphQLEnumType({
3155
+ * name: 'Episode',
3156
+ * description: 'A Star Wars film episode.',
3157
+ * values: {
3158
+ * NEW_HOPE: {
3159
+ * value: 4,
3160
+ * description: 'Released in 1977.',
3161
+ * extensions: { trilogy: 'original' },
3162
+ * astNode: definition.values[0],
3163
+ * },
3164
+ * EMPIRE: { value: 5, astNode: definition.values[1] },
3165
+ * JEDI: {
3166
+ * value: 6,
3167
+ * deprecationReason: 'Use RETURN_OF_THE_JEDI.',
3168
+ * astNode: definition.values[2],
3169
+ * },
3170
+ * },
3171
+ * extensions: { catalog: 'films' },
3172
+ * astNode: definition,
3173
+ * extensionASTNodes: [ document.definitions[1] ],
3174
+ * });
3175
+ *
3176
+ * Episode.description; // => 'A Star Wars film episode.'
3177
+ * Episode.coerceOutputValue(5); // => 'EMPIRE'
3178
+ * Episode.coerceInputValue('JEDI'); // => 6
3179
+ * Episode.getValue('JEDI').deprecationReason; // => 'Use RETURN_OF_THE_JEDI.'
3180
+ * Episode.extensions; // => { catalog: 'films' }
3181
+ * ```
3182
+ */
753
3183
  constructor(config: Readonly<GraphQLEnumTypeConfig>);
3184
+ /**
3185
+ * Returns the value used by `Object.prototype.toString`.
3186
+ * @returns The built-in string tag for this object.
3187
+ */
754
3188
  get [Symbol.toStringTag](): string;
3189
+ /**
3190
+ * Returns the values defined by this enum type.
3191
+ * @returns Enum value definitions in schema order.
3192
+ * @example
3193
+ * ```ts
3194
+ * import { buildSchema } from 'graphql/utilities';
3195
+ * import { assertEnumType } from 'graphql/type';
3196
+ *
3197
+ * const schema = buildSchema(`
3198
+ * enum Episode {
3199
+ * NEW_HOPE
3200
+ * EMPIRE
3201
+ * JEDI
3202
+ * }
3203
+ *
3204
+ * type Query {
3205
+ * episode: Episode
3206
+ * }
3207
+ * `);
3208
+ *
3209
+ * const Episode = assertEnumType(schema.getType('Episode'));
3210
+ *
3211
+ * Episode.getValues().map((value) => value.name); // => ['NEW_HOPE', 'EMPIRE', 'JEDI']
3212
+ * ```
3213
+ */
755
3214
  getValues(): ReadonlyArray<GraphQLEnumValue>;
3215
+ /**
3216
+ * Returns the enum value definition for a value name.
3217
+ * @param name - The GraphQL name to look up.
3218
+ * @returns The matching enum value definition, if it exists.
3219
+ * @example
3220
+ * ```ts
3221
+ * import { buildSchema } from 'graphql/utilities';
3222
+ * import { assertEnumType } from 'graphql/type';
3223
+ *
3224
+ * const schema = buildSchema(`
3225
+ * enum Episode {
3226
+ * NEW_HOPE
3227
+ * EMPIRE
3228
+ * }
3229
+ *
3230
+ * type Query {
3231
+ * episode: Episode
3232
+ * }
3233
+ * `);
3234
+ *
3235
+ * const Episode = assertEnumType(schema.getType('Episode'));
3236
+ *
3237
+ * Episode.getValue('EMPIRE')?.name; // => 'EMPIRE'
3238
+ * Episode.getValue('JEDI'); // => undefined
3239
+ * ```
3240
+ */
756
3241
  getValue(name: string): Maybe<GraphQLEnumValue>;
757
- /** @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18 */
3242
+ /**
3243
+ * Serializes a runtime enum value as a GraphQL enum name.
3244
+ * @param outputValue - Runtime enum value to serialize.
3245
+ * @returns The GraphQL enum name for the runtime value.
3246
+ *
3247
+ * This deprecated method delegates to `coerceOutputValue()`; call
3248
+ * `coerceOutputValue()` directly instead.
3249
+ * @example
3250
+ * ```ts
3251
+ * import { GraphQLEnumType } from 'graphql/type';
3252
+ *
3253
+ * const RGB = new GraphQLEnumType({
3254
+ * name: 'RGB',
3255
+ * values: {
3256
+ * RED: { value: 0 },
3257
+ * GREEN: { value: 1 },
3258
+ * BLUE: { value: 2 },
3259
+ * },
3260
+ * });
3261
+ *
3262
+ * RGB.serialize(1); // => 'GREEN'
3263
+ * RGB.serialize(3); // throws an error
3264
+ * ```
3265
+ * @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18
3266
+ */
758
3267
  serialize(outputValue: unknown): Maybe<string>;
3268
+ /**
3269
+ * Coerces a runtime enum value to a GraphQL enum name.
3270
+ * @param outputValue - Runtime enum value to coerce.
3271
+ * @returns The GraphQL enum name for the runtime value.
3272
+ * @example
3273
+ * ```ts
3274
+ * import { GraphQLEnumType } from 'graphql/type';
3275
+ *
3276
+ * const RGB = new GraphQLEnumType({
3277
+ * name: 'RGB',
3278
+ * values: {
3279
+ * RED: { value: 0 },
3280
+ * GREEN: { value: 1 },
3281
+ * BLUE: { value: 2 },
3282
+ * },
3283
+ * });
3284
+ *
3285
+ * RGB.coerceOutputValue(1); // => 'GREEN'
3286
+ * RGB.coerceOutputValue(3); // throws an error
3287
+ * ```
3288
+ */
759
3289
  coerceOutputValue(outputValue: unknown): Maybe<string>;
760
- /** @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18 */
3290
+ /**
3291
+ * Deprecated legacy enum parser for externally provided input values. Use
3292
+ * `coerceInputValue()` instead.
3293
+ * @param inputValue - External enum name to parse.
3294
+ * @param hideSuggestions - Whether suggestion text should be omitted from errors.
3295
+ * @returns The internal runtime value for the enum name.
3296
+ * @example
3297
+ * ```ts
3298
+ * import { GraphQLEnumType } from 'graphql/type';
3299
+ *
3300
+ * const RGB = new GraphQLEnumType({
3301
+ * name: 'RGB',
3302
+ * values: {
3303
+ * RED: { value: 0 },
3304
+ * GREEN: { value: 1 },
3305
+ * BLUE: { value: 2 },
3306
+ * },
3307
+ * });
3308
+ *
3309
+ * RGB.parseValue('BLUE'); // => 2
3310
+ * RGB.parseValue('PURPLE', true); // throws an error
3311
+ * ```
3312
+ * @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18
3313
+ */
761
3314
  parseValue(inputValue: unknown, hideSuggestions?: Maybe<boolean>): Maybe<any>;
3315
+ /**
3316
+ * Coerces an external enum name to its internal runtime value.
3317
+ * @param inputValue - External enum name to coerce.
3318
+ * @param hideSuggestions - Whether suggestion text should be omitted from errors.
3319
+ * @returns The internal runtime value for the enum name.
3320
+ * @example
3321
+ * ```ts
3322
+ * import { GraphQLEnumType } from 'graphql/type';
3323
+ *
3324
+ * const RGB = new GraphQLEnumType({
3325
+ * name: 'RGB',
3326
+ * values: {
3327
+ * RED: { value: 0 },
3328
+ * GREEN: { value: 1 },
3329
+ * BLUE: { value: 2 },
3330
+ * },
3331
+ * });
3332
+ *
3333
+ * RGB.coerceInputValue('BLUE'); // => 2
3334
+ * RGB.coerceInputValue('PURPLE'); // throws an error
3335
+ * RGB.coerceInputValue(2); // throws an error
3336
+ * ```
3337
+ */
762
3338
  coerceInputValue(inputValue: unknown, hideSuggestions?: Maybe<boolean>): Maybe<any>;
763
- /** @deprecated use `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18 */
3339
+ /**
3340
+ * Deprecated legacy enum parser for externally provided input literals. Use
3341
+ * `coerceInputLiteral()` instead.
3342
+ * @param valueNode - Enum value AST node to parse.
3343
+ * @param _variables - Deprecated variable values parameter that is no longer used.
3344
+ * @param hideSuggestions - Whether suggestion text should be omitted from errors.
3345
+ * @returns The internal runtime value for the enum literal.
3346
+ * @example
3347
+ * ```ts
3348
+ * import { parseValue } from 'graphql/language';
3349
+ * import { GraphQLEnumType } from 'graphql/type';
3350
+ *
3351
+ * const RGB = new GraphQLEnumType({
3352
+ * name: 'RGB',
3353
+ * values: {
3354
+ * RED: { value: 0 },
3355
+ * GREEN: { value: 1 },
3356
+ * BLUE: { value: 2 },
3357
+ * },
3358
+ * });
3359
+ *
3360
+ * RGB.parseLiteral(parseValue('RED')); // => 0
3361
+ * RGB.parseLiteral(parseValue('"RED"')); // throws an error
3362
+ * ```
3363
+ * @deprecated use `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18
3364
+ */
764
3365
  parseLiteral(valueNode: ValueNode, _variables: Maybe<ObjMap<unknown>>, hideSuggestions?: Maybe<boolean>): Maybe<any>;
3366
+ /**
3367
+ * Coerces an enum value AST node to its internal runtime value.
3368
+ * @param valueNode - Enum value AST node to coerce.
3369
+ * @param hideSuggestions - Whether suggestion text should be omitted from errors.
3370
+ * @returns The internal runtime value for the enum literal.
3371
+ * @example
3372
+ * ```ts
3373
+ * import { parseConstValue } from 'graphql/language';
3374
+ * import { GraphQLEnumType } from 'graphql/type';
3375
+ *
3376
+ * const RGB = new GraphQLEnumType({
3377
+ * name: 'RGB',
3378
+ * values: {
3379
+ * RED: { value: 0 },
3380
+ * GREEN: { value: 1 },
3381
+ * BLUE: { value: 2 },
3382
+ * },
3383
+ * });
3384
+ *
3385
+ * RGB.coerceInputLiteral(parseConstValue('RED')); // => 0
3386
+ * RGB.coerceInputLiteral(parseConstValue('"RED"'), true); // throws an error
3387
+ * ```
3388
+ */
765
3389
  coerceInputLiteral(valueNode: ConstValueNode, hideSuggestions?: Maybe<boolean>): Maybe<any>;
3390
+ /**
3391
+ * Converts a runtime enum value to a GraphQL enum value AST node.
3392
+ * @param value - Runtime enum value to convert.
3393
+ * @returns Enum value AST node, or undefined if the value is invalid.
3394
+ * @example
3395
+ * ```ts
3396
+ * import { print } from 'graphql/language';
3397
+ * import { GraphQLEnumType } from 'graphql/type';
3398
+ *
3399
+ * const RGB = new GraphQLEnumType({
3400
+ * name: 'RGB',
3401
+ * values: {
3402
+ * RED: { value: 0 },
3403
+ * GREEN: { value: 1 },
3404
+ * BLUE: { value: 2 },
3405
+ * },
3406
+ * });
3407
+ *
3408
+ * print(RGB.valueToLiteral(2)); // => 'BLUE'
3409
+ * RGB.valueToLiteral(3); // => undefined
3410
+ * ```
3411
+ */
766
3412
  valueToLiteral(value: unknown): ConstValueNode | undefined;
3413
+ /**
3414
+ * Returns a normalized configuration object for this object.
3415
+ * @returns A configuration object that can be used to recreate this object.
3416
+ * @example
3417
+ * ```ts
3418
+ * import { GraphQLEnumType } from 'graphql/type';
3419
+ *
3420
+ * const RGB = new GraphQLEnumType({
3421
+ * name: 'RGB',
3422
+ * values: {
3423
+ * RED: { value: 0 },
3424
+ * GREEN: { value: 1 },
3425
+ * BLUE: { value: 2 },
3426
+ * },
3427
+ * });
3428
+ *
3429
+ * const config = RGB.toConfig();
3430
+ * const RGBCopy = new GraphQLEnumType(config);
3431
+ *
3432
+ * config.values.GREEN.value; // => 1
3433
+ * RGBCopy.coerceOutputValue(2); // => 'BLUE'
3434
+ * ```
3435
+ */
767
3436
  toConfig(): GraphQLEnumTypeNormalizedConfig;
3437
+ /**
3438
+ * Returns the schema coordinate identifying this enum type.
3439
+ * @returns The schema coordinate for this enum type.
3440
+ * @example
3441
+ * ```ts
3442
+ * import { buildSchema } from 'graphql/utilities';
3443
+ * import { assertEnumType } from 'graphql/type';
3444
+ *
3445
+ * const schema = buildSchema(`
3446
+ * enum Episode {
3447
+ * NEW_HOPE
3448
+ * }
3449
+ *
3450
+ * type Query {
3451
+ * episode: Episode
3452
+ * }
3453
+ * `);
3454
+ *
3455
+ * const Episode = assertEnumType(schema.getType('Episode'));
3456
+ *
3457
+ * Episode.toString(); // => 'Episode'
3458
+ * ```
3459
+ */
768
3460
  toString(): string;
3461
+ /**
3462
+ * Returns the JSON representation used when this object is serialized.
3463
+ * @returns The JSON-serializable representation.
3464
+ * @example
3465
+ * ```ts
3466
+ * import { GraphQLEnumType } from 'graphql/type';
3467
+ *
3468
+ * const Episode = new GraphQLEnumType({
3469
+ * name: 'Episode',
3470
+ * values: {
3471
+ * NEW_HOPE: {},
3472
+ * },
3473
+ * });
3474
+ *
3475
+ * Episode.toJSON(); // => 'Episode'
3476
+ * JSON.stringify({ type: Episode }); // => '{"type":"Episode"}'
3477
+ * ```
3478
+ */
769
3479
  toJSON(): string;
770
3480
  }
3481
+ /** Configuration used to construct a GraphQLEnumType. */
771
3482
  export interface GraphQLEnumTypeConfig {
3483
+ /** The GraphQL name for this schema element. */
772
3484
  name: string;
3485
+ /** Human-readable description for this schema element, if provided. */
773
3486
  description?: Maybe<string>;
3487
+ /** Values contained in this enum, list, or input-object definition. */
774
3488
  values: ThunkObjMap<GraphQLEnumValueConfig>;
3489
+ /** Extension fields to include in the formatted result. */
775
3490
  extensions?: Maybe<Readonly<GraphQLEnumTypeExtensions>>;
3491
+ /** AST node from which this schema element was built, if available. */
776
3492
  astNode?: Maybe<EnumTypeDefinitionNode>;
3493
+ /** AST extension nodes applied to this schema element. */
777
3494
  extensionASTNodes?: Maybe<ReadonlyArray<EnumTypeExtensionNode>>;
778
3495
  }
3496
+ /** @internal */
779
3497
  export interface GraphQLEnumTypeNormalizedConfig extends GraphQLEnumTypeConfig {
780
3498
  values: GraphQLEnumValueNormalizedConfigMap;
781
3499
  extensions: Readonly<GraphQLEnumTypeExtensions>;
782
3500
  extensionASTNodes: ReadonlyArray<EnumTypeExtensionNode>;
783
3501
  }
3502
+ /** A map of enum value names to enum value configuration objects. */
784
3503
  export type GraphQLEnumValueConfigMap = ObjMap<GraphQLEnumValueConfig>;
3504
+ /** @internal */
785
3505
  export type GraphQLEnumValueNormalizedConfigMap = ObjMap<GraphQLEnumValueNormalizedConfig>;
786
3506
  /**
787
3507
  * Custom extensions
788
- *
789
3508
  * @remarks
790
3509
  * Use a unique identifier name for your extension, for example the name of
791
3510
  * your library or project. Do not use a shortened identifier as this increases
@@ -795,34 +3514,125 @@ export type GraphQLEnumValueNormalizedConfigMap = ObjMap<GraphQLEnumValueNormali
795
3514
  export interface GraphQLEnumValueExtensions {
796
3515
  [attributeName: string | symbol]: unknown;
797
3516
  }
3517
+ /** Configuration used to define a GraphQL enum value. */
798
3518
  export interface GraphQLEnumValueConfig {
3519
+ /** Human-readable description for this schema element, if provided. */
799
3520
  description?: Maybe<string>;
3521
+ /** Parsed value represented by this node. */
800
3522
  value?: any;
3523
+ /** Reason this element is deprecated, if one was provided. */
801
3524
  deprecationReason?: Maybe<string>;
3525
+ /** Extension fields to include in the formatted result. */
802
3526
  extensions?: Maybe<Readonly<GraphQLEnumValueExtensions>>;
3527
+ /** AST node from which this schema element was built, if available. */
803
3528
  astNode?: Maybe<EnumValueDefinitionNode>;
804
3529
  }
3530
+ /** @internal */
805
3531
  export interface GraphQLEnumValueNormalizedConfig extends GraphQLEnumValueConfig {
806
3532
  extensions: Readonly<GraphQLEnumValueExtensions>;
807
3533
  }
3534
+ /** A resolved GraphQL enum value definition. */
808
3535
  export declare class GraphQLEnumValue implements GraphQLSchemaElement {
809
- readonly __kind: symbol;
3536
+ /** Enum type that owns this enum value. */
810
3537
  parentEnum: GraphQLEnumType;
3538
+ /** The GraphQL name for this schema element. */
811
3539
  name: string;
3540
+ /** Human-readable description for this schema element, if provided. */
812
3541
  description: Maybe<string>;
3542
+ /** Parsed value represented by this node. */
813
3543
  value: any;
3544
+ /** Reason this element is deprecated, if one was provided. */
814
3545
  deprecationReason: Maybe<string>;
3546
+ /** Extension fields to include in the formatted result. */
815
3547
  extensions: Readonly<GraphQLEnumValueExtensions>;
3548
+ /** AST node from which this schema element was built, if available. */
816
3549
  astNode: Maybe<EnumValueDefinitionNode>;
3550
+ /**
3551
+ * Creates a resolved GraphQL enum value definition.
3552
+ * @param parentEnum - Enum type that owns this enum value.
3553
+ * @param name - Enum value name.
3554
+ * @param config - Enum value configuration.
3555
+ * @example
3556
+ * ```ts
3557
+ * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type';
3558
+ *
3559
+ * const Episode = new GraphQLEnumType({
3560
+ * name: 'Episode',
3561
+ * values: { NEW_HOPE: { value: 4 } },
3562
+ * });
3563
+ * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', {
3564
+ * value: 5,
3565
+ * description: 'Released in 1980.',
3566
+ * });
3567
+ *
3568
+ * enumValue.parentEnum; // => Episode
3569
+ * enumValue.name; // => 'EMPIRE'
3570
+ * enumValue.value; // => 5
3571
+ * ```
3572
+ */
817
3573
  constructor(parentEnum: GraphQLEnumType, name: string, config: GraphQLEnumValueConfig);
3574
+ /**
3575
+ * Returns the value used by `Object.prototype.toString`.
3576
+ * @returns The built-in string tag for this object.
3577
+ */
818
3578
  get [Symbol.toStringTag](): string;
3579
+ /**
3580
+ * Returns a normalized configuration object for this enum value.
3581
+ * @returns A configuration object that can be used to recreate this enum value.
3582
+ * @example
3583
+ * ```ts
3584
+ * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type';
3585
+ *
3586
+ * const Episode = new GraphQLEnumType({
3587
+ * name: 'Episode',
3588
+ * values: { NEW_HOPE: { value: 4 } },
3589
+ * });
3590
+ * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', {
3591
+ * value: 5,
3592
+ * extensions: { trilogy: 'original' },
3593
+ * });
3594
+ *
3595
+ * enumValue.toConfig(); // => { description: undefined, value: 5, deprecationReason: undefined, extensions: { trilogy: 'original' }, astNode: undefined }
3596
+ * ```
3597
+ */
819
3598
  toConfig(): GraphQLEnumValueNormalizedConfig;
3599
+ /**
3600
+ * Returns this enum value as a schema coordinate string.
3601
+ * @returns Enum value coordinate.
3602
+ * @example
3603
+ * ```ts
3604
+ * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type';
3605
+ *
3606
+ * const Episode = new GraphQLEnumType({
3607
+ * name: 'Episode',
3608
+ * values: { NEW_HOPE: { value: 4 } },
3609
+ * });
3610
+ * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', { value: 5 });
3611
+ *
3612
+ * enumValue.toString(); // => 'Episode.EMPIRE'
3613
+ * ```
3614
+ */
820
3615
  toString(): string;
3616
+ /**
3617
+ * Returns the JSON representation used when this object is serialized.
3618
+ * @returns Enum value coordinate.
3619
+ * @example
3620
+ * ```ts
3621
+ * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type';
3622
+ *
3623
+ * const Episode = new GraphQLEnumType({
3624
+ * name: 'Episode',
3625
+ * values: { NEW_HOPE: { value: 4 } },
3626
+ * });
3627
+ * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', { value: 5 });
3628
+ *
3629
+ * JSON.stringify(enumValue); // => '"Episode.EMPIRE"'
3630
+ * ```
3631
+ */
821
3632
  toJSON(): string;
822
3633
  }
823
3634
  /**
824
3635
  * Custom extensions
825
- *
826
3636
  * @remarks
827
3637
  * Use a unique identifier name for your extension, for example the name of
828
3638
  * your library or project. Do not use a shortened identifier as this increases
@@ -839,45 +3649,221 @@ export interface GraphQLInputObjectTypeExtensions {
839
3649
  * supplied to a field argument.
840
3650
  *
841
3651
  * Using `NonNull` will ensure that a value must be provided by the query
842
- *
843
- * Example:
844
- *
3652
+ * @example
845
3653
  * ```ts
846
3654
  * const GeoPoint = new GraphQLInputObjectType({
847
3655
  * name: 'GeoPoint',
848
3656
  * fields: {
849
3657
  * lat: { type: new GraphQLNonNull(GraphQLFloat) },
850
3658
  * lon: { type: new GraphQLNonNull(GraphQLFloat) },
851
- * alt: { type: GraphQLFloat, defaultValue: 0 },
3659
+ * alt: { type: GraphQLFloat, default: { value: 0 } },
852
3660
  * }
853
3661
  * });
854
3662
  * ```
855
3663
  */
856
3664
  export declare class GraphQLInputObjectType implements GraphQLSchemaElement {
857
- readonly __kind: symbol;
3665
+ /** The GraphQL name for this schema element. */
858
3666
  name: string;
3667
+ /** Human-readable description for this schema element, if provided. */
859
3668
  description: Maybe<string>;
3669
+ /** Extension fields to include in the formatted result. */
860
3670
  extensions: Readonly<GraphQLInputObjectTypeExtensions>;
3671
+ /** AST node from which this schema element was built, if available. */
861
3672
  astNode: Maybe<InputObjectTypeDefinitionNode>;
3673
+ /** AST extension nodes applied to this schema element. */
862
3674
  extensionASTNodes: ReadonlyArray<InputObjectTypeExtensionNode>;
3675
+ /** Whether this input object uses the experimental OneOf input object semantics. */
863
3676
  isOneOf: boolean;
864
3677
  private _fields;
3678
+ /**
3679
+ * Creates a GraphQLInputObjectType instance.
3680
+ * @param config - Configuration describing this object.
3681
+ * @example
3682
+ * ```ts
3683
+ * import { parse } from 'graphql/language';
3684
+ * import {
3685
+ * GraphQLID,
3686
+ * GraphQLInputObjectType,
3687
+ * GraphQLInt,
3688
+ * GraphQLNonNull,
3689
+ * GraphQLString,
3690
+ * } from 'graphql/type';
3691
+ *
3692
+ * const document = parse(`
3693
+ * input ReviewInput {
3694
+ * stars: Int!
3695
+ * commentary: String
3696
+ * }
3697
+ *
3698
+ * extend input ReviewInput {
3699
+ * body: String
3700
+ * }
3701
+ * `);
3702
+ * const definition = document.definitions[0];
3703
+ *
3704
+ * const ReviewInput = new GraphQLInputObjectType({
3705
+ * name: 'ReviewInput',
3706
+ * description: 'Input collected when reviewing a product.',
3707
+ * fields: {
3708
+ * stars: {
3709
+ * description: 'Star rating from one to five.',
3710
+ * type: new GraphQLNonNull(GraphQLInt),
3711
+ * extensions: { min: 1, max: 5 },
3712
+ * astNode: definition.fields[0],
3713
+ * },
3714
+ * commentary: {
3715
+ * type: GraphQLString,
3716
+ * default: { value: '' },
3717
+ * deprecationReason: 'Use body.',
3718
+ * astNode: definition.fields[1],
3719
+ * },
3720
+ * },
3721
+ * extensions: { form: 'review' },
3722
+ * astNode: definition,
3723
+ * extensionASTNodes: [ document.definitions[1] ],
3724
+ * isOneOf: false,
3725
+ * });
3726
+ * const SearchBy = new GraphQLInputObjectType({
3727
+ * name: 'SearchBy',
3728
+ * fields: {
3729
+ * id: { type: GraphQLID },
3730
+ * slug: { type: GraphQLString },
3731
+ * },
3732
+ * isOneOf: true,
3733
+ * });
3734
+ *
3735
+ * const fields = ReviewInput.getFields();
3736
+ *
3737
+ * ReviewInput.description; // => 'Input collected when reviewing a product.'
3738
+ * String(fields.stars.type); // => 'Int!'
3739
+ * fields.stars.extensions; // => { min: 1, max: 5 }
3740
+ * fields.commentary.default.value; // => ''
3741
+ * fields.commentary.deprecationReason; // => 'Use body.'
3742
+ * ReviewInput.isOneOf; // => false
3743
+ * SearchBy.isOneOf; // => true
3744
+ * ```
3745
+ */
865
3746
  constructor(config: Readonly<GraphQLInputObjectTypeConfig>);
3747
+ /**
3748
+ * Returns the value used by `Object.prototype.toString`.
3749
+ * @returns The built-in string tag for this object.
3750
+ */
866
3751
  get [Symbol.toStringTag](): string;
3752
+ /**
3753
+ * Returns the fields defined by this type.
3754
+ * @returns The fields keyed by field name.
3755
+ * @example
3756
+ * ```ts
3757
+ * import { buildSchema } from 'graphql/utilities';
3758
+ * import { assertInputObjectType } from 'graphql/type';
3759
+ *
3760
+ * const schema = buildSchema(`
3761
+ * input ReviewInput {
3762
+ * stars: Int!
3763
+ * commentary: String = ""
3764
+ * }
3765
+ *
3766
+ * type Query {
3767
+ * reviews(filter: ReviewInput): [String]
3768
+ * }
3769
+ * `);
3770
+ *
3771
+ * const ReviewInput = assertInputObjectType(schema.getType('ReviewInput'));
3772
+ * const fields = ReviewInput.getFields();
3773
+ *
3774
+ * Object.keys(fields); // => ['stars', 'commentary']
3775
+ * fields.commentary.default; // => { literal: { kind: 'StringValue', value: '' } }
3776
+ * ```
3777
+ */
867
3778
  getFields(): GraphQLInputFieldMap;
3779
+ /**
3780
+ * Returns a normalized configuration object for this object.
3781
+ * @returns A configuration object that can be used to recreate this object.
3782
+ * @example
3783
+ * ```ts
3784
+ * import {
3785
+ * GraphQLInputObjectType,
3786
+ * GraphQLInt,
3787
+ * GraphQLNonNull,
3788
+ * } from 'graphql/type';
3789
+ *
3790
+ * const ReviewInput = new GraphQLInputObjectType({
3791
+ * name: 'ReviewInput',
3792
+ * fields: {
3793
+ * stars: { type: new GraphQLNonNull(GraphQLInt) },
3794
+ * },
3795
+ * });
3796
+ *
3797
+ * const config = ReviewInput.toConfig();
3798
+ * const ReviewInputCopy = new GraphQLInputObjectType(config);
3799
+ *
3800
+ * String(config.fields.stars.type); // => 'Int!'
3801
+ * String(ReviewInputCopy.getFields().stars.type); // => 'Int!'
3802
+ * ```
3803
+ */
868
3804
  toConfig(): GraphQLInputObjectTypeNormalizedConfig;
3805
+ /**
3806
+ * Returns the schema coordinate identifying this input object type.
3807
+ * @returns The schema coordinate for this input object type.
3808
+ * @example
3809
+ * ```ts
3810
+ * import { buildSchema } from 'graphql/utilities';
3811
+ * import { assertInputObjectType } from 'graphql/type';
3812
+ *
3813
+ * const schema = buildSchema(`
3814
+ * input ReviewInput {
3815
+ * stars: Int!
3816
+ * }
3817
+ *
3818
+ * type Query {
3819
+ * reviews(filter: ReviewInput): [String]
3820
+ * }
3821
+ * `);
3822
+ *
3823
+ * const ReviewInput = assertInputObjectType(schema.getType('ReviewInput'));
3824
+ *
3825
+ * ReviewInput.toString(); // => 'ReviewInput'
3826
+ * ```
3827
+ */
869
3828
  toString(): string;
3829
+ /**
3830
+ * Returns the JSON representation used when this object is serialized.
3831
+ * @returns The JSON-serializable representation.
3832
+ * @example
3833
+ * ```ts
3834
+ * import { GraphQLInputObjectType, GraphQLString } from 'graphql/type';
3835
+ *
3836
+ * const ReviewInput = new GraphQLInputObjectType({
3837
+ * name: 'ReviewInput',
3838
+ * fields: {
3839
+ * commentary: { type: GraphQLString },
3840
+ * },
3841
+ * });
3842
+ *
3843
+ * ReviewInput.toJSON(); // => 'ReviewInput'
3844
+ * JSON.stringify({ type: ReviewInput }); // => '{"type":"ReviewInput"}'
3845
+ * ```
3846
+ */
870
3847
  toJSON(): string;
871
3848
  }
3849
+ /** Configuration used to construct a GraphQLInputObjectType. */
872
3850
  export interface GraphQLInputObjectTypeConfig {
3851
+ /** The GraphQL name for this schema element. */
873
3852
  name: string;
3853
+ /** Human-readable description for this schema element, if provided. */
874
3854
  description?: Maybe<string>;
3855
+ /** Fields declared by this object, interface, input object, or literal. */
875
3856
  fields: ThunkObjMap<GraphQLInputFieldConfig>;
3857
+ /** Extension fields to include in the formatted result. */
876
3858
  extensions?: Maybe<Readonly<GraphQLInputObjectTypeExtensions>>;
3859
+ /** AST node from which this schema element was built, if available. */
877
3860
  astNode?: Maybe<InputObjectTypeDefinitionNode>;
3861
+ /** AST extension nodes applied to this schema element. */
878
3862
  extensionASTNodes?: Maybe<ReadonlyArray<InputObjectTypeExtensionNode>>;
3863
+ /** Whether this input object uses the experimental OneOf input object semantics. */
879
3864
  isOneOf?: boolean;
880
3865
  }
3866
+ /** @internal */
881
3867
  export interface GraphQLInputObjectTypeNormalizedConfig extends GraphQLInputObjectTypeConfig {
882
3868
  fields: GraphQLInputFieldNormalizedConfigMap;
883
3869
  extensions: Readonly<GraphQLInputObjectTypeExtensions>;
@@ -885,7 +3871,6 @@ export interface GraphQLInputObjectTypeNormalizedConfig extends GraphQLInputObje
885
3871
  }
886
3872
  /**
887
3873
  * Custom extensions
888
- *
889
3874
  * @remarks
890
3875
  * Use a unique identifier name for your extension, for example the name of
891
3876
  * your library or project. Do not use a shortened identifier as this increases
@@ -895,39 +3880,184 @@ export interface GraphQLInputObjectTypeNormalizedConfig extends GraphQLInputObje
895
3880
  export interface GraphQLInputFieldExtensions {
896
3881
  [attributeName: string | symbol]: unknown;
897
3882
  }
3883
+ /** Configuration used to define a GraphQL input field. */
898
3884
  export interface GraphQLInputFieldConfig {
3885
+ /** Human-readable description for this schema element, if provided. */
899
3886
  description?: Maybe<string>;
3887
+ /** The GraphQL type reference or runtime type for this element. */
900
3888
  type: GraphQLInputType;
901
- /** @deprecated use default instead, defaultValue will be removed in v18 **/
3889
+ /**
3890
+ * Deprecated legacy default value for this input field. Use `default`
3891
+ * instead.
3892
+ * @deprecated use `default` instead, `defaultValue` will be removed in v18
3893
+ */
902
3894
  defaultValue?: unknown;
3895
+ /** Default value represented as either a runtime value or a GraphQL literal. */
903
3896
  default?: GraphQLDefaultInput | undefined;
3897
+ /** Reason this element is deprecated, if one was provided. */
904
3898
  deprecationReason?: Maybe<string>;
3899
+ /** Extension fields to include in the formatted result. */
905
3900
  extensions?: Maybe<Readonly<GraphQLInputFieldExtensions>>;
3901
+ /** AST node from which this schema element was built, if available. */
906
3902
  astNode?: Maybe<InputValueDefinitionNode>;
907
3903
  }
3904
+ /** A map of input field names to input field configuration objects. */
908
3905
  export type GraphQLInputFieldConfigMap = ObjMap<GraphQLInputFieldConfig>;
3906
+ /** @internal */
909
3907
  export interface GraphQLInputFieldNormalizedConfig extends GraphQLInputFieldConfig {
910
3908
  default: GraphQLDefaultInput | undefined;
911
3909
  extensions: Readonly<GraphQLInputFieldExtensions>;
912
3910
  }
3911
+ /** @internal */
913
3912
  export type GraphQLInputFieldNormalizedConfigMap = ObjMap<GraphQLInputFieldNormalizedConfig>;
3913
+ /** A resolved GraphQL input field definition. */
914
3914
  export declare class GraphQLInputField implements GraphQLSchemaElement {
915
- readonly __kind: symbol;
3915
+ /** Input object type that owns this input field. */
916
3916
  parentType: GraphQLInputObjectType;
3917
+ /** The GraphQL name for this schema element. */
917
3918
  name: string;
3919
+ /** Human-readable description for this schema element, if provided. */
918
3920
  description: Maybe<string>;
3921
+ /** The GraphQL type reference or runtime type for this element. */
919
3922
  type: GraphQLInputType;
3923
+ /**
3924
+ * Deprecated legacy default value used when no explicit value is supplied.
3925
+ * Use `default` instead.
3926
+ * @deprecated use `default` instead, `defaultValue` will be removed in v18
3927
+ */
920
3928
  defaultValue: unknown;
3929
+ /** Default value represented as either a runtime value or a GraphQL literal. */
921
3930
  default: GraphQLDefaultInput | undefined;
3931
+ /** Reason this element is deprecated, if one was provided. */
922
3932
  deprecationReason: Maybe<string>;
3933
+ /** Extension fields to include in the formatted result. */
923
3934
  extensions: Readonly<GraphQLInputFieldExtensions>;
3935
+ /** AST node from which this schema element was built, if available. */
924
3936
  astNode: Maybe<InputValueDefinitionNode>;
3937
+ /**
3938
+ * Creates a resolved GraphQL input field definition.
3939
+ * @param parentType - Input object type that owns this field.
3940
+ * @param name - Input field name.
3941
+ * @param config - Input field configuration.
3942
+ * @example
3943
+ * ```ts
3944
+ * import { GraphQLInputField, GraphQLInputObjectType, GraphQLString } from 'graphql/type';
3945
+ *
3946
+ * const ReviewInput = new GraphQLInputObjectType({
3947
+ * name: 'ReviewInput',
3948
+ * fields: {},
3949
+ * });
3950
+ * const field = new GraphQLInputField(ReviewInput, 'commentary', {
3951
+ * type: GraphQLString,
3952
+ * default: { value: '' },
3953
+ * });
3954
+ *
3955
+ * field.parentType; // => ReviewInput
3956
+ * field.name; // => 'commentary'
3957
+ * field.default.value; // => ''
3958
+ * ```
3959
+ */
925
3960
  constructor(parentType: GraphQLInputObjectType, name: string, config: GraphQLInputFieldConfig);
3961
+ /**
3962
+ * Returns the value used by `Object.prototype.toString`.
3963
+ * @returns The built-in string tag for this object.
3964
+ */
926
3965
  get [Symbol.toStringTag](): string;
3966
+ /**
3967
+ * Returns a normalized configuration object for this input field.
3968
+ * @returns A configuration object that can be used to recreate this input field.
3969
+ * @example
3970
+ * ```ts
3971
+ * import { GraphQLInputField, GraphQLInputObjectType, GraphQLString } from 'graphql/type';
3972
+ *
3973
+ * const ReviewInput = new GraphQLInputObjectType({
3974
+ * name: 'ReviewInput',
3975
+ * fields: {},
3976
+ * });
3977
+ * const field = new GraphQLInputField(ReviewInput, 'commentary', {
3978
+ * type: GraphQLString,
3979
+ * extensions: { form: 'review' },
3980
+ * });
3981
+ *
3982
+ * field.toConfig().extensions; // => { form: 'review' }
3983
+ * ```
3984
+ */
927
3985
  toConfig(): GraphQLInputFieldNormalizedConfig;
3986
+ /**
3987
+ * Returns this input field as a schema coordinate string.
3988
+ * @returns The input field coordinate.
3989
+ * @example
3990
+ * ```ts
3991
+ * import { GraphQLInputField, GraphQLInputObjectType, GraphQLString } from 'graphql/type';
3992
+ *
3993
+ * const ReviewInput = new GraphQLInputObjectType({
3994
+ * name: 'ReviewInput',
3995
+ * fields: {},
3996
+ * });
3997
+ * const field = new GraphQLInputField(ReviewInput, 'commentary', {
3998
+ * type: GraphQLString,
3999
+ * });
4000
+ *
4001
+ * field.toString(); // => 'ReviewInput.commentary'
4002
+ * ```
4003
+ */
928
4004
  toString(): string;
4005
+ /**
4006
+ * Returns the JSON representation used when this object is serialized.
4007
+ * @returns The input field coordinate.
4008
+ * @example
4009
+ * ```ts
4010
+ * import { GraphQLInputField, GraphQLInputObjectType, GraphQLString } from 'graphql/type';
4011
+ *
4012
+ * const ReviewInput = new GraphQLInputObjectType({
4013
+ * name: 'ReviewInput',
4014
+ * fields: {},
4015
+ * });
4016
+ * const field = new GraphQLInputField(ReviewInput, 'commentary', {
4017
+ * type: GraphQLString,
4018
+ * });
4019
+ *
4020
+ * JSON.stringify(field); // => '"ReviewInput.commentary"'
4021
+ * ```
4022
+ */
929
4023
  toJSON(): string;
930
4024
  }
4025
+ /**
4026
+ * Returns true when the input field is non-null and has no default value.
4027
+ * @param field - The input field definition to inspect.
4028
+ * @returns True when the input field is non-null and has no default value.
4029
+ * @example
4030
+ * ```ts
4031
+ * import {
4032
+ * GraphQLInputField,
4033
+ * GraphQLInputObjectType,
4034
+ * GraphQLInt,
4035
+ * GraphQLNonNull,
4036
+ * GraphQLString,
4037
+ * isRequiredInputField,
4038
+ * } from 'graphql/type';
4039
+ *
4040
+ * const ReviewInput = new GraphQLInputObjectType({
4041
+ * name: 'ReviewInput',
4042
+ * fields: {},
4043
+ * });
4044
+ * const requiredField = new GraphQLInputField(ReviewInput, 'id', {
4045
+ * type: new GraphQLNonNull(GraphQLInt),
4046
+ * });
4047
+ * const optionalField = new GraphQLInputField(ReviewInput, 'name', {
4048
+ * type: GraphQLString,
4049
+ * });
4050
+ * const fieldWithDefault = new GraphQLInputField(ReviewInput, 'limit', {
4051
+ * type: new GraphQLNonNull(GraphQLInt),
4052
+ * default: { value: 10 },
4053
+ * });
4054
+ *
4055
+ * isRequiredInputField(requiredField); // => true
4056
+ * isRequiredInputField(optionalField); // => false
4057
+ * isRequiredInputField(fieldWithDefault); // => false
4058
+ * ```
4059
+ */
931
4060
  export declare function isRequiredInputField(field: GraphQLInputField): boolean;
4061
+ /** A map of input field names to resolved input field definitions. */
932
4062
  export type GraphQLInputFieldMap = ObjMap<GraphQLInputField>;
933
4063
  export {};