graphql 0.0.1-test.1

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 (390) hide show
  1. package/LICENSE +21 -0
  2. package/NotSupportedTSVersion.d.ts +1 -0
  3. package/README.md +158 -0
  4. package/error/GraphQLError.d.ts +142 -0
  5. package/error/GraphQLError.js +267 -0
  6. package/error/GraphQLError.mjs +253 -0
  7. package/error/index.d.ts +7 -0
  8. package/error/index.js +41 -0
  9. package/error/index.mjs +3 -0
  10. package/error/locatedError.d.ts +13 -0
  11. package/error/locatedError.js +40 -0
  12. package/error/locatedError.mjs +32 -0
  13. package/error/syntaxError.d.ts +11 -0
  14. package/error/syntaxError.js +21 -0
  15. package/error/syntaxError.mjs +11 -0
  16. package/execution/collectFields.d.ts +45 -0
  17. package/execution/collectFields.js +229 -0
  18. package/execution/collectFields.mjs +213 -0
  19. package/execution/execute.d.ts +185 -0
  20. package/execution/execute.js +1016 -0
  21. package/execution/execute.mjs +988 -0
  22. package/execution/index.d.ts +14 -0
  23. package/execution/index.js +67 -0
  24. package/execution/index.mjs +9 -0
  25. package/execution/mapAsyncIterator.d.ts +9 -0
  26. package/execution/mapAsyncIterator.js +68 -0
  27. package/execution/mapAsyncIterator.mjs +61 -0
  28. package/execution/subscribe.d.ts +68 -0
  29. package/execution/subscribe.js +261 -0
  30. package/execution/subscribe.mjs +239 -0
  31. package/execution/values.d.ts +81 -0
  32. package/execution/values.js +292 -0
  33. package/execution/values.mjs +255 -0
  34. package/graphql.d.ts +67 -0
  35. package/graphql.js +96 -0
  36. package/graphql.mjs +122 -0
  37. package/index.d.ts +411 -0
  38. package/index.js +1263 -0
  39. package/index.mjs +254 -0
  40. package/jsutils/Maybe.d.ts +2 -0
  41. package/jsutils/Maybe.js +5 -0
  42. package/jsutils/Maybe.mjs +1 -0
  43. package/jsutils/ObjMap.d.ts +16 -0
  44. package/jsutils/ObjMap.js +5 -0
  45. package/jsutils/ObjMap.mjs +1 -0
  46. package/jsutils/Path.d.ts +20 -0
  47. package/jsutils/Path.js +33 -0
  48. package/jsutils/Path.mjs +25 -0
  49. package/jsutils/PromiseOrValue.d.ts +1 -0
  50. package/jsutils/PromiseOrValue.js +5 -0
  51. package/jsutils/PromiseOrValue.mjs +1 -0
  52. package/jsutils/devAssert.d.ts +1 -0
  53. package/jsutils/devAssert.js +14 -0
  54. package/jsutils/devAssert.mjs +7 -0
  55. package/jsutils/didYouMean.d.ts +8 -0
  56. package/jsutils/didYouMean.js +38 -0
  57. package/jsutils/didYouMean.mjs +32 -0
  58. package/jsutils/groupBy.d.ts +7 -0
  59. package/jsutils/groupBy.js +26 -0
  60. package/jsutils/groupBy.mjs +19 -0
  61. package/jsutils/identityFunc.d.ts +4 -0
  62. package/jsutils/identityFunc.js +13 -0
  63. package/jsutils/identityFunc.mjs +6 -0
  64. package/jsutils/inspect.d.ts +4 -0
  65. package/jsutils/inspect.js +121 -0
  66. package/jsutils/inspect.mjs +115 -0
  67. package/jsutils/instanceOf.d.ts +16 -0
  68. package/jsutils/instanceOf.js +60 -0
  69. package/jsutils/instanceOf.mjs +52 -0
  70. package/jsutils/invariant.d.ts +4 -0
  71. package/jsutils/invariant.js +16 -0
  72. package/jsutils/invariant.mjs +9 -0
  73. package/jsutils/isAsyncIterable.d.ts +7 -0
  74. package/jsutils/isAsyncIterable.js +18 -0
  75. package/jsutils/isAsyncIterable.mjs +11 -0
  76. package/jsutils/isIterableObject.d.ts +20 -0
  77. package/jsutils/isIterableObject.js +32 -0
  78. package/jsutils/isIterableObject.mjs +25 -0
  79. package/jsutils/isObjectLike.d.ts +7 -0
  80. package/jsutils/isObjectLike.js +14 -0
  81. package/jsutils/isObjectLike.mjs +7 -0
  82. package/jsutils/isPromise.d.ts +5 -0
  83. package/jsutils/isPromise.js +17 -0
  84. package/jsutils/isPromise.mjs +10 -0
  85. package/jsutils/keyMap.d.ts +32 -0
  86. package/jsutils/keyMap.js +43 -0
  87. package/jsutils/keyMap.mjs +36 -0
  88. package/jsutils/keyValMap.d.ts +23 -0
  89. package/jsutils/keyValMap.js +33 -0
  90. package/jsutils/keyValMap.mjs +26 -0
  91. package/jsutils/mapValue.d.ts +9 -0
  92. package/jsutils/mapValue.js +20 -0
  93. package/jsutils/mapValue.mjs +13 -0
  94. package/jsutils/memoize3.d.ts +9 -0
  95. package/jsutils/memoize3.js +41 -0
  96. package/jsutils/memoize3.mjs +34 -0
  97. package/jsutils/naturalCompare.d.ts +8 -0
  98. package/jsutils/naturalCompare.js +69 -0
  99. package/jsutils/naturalCompare.mjs +61 -0
  100. package/jsutils/printPathArray.d.ts +6 -0
  101. package/jsutils/printPathArray.js +17 -0
  102. package/jsutils/printPathArray.mjs +10 -0
  103. package/jsutils/promiseForObject.d.ts +11 -0
  104. package/jsutils/promiseForObject.js +25 -0
  105. package/jsutils/promiseForObject.mjs +18 -0
  106. package/jsutils/promiseReduce.d.ts +13 -0
  107. package/jsutils/promiseReduce.js +27 -0
  108. package/jsutils/promiseReduce.mjs +20 -0
  109. package/jsutils/suggestionList.d.ts +8 -0
  110. package/jsutils/suggestionList.js +139 -0
  111. package/jsutils/suggestionList.mjs +130 -0
  112. package/jsutils/toError.d.ts +4 -0
  113. package/jsutils/toError.js +25 -0
  114. package/jsutils/toError.mjs +18 -0
  115. package/jsutils/toObjMap.d.ts +5 -0
  116. package/jsutils/toObjMap.js +24 -0
  117. package/jsutils/toObjMap.mjs +17 -0
  118. package/language/ast.d.ts +536 -0
  119. package/language/ast.js +224 -0
  120. package/language/ast.mjs +206 -0
  121. package/language/blockString.d.ts +28 -0
  122. package/language/blockString.js +195 -0
  123. package/language/blockString.mjs +178 -0
  124. package/language/characterClasses.d.ts +47 -0
  125. package/language/characterClasses.js +75 -0
  126. package/language/characterClasses.mjs +64 -0
  127. package/language/directiveLocation.d.ts +32 -0
  128. package/language/directiveLocation.js +40 -0
  129. package/language/directiveLocation.mjs +31 -0
  130. package/language/index.d.ts +97 -0
  131. package/language/index.js +215 -0
  132. package/language/index.mjs +29 -0
  133. package/language/kinds.d.ts +65 -0
  134. package/language/kinds.js +64 -0
  135. package/language/kinds.mjs +55 -0
  136. package/language/lexer.d.ts +45 -0
  137. package/language/lexer.js +1006 -0
  138. package/language/lexer.mjs +902 -0
  139. package/language/location.d.ts +16 -0
  140. package/language/location.js +38 -0
  141. package/language/location.mjs +30 -0
  142. package/language/parser.d.ts +554 -0
  143. package/language/parser.js +1567 -0
  144. package/language/parser.mjs +1524 -0
  145. package/language/predicates.d.ts +33 -0
  146. package/language/predicates.js +109 -0
  147. package/language/predicates.mjs +81 -0
  148. package/language/printLocation.d.ts +14 -0
  149. package/language/printLocation.js +74 -0
  150. package/language/printLocation.mjs +66 -0
  151. package/language/printString.d.ts +5 -0
  152. package/language/printString.js +183 -0
  153. package/language/printString.mjs +176 -0
  154. package/language/printer.d.ts +6 -0
  155. package/language/printer.js +351 -0
  156. package/language/printer.mjs +339 -0
  157. package/language/source.d.ts +25 -0
  158. package/language/source.js +65 -0
  159. package/language/source.mjs +50 -0
  160. package/language/tokenKind.d.ts +34 -0
  161. package/language/tokenKind.js +44 -0
  162. package/language/tokenKind.mjs +35 -0
  163. package/language/visitor.d.ts +194 -0
  164. package/language/visitor.js +377 -0
  165. package/language/visitor.mjs +361 -0
  166. package/package.json +40 -0
  167. package/subscription/index.d.ts +19 -0
  168. package/subscription/index.js +19 -0
  169. package/subscription/index.mjs +19 -0
  170. package/type/assertName.d.ts +10 -0
  171. package/type/assertName.js +59 -0
  172. package/type/assertName.mjs +44 -0
  173. package/type/definition.d.ts +917 -0
  174. package/type/definition.js +1329 -0
  175. package/type/definition.mjs +1167 -0
  176. package/type/directives.d.ts +86 -0
  177. package/type/directives.js +224 -0
  178. package/type/directives.mjs +190 -0
  179. package/type/index.d.ts +150 -0
  180. package/type/index.js +547 -0
  181. package/type/index.mjs +103 -0
  182. package/type/introspection.d.ts +29 -0
  183. package/type/introspection.js +617 -0
  184. package/type/introspection.mjs +550 -0
  185. package/type/scalars.d.ts +19 -0
  186. package/type/scalars.js +359 -0
  187. package/type/scalars.mjs +299 -0
  188. package/type/schema.d.ts +170 -0
  189. package/type/schema.js +402 -0
  190. package/type/schema.mjs +381 -0
  191. package/type/validate.d.ts +17 -0
  192. package/type/validate.js +672 -0
  193. package/type/validate.mjs +647 -0
  194. package/utilities/TypeInfo.d.ts +67 -0
  195. package/utilities/TypeInfo.js +418 -0
  196. package/utilities/TypeInfo.mjs +395 -0
  197. package/utilities/assertValidName.d.ts +13 -0
  198. package/utilities/assertValidName.js +51 -0
  199. package/utilities/assertValidName.mjs +40 -0
  200. package/utilities/astFromValue.d.ts +28 -0
  201. package/utilities/astFromValue.js +190 -0
  202. package/utilities/astFromValue.mjs +177 -0
  203. package/utilities/buildASTSchema.d.ts +35 -0
  204. package/utilities/buildASTSchema.js +115 -0
  205. package/utilities/buildASTSchema.mjs +97 -0
  206. package/utilities/buildClientSchema.d.ts +19 -0
  207. package/utilities/buildClientSchema.js +386 -0
  208. package/utilities/buildClientSchema.mjs +363 -0
  209. package/utilities/coerceInputValue.d.ts +16 -0
  210. package/utilities/coerceInputValue.js +191 -0
  211. package/utilities/coerceInputValue.mjs +172 -0
  212. package/utilities/concatAST.d.ts +9 -0
  213. package/utilities/concatAST.js +26 -0
  214. package/utilities/concatAST.mjs +19 -0
  215. package/utilities/extendSchema.d.ts +40 -0
  216. package/utilities/extendSchema.js +798 -0
  217. package/utilities/extendSchema.mjs +789 -0
  218. package/utilities/findBreakingChanges.d.ts +51 -0
  219. package/utilities/findBreakingChanges.js +547 -0
  220. package/utilities/findBreakingChanges.mjs +516 -0
  221. package/utilities/getIntrospectionQuery.d.ts +182 -0
  222. package/utilities/getIntrospectionQuery.js +134 -0
  223. package/utilities/getIntrospectionQuery.mjs +127 -0
  224. package/utilities/getOperationAST.d.ts +11 -0
  225. package/utilities/getOperationAST.js +43 -0
  226. package/utilities/getOperationAST.mjs +36 -0
  227. package/utilities/getOperationRootType.d.ts +15 -0
  228. package/utilities/getOperationRootType.js +59 -0
  229. package/utilities/getOperationRootType.mjs +52 -0
  230. package/utilities/index.d.ts +61 -0
  231. package/utilities/index.js +233 -0
  232. package/utilities/index.mjs +55 -0
  233. package/utilities/introspectionFromSchema.d.ts +18 -0
  234. package/utilities/introspectionFromSchema.js +42 -0
  235. package/utilities/introspectionFromSchema.mjs +30 -0
  236. package/utilities/lexicographicSortSchema.d.ts +9 -0
  237. package/utilities/lexicographicSortSchema.js +177 -0
  238. package/utilities/lexicographicSortSchema.mjs +172 -0
  239. package/utilities/printSchema.d.ts +5 -0
  240. package/utilities/printSchema.js +333 -0
  241. package/utilities/printSchema.mjs +309 -0
  242. package/utilities/separateOperations.d.ts +11 -0
  243. package/utilities/separateOperations.js +88 -0
  244. package/utilities/separateOperations.mjs +80 -0
  245. package/utilities/sortValueNode.d.ts +9 -0
  246. package/utilities/sortValueNode.js +47 -0
  247. package/utilities/sortValueNode.mjs +39 -0
  248. package/utilities/stripIgnoredCharacters.d.ts +62 -0
  249. package/utilities/stripIgnoredCharacters.js +121 -0
  250. package/utilities/stripIgnoredCharacters.mjs +104 -0
  251. package/utilities/typeComparators.d.ts +32 -0
  252. package/utilities/typeComparators.js +116 -0
  253. package/utilities/typeComparators.mjs +106 -0
  254. package/utilities/typeFromAST.d.ts +32 -0
  255. package/utilities/typeFromAST.js +27 -0
  256. package/utilities/typeFromAST.mjs +18 -0
  257. package/utilities/typedQueryDocumentNode.d.ts +22 -0
  258. package/utilities/typedQueryDocumentNode.js +5 -0
  259. package/utilities/typedQueryDocumentNode.mjs +1 -0
  260. package/utilities/valueFromAST.d.ts +29 -0
  261. package/utilities/valueFromAST.js +185 -0
  262. package/utilities/valueFromAST.mjs +172 -0
  263. package/utilities/valueFromASTUntyped.d.ts +23 -0
  264. package/utilities/valueFromASTUntyped.js +61 -0
  265. package/utilities/valueFromASTUntyped.mjs +53 -0
  266. package/validation/ValidationContext.d.ts +95 -0
  267. package/validation/ValidationContext.js +232 -0
  268. package/validation/ValidationContext.mjs +212 -0
  269. package/validation/index.d.ts +40 -0
  270. package/validation/index.js +317 -0
  271. package/validation/index.mjs +68 -0
  272. package/validation/rules/ExecutableDefinitionsRule.d.ts +13 -0
  273. package/validation/rules/ExecutableDefinitionsRule.js +44 -0
  274. package/validation/rules/ExecutableDefinitionsRule.mjs +35 -0
  275. package/validation/rules/FieldsOnCorrectTypeRule.d.ts +13 -0
  276. package/validation/rules/FieldsOnCorrectTypeRule.js +143 -0
  277. package/validation/rules/FieldsOnCorrectTypeRule.mjs +125 -0
  278. package/validation/rules/FragmentsOnCompositeTypesRule.d.ts +14 -0
  279. package/validation/rules/FragmentsOnCompositeTypesRule.js +65 -0
  280. package/validation/rules/FragmentsOnCompositeTypesRule.mjs +49 -0
  281. package/validation/rules/KnownArgumentNamesRule.d.ts +23 -0
  282. package/validation/rules/KnownArgumentNamesRule.js +116 -0
  283. package/validation/rules/KnownArgumentNamesRule.mjs +98 -0
  284. package/validation/rules/KnownDirectivesRule.d.ts +16 -0
  285. package/validation/rules/KnownDirectivesRule.js +163 -0
  286. package/validation/rules/KnownDirectivesRule.mjs +146 -0
  287. package/validation/rules/KnownFragmentNamesRule.d.ts +13 -0
  288. package/validation/rules/KnownFragmentNamesRule.js +34 -0
  289. package/validation/rules/KnownFragmentNamesRule.mjs +24 -0
  290. package/validation/rules/KnownTypeNamesRule.d.ts +16 -0
  291. package/validation/rules/KnownTypeNamesRule.js +87 -0
  292. package/validation/rules/KnownTypeNamesRule.mjs +75 -0
  293. package/validation/rules/LoneAnonymousOperationRule.d.ts +13 -0
  294. package/validation/rules/LoneAnonymousOperationRule.js +40 -0
  295. package/validation/rules/LoneAnonymousOperationRule.mjs +32 -0
  296. package/validation/rules/LoneSchemaDefinitionRule.d.ts +10 -0
  297. package/validation/rules/LoneSchemaDefinitionRule.js +63 -0
  298. package/validation/rules/LoneSchemaDefinitionRule.mjs +53 -0
  299. package/validation/rules/NoFragmentCyclesRule.d.ts +13 -0
  300. package/validation/rules/NoFragmentCyclesRule.js +83 -0
  301. package/validation/rules/NoFragmentCyclesRule.mjs +76 -0
  302. package/validation/rules/NoUndefinedVariablesRule.d.ts +13 -0
  303. package/validation/rules/NoUndefinedVariablesRule.js +50 -0
  304. package/validation/rules/NoUndefinedVariablesRule.mjs +43 -0
  305. package/validation/rules/NoUnusedFragmentsRule.d.ts +13 -0
  306. package/validation/rules/NoUnusedFragmentsRule.js +59 -0
  307. package/validation/rules/NoUnusedFragmentsRule.mjs +52 -0
  308. package/validation/rules/NoUnusedVariablesRule.d.ts +13 -0
  309. package/validation/rules/NoUnusedVariablesRule.js +55 -0
  310. package/validation/rules/NoUnusedVariablesRule.mjs +48 -0
  311. package/validation/rules/OverlappingFieldsCanBeMergedRule-old.js +805 -0
  312. package/validation/rules/OverlappingFieldsCanBeMergedRule-old.mjs +788 -0
  313. package/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts +14 -0
  314. package/validation/rules/OverlappingFieldsCanBeMergedRule.js +805 -0
  315. package/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +788 -0
  316. package/validation/rules/PossibleFragmentSpreadsRule.d.ts +12 -0
  317. package/validation/rules/PossibleFragmentSpreadsRule.js +91 -0
  318. package/validation/rules/PossibleFragmentSpreadsRule.mjs +69 -0
  319. package/validation/rules/PossibleTypeExtensionsRule.d.ts +10 -0
  320. package/validation/rules/PossibleTypeExtensionsRule.js +167 -0
  321. package/validation/rules/PossibleTypeExtensionsRule.mjs +147 -0
  322. package/validation/rules/ProvidedRequiredArgumentsRule.d.ts +20 -0
  323. package/validation/rules/ProvidedRequiredArgumentsRule.js +158 -0
  324. package/validation/rules/ProvidedRequiredArgumentsRule.mjs +138 -0
  325. package/validation/rules/ScalarLeafsRule.d.ts +9 -0
  326. package/validation/rules/ScalarLeafsRule.js +51 -0
  327. package/validation/rules/ScalarLeafsRule.mjs +42 -0
  328. package/validation/rules/SingleFieldSubscriptionsRule.d.ts +13 -0
  329. package/validation/rules/SingleFieldSubscriptionsRule.js +82 -0
  330. package/validation/rules/SingleFieldSubscriptionsRule.mjs +73 -0
  331. package/validation/rules/UniqueArgumentDefinitionNamesRule.d.ts +11 -0
  332. package/validation/rules/UniqueArgumentDefinitionNamesRule.js +90 -0
  333. package/validation/rules/UniqueArgumentDefinitionNamesRule.mjs +79 -0
  334. package/validation/rules/UniqueArgumentNamesRule.d.ts +13 -0
  335. package/validation/rules/UniqueArgumentNamesRule.js +53 -0
  336. package/validation/rules/UniqueArgumentNamesRule.mjs +42 -0
  337. package/validation/rules/UniqueDirectiveNamesRule.d.ts +10 -0
  338. package/validation/rules/UniqueDirectiveNamesRule.js +50 -0
  339. package/validation/rules/UniqueDirectiveNamesRule.mjs +43 -0
  340. package/validation/rules/UniqueDirectivesPerLocationRule.d.ts +16 -0
  341. package/validation/rules/UniqueDirectivesPerLocationRule.js +93 -0
  342. package/validation/rules/UniqueDirectivesPerLocationRule.mjs +83 -0
  343. package/validation/rules/UniqueEnumValueNamesRule.d.ts +10 -0
  344. package/validation/rules/UniqueEnumValueNamesRule.js +71 -0
  345. package/validation/rules/UniqueEnumValueNamesRule.mjs +60 -0
  346. package/validation/rules/UniqueFieldDefinitionNamesRule.d.ts +10 -0
  347. package/validation/rules/UniqueFieldDefinitionNamesRule.js +83 -0
  348. package/validation/rules/UniqueFieldDefinitionNamesRule.mjs +75 -0
  349. package/validation/rules/UniqueFragmentNamesRule.d.ts +12 -0
  350. package/validation/rules/UniqueFragmentNamesRule.js +39 -0
  351. package/validation/rules/UniqueFragmentNamesRule.mjs +32 -0
  352. package/validation/rules/UniqueInputFieldNamesRule.d.ts +13 -0
  353. package/validation/rules/UniqueInputFieldNamesRule.js +52 -0
  354. package/validation/rules/UniqueInputFieldNamesRule.mjs +44 -0
  355. package/validation/rules/UniqueOperationNamesRule.d.ts +12 -0
  356. package/validation/rules/UniqueOperationNamesRule.js +41 -0
  357. package/validation/rules/UniqueOperationNamesRule.mjs +34 -0
  358. package/validation/rules/UniqueOperationTypesRule.d.ts +10 -0
  359. package/validation/rules/UniqueOperationTypesRule.js +67 -0
  360. package/validation/rules/UniqueOperationTypesRule.mjs +60 -0
  361. package/validation/rules/UniqueTypeNamesRule.d.ts +10 -0
  362. package/validation/rules/UniqueTypeNamesRule.js +53 -0
  363. package/validation/rules/UniqueTypeNamesRule.mjs +46 -0
  364. package/validation/rules/UniqueVariableNamesRule.d.ts +10 -0
  365. package/validation/rules/UniqueVariableNamesRule.js +47 -0
  366. package/validation/rules/UniqueVariableNamesRule.mjs +39 -0
  367. package/validation/rules/ValuesOfCorrectTypeRule.d.ts +13 -0
  368. package/validation/rules/ValuesOfCorrectTypeRule.js +183 -0
  369. package/validation/rules/ValuesOfCorrectTypeRule.mjs +164 -0
  370. package/validation/rules/VariablesAreInputTypesRule.d.ts +13 -0
  371. package/validation/rules/VariablesAreInputTypesRule.js +44 -0
  372. package/validation/rules/VariablesAreInputTypesRule.mjs +31 -0
  373. package/validation/rules/VariablesInAllowedPositionRule.d.ts +12 -0
  374. package/validation/rules/VariablesInAllowedPositionRule.js +114 -0
  375. package/validation/rules/VariablesInAllowedPositionRule.mjs +95 -0
  376. package/validation/rules/custom/NoDeprecatedCustomRule.d.ts +15 -0
  377. package/validation/rules/custom/NoDeprecatedCustomRule.js +121 -0
  378. package/validation/rules/custom/NoDeprecatedCustomRule.mjs +107 -0
  379. package/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts +15 -0
  380. package/validation/rules/custom/NoSchemaIntrospectionCustomRule.js +39 -0
  381. package/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs +30 -0
  382. package/validation/specifiedRules.d.ts +12 -0
  383. package/validation/specifiedRules.js +160 -0
  384. package/validation/specifiedRules.mjs +123 -0
  385. package/validation/validate.d.ts +61 -0
  386. package/validation/validate.js +151 -0
  387. package/validation/validate.mjs +133 -0
  388. package/version.d.ts +13 -0
  389. package/version.js +25 -0
  390. package/version.mjs +17 -0
@@ -0,0 +1,917 @@
1
+ import type { Maybe } from '../jsutils/Maybe';
2
+ import type { ObjMap } from '../jsutils/ObjMap';
3
+ import type { Path } from '../jsutils/Path';
4
+ import type { PromiseOrValue } from '../jsutils/PromiseOrValue';
5
+ import type {
6
+ EnumTypeDefinitionNode,
7
+ EnumTypeExtensionNode,
8
+ EnumValueDefinitionNode,
9
+ FieldDefinitionNode,
10
+ FieldNode,
11
+ FragmentDefinitionNode,
12
+ InputObjectTypeDefinitionNode,
13
+ InputObjectTypeExtensionNode,
14
+ InputValueDefinitionNode,
15
+ InterfaceTypeDefinitionNode,
16
+ InterfaceTypeExtensionNode,
17
+ ObjectTypeDefinitionNode,
18
+ ObjectTypeExtensionNode,
19
+ OperationDefinitionNode,
20
+ ScalarTypeDefinitionNode,
21
+ ScalarTypeExtensionNode,
22
+ UnionTypeDefinitionNode,
23
+ UnionTypeExtensionNode,
24
+ ValueNode,
25
+ } from '../language/ast';
26
+ import type { GraphQLSchema } from './schema';
27
+ /**
28
+ * These are all of the possible kinds of types.
29
+ */
30
+ export declare type GraphQLType =
31
+ | GraphQLScalarType
32
+ | GraphQLObjectType
33
+ | GraphQLInterfaceType
34
+ | GraphQLUnionType
35
+ | GraphQLEnumType
36
+ | GraphQLInputObjectType
37
+ | GraphQLList<GraphQLType>
38
+ | GraphQLNonNull<
39
+ | GraphQLScalarType
40
+ | GraphQLObjectType
41
+ | GraphQLInterfaceType
42
+ | GraphQLUnionType
43
+ | GraphQLEnumType
44
+ | GraphQLInputObjectType
45
+ | GraphQLList<GraphQLType>
46
+ >;
47
+ export declare function isType(type: unknown): type is GraphQLType;
48
+ export declare function assertType(type: unknown): GraphQLType;
49
+ /**
50
+ * There are predicates for each kind of GraphQL type.
51
+ */
52
+ export declare function isScalarType(type: unknown): type is GraphQLScalarType;
53
+ export declare function assertScalarType(type: unknown): GraphQLScalarType;
54
+ export declare function isObjectType(type: unknown): type is GraphQLObjectType;
55
+ export declare function assertObjectType(type: unknown): GraphQLObjectType;
56
+ export declare function isInterfaceType(
57
+ type: unknown,
58
+ ): type is GraphQLInterfaceType;
59
+ export declare function assertInterfaceType(
60
+ type: unknown,
61
+ ): GraphQLInterfaceType;
62
+ export declare function isUnionType(type: unknown): type is GraphQLUnionType;
63
+ export declare function assertUnionType(type: unknown): GraphQLUnionType;
64
+ export declare function isEnumType(type: unknown): type is GraphQLEnumType;
65
+ export declare function assertEnumType(type: unknown): GraphQLEnumType;
66
+ export declare function isInputObjectType(
67
+ type: unknown,
68
+ ): type is GraphQLInputObjectType;
69
+ export declare function assertInputObjectType(
70
+ type: unknown,
71
+ ): GraphQLInputObjectType;
72
+ export declare function isListType(
73
+ type: GraphQLInputType,
74
+ ): type is GraphQLList<GraphQLInputType>;
75
+ export declare function isListType(
76
+ type: GraphQLOutputType,
77
+ ): type is GraphQLList<GraphQLOutputType>;
78
+ export declare function isListType(
79
+ type: unknown,
80
+ ): type is GraphQLList<GraphQLType>;
81
+ export declare function assertListType(type: unknown): GraphQLList<GraphQLType>;
82
+ export declare function isNonNullType(
83
+ type: GraphQLInputType,
84
+ ): type is GraphQLNonNull<GraphQLInputType>;
85
+ export declare function isNonNullType(
86
+ type: GraphQLOutputType,
87
+ ): type is GraphQLNonNull<GraphQLOutputType>;
88
+ export declare function isNonNullType(
89
+ type: unknown,
90
+ ): type is GraphQLNonNull<GraphQLType>;
91
+ export declare function assertNonNullType(
92
+ type: unknown,
93
+ ): GraphQLNonNull<GraphQLType>;
94
+ /**
95
+ * These types may be used as input types for arguments and directives.
96
+ */
97
+ export declare type GraphQLInputType =
98
+ | GraphQLScalarType
99
+ | GraphQLEnumType
100
+ | GraphQLInputObjectType
101
+ | GraphQLList<GraphQLInputType>
102
+ | GraphQLNonNull<
103
+ | GraphQLScalarType
104
+ | GraphQLEnumType
105
+ | GraphQLInputObjectType
106
+ | GraphQLList<GraphQLInputType>
107
+ >;
108
+ export declare function isInputType(type: unknown): type is GraphQLInputType;
109
+ export declare function assertInputType(type: unknown): GraphQLInputType;
110
+ /**
111
+ * These types may be used as output types as the result of fields.
112
+ */
113
+ export declare type GraphQLOutputType =
114
+ | GraphQLScalarType
115
+ | GraphQLObjectType
116
+ | GraphQLInterfaceType
117
+ | GraphQLUnionType
118
+ | GraphQLEnumType
119
+ | GraphQLList<GraphQLOutputType>
120
+ | GraphQLNonNull<
121
+ | GraphQLScalarType
122
+ | GraphQLObjectType
123
+ | GraphQLInterfaceType
124
+ | GraphQLUnionType
125
+ | GraphQLEnumType
126
+ | GraphQLList<GraphQLOutputType>
127
+ >;
128
+ export declare function isOutputType(type: unknown): type is GraphQLOutputType;
129
+ export declare function assertOutputType(type: unknown): GraphQLOutputType;
130
+ /**
131
+ * These types may describe types which may be leaf values.
132
+ */
133
+ export declare type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType;
134
+ export declare function isLeafType(type: unknown): type is GraphQLLeafType;
135
+ export declare function assertLeafType(type: unknown): GraphQLLeafType;
136
+ /**
137
+ * These types may describe the parent context of a selection set.
138
+ */
139
+ export declare type GraphQLCompositeType =
140
+ | GraphQLObjectType
141
+ | GraphQLInterfaceType
142
+ | GraphQLUnionType;
143
+ export declare function isCompositeType(
144
+ type: unknown,
145
+ ): type is GraphQLCompositeType;
146
+ export declare function assertCompositeType(
147
+ type: unknown,
148
+ ): GraphQLCompositeType;
149
+ /**
150
+ * These types may describe the parent context of a selection set.
151
+ */
152
+ export declare type GraphQLAbstractType =
153
+ | GraphQLInterfaceType
154
+ | GraphQLUnionType;
155
+ export declare function isAbstractType(
156
+ type: unknown,
157
+ ): type is GraphQLAbstractType;
158
+ export declare function assertAbstractType(type: unknown): GraphQLAbstractType;
159
+ /**
160
+ * List Type Wrapper
161
+ *
162
+ * A list is a wrapping type which points to another type.
163
+ * Lists are often created within the context of defining the fields of
164
+ * an object type.
165
+ *
166
+ * Example:
167
+ *
168
+ * ```ts
169
+ * const PersonType = new GraphQLObjectType({
170
+ * name: 'Person',
171
+ * fields: () => ({
172
+ * parents: { type: new GraphQLList(PersonType) },
173
+ * children: { type: new GraphQLList(PersonType) },
174
+ * })
175
+ * })
176
+ * ```
177
+ */
178
+ export declare class GraphQLList<T extends GraphQLType> {
179
+ readonly ofType: T;
180
+ constructor(ofType: T);
181
+ get [Symbol.toStringTag](): string;
182
+ toString(): string;
183
+ toJSON(): string;
184
+ }
185
+ /**
186
+ * Non-Null Type Wrapper
187
+ *
188
+ * A non-null is a wrapping type which points to another type.
189
+ * Non-null types enforce that their values are never null and can ensure
190
+ * an error is raised if this ever occurs during a request. It is useful for
191
+ * fields which you can make a strong guarantee on non-nullability, for example
192
+ * usually the id field of a database row will never be null.
193
+ *
194
+ * Example:
195
+ *
196
+ * ```ts
197
+ * const RowType = new GraphQLObjectType({
198
+ * name: 'Row',
199
+ * fields: () => ({
200
+ * id: { type: new GraphQLNonNull(GraphQLString) },
201
+ * })
202
+ * })
203
+ * ```
204
+ * Note: the enforcement of non-nullability occurs within the executor.
205
+ */
206
+ export declare class GraphQLNonNull<T extends GraphQLNullableType> {
207
+ readonly ofType: T;
208
+ constructor(ofType: T);
209
+ get [Symbol.toStringTag](): string;
210
+ toString(): string;
211
+ toJSON(): string;
212
+ }
213
+ /**
214
+ * These types wrap and modify other types
215
+ */
216
+ export declare type GraphQLWrappingType =
217
+ | GraphQLList<GraphQLType>
218
+ | GraphQLNonNull<GraphQLType>;
219
+ export declare function isWrappingType(
220
+ type: unknown,
221
+ ): type is GraphQLWrappingType;
222
+ export declare function assertWrappingType(type: unknown): GraphQLWrappingType;
223
+ /**
224
+ * These types can all accept null as a value.
225
+ */
226
+ export declare type GraphQLNullableType =
227
+ | GraphQLScalarType
228
+ | GraphQLObjectType
229
+ | GraphQLInterfaceType
230
+ | GraphQLUnionType
231
+ | GraphQLEnumType
232
+ | GraphQLInputObjectType
233
+ | GraphQLList<GraphQLType>;
234
+ export declare function isNullableType(
235
+ type: unknown,
236
+ ): type is GraphQLNullableType;
237
+ export declare function assertNullableType(type: unknown): GraphQLNullableType;
238
+ export declare function getNullableType(type: undefined | null): void;
239
+ export declare function getNullableType<T extends GraphQLNullableType>(
240
+ type: T | GraphQLNonNull<T>,
241
+ ): T;
242
+ export declare function getNullableType(
243
+ type: Maybe<GraphQLType>,
244
+ ): GraphQLNullableType | undefined;
245
+ /**
246
+ * These named types do not include modifiers like List or NonNull.
247
+ */
248
+ export declare type GraphQLNamedType =
249
+ | GraphQLNamedInputType
250
+ | GraphQLNamedOutputType;
251
+ export declare type GraphQLNamedInputType =
252
+ | GraphQLScalarType
253
+ | GraphQLEnumType
254
+ | GraphQLInputObjectType;
255
+ export declare type GraphQLNamedOutputType =
256
+ | GraphQLScalarType
257
+ | GraphQLObjectType
258
+ | GraphQLInterfaceType
259
+ | GraphQLUnionType
260
+ | GraphQLEnumType;
261
+ export declare function isNamedType(type: unknown): type is GraphQLNamedType;
262
+ export declare function assertNamedType(type: unknown): GraphQLNamedType;
263
+ export declare function getNamedType(type: undefined | null): void;
264
+ export declare function getNamedType(
265
+ type: GraphQLInputType,
266
+ ): GraphQLNamedInputType;
267
+ export declare function getNamedType(
268
+ type: GraphQLOutputType,
269
+ ): GraphQLNamedOutputType;
270
+ export declare function getNamedType(type: GraphQLType): GraphQLNamedType;
271
+ export declare function getNamedType(
272
+ type: Maybe<GraphQLType>,
273
+ ): GraphQLNamedType | undefined;
274
+ /**
275
+ * Used while defining GraphQL types to allow for circular references in
276
+ * otherwise immutable type definitions.
277
+ */
278
+ export declare type ThunkReadonlyArray<T> =
279
+ | (() => ReadonlyArray<T>)
280
+ | ReadonlyArray<T>;
281
+ export declare type ThunkObjMap<T> = (() => ObjMap<T>) | ObjMap<T>;
282
+ export declare function resolveReadonlyArrayThunk<T>(
283
+ thunk: ThunkReadonlyArray<T>,
284
+ ): ReadonlyArray<T>;
285
+ export declare function resolveObjMapThunk<T>(thunk: ThunkObjMap<T>): ObjMap<T>;
286
+ /**
287
+ * Custom extensions
288
+ *
289
+ * @remarks
290
+ * Use a unique identifier name for your extension, for example the name of
291
+ * your library or project. Do not use a shortened identifier as this increases
292
+ * the risk of conflicts. We recommend you add at most one extension field,
293
+ * an object which can contain all the values you need.
294
+ */
295
+ export interface GraphQLScalarTypeExtensions {
296
+ [attributeName: string]: unknown;
297
+ }
298
+ /**
299
+ * Scalar Type Definition
300
+ *
301
+ * The leaf values of any request and input values to arguments are
302
+ * Scalars (or Enums) and are defined with a name and a series of functions
303
+ * used to parse input from ast or variables and to ensure validity.
304
+ *
305
+ * If a type's serialize function does not return a value (i.e. it returns
306
+ * `undefined`) then an error will be raised and a `null` value will be returned
307
+ * in the response. If the serialize function returns `null`, then no error will
308
+ * be included in the response.
309
+ *
310
+ * Example:
311
+ *
312
+ * ```ts
313
+ * const OddType = new GraphQLScalarType({
314
+ * name: 'Odd',
315
+ * serialize(value) {
316
+ * if (value % 2 === 1) {
317
+ * return value;
318
+ * }
319
+ * }
320
+ * });
321
+ * ```
322
+ */
323
+ export declare class GraphQLScalarType<
324
+ TInternal = unknown,
325
+ TExternal = TInternal,
326
+ > {
327
+ name: string;
328
+ description: Maybe<string>;
329
+ specifiedByURL: Maybe<string>;
330
+ serialize: GraphQLScalarSerializer<TExternal>;
331
+ parseValue: GraphQLScalarValueParser<TInternal>;
332
+ parseLiteral: GraphQLScalarLiteralParser<TInternal>;
333
+ extensions: Readonly<GraphQLScalarTypeExtensions>;
334
+ astNode: Maybe<ScalarTypeDefinitionNode>;
335
+ extensionASTNodes: ReadonlyArray<ScalarTypeExtensionNode>;
336
+ constructor(config: Readonly<GraphQLScalarTypeConfig<TInternal, TExternal>>);
337
+ get [Symbol.toStringTag](): string;
338
+ toConfig(): GraphQLScalarTypeNormalizedConfig<TInternal, TExternal>;
339
+ toString(): string;
340
+ toJSON(): string;
341
+ }
342
+ export declare type GraphQLScalarSerializer<TExternal> = (
343
+ outputValue: unknown,
344
+ ) => TExternal;
345
+ export declare type GraphQLScalarValueParser<TInternal> = (
346
+ inputValue: unknown,
347
+ ) => TInternal;
348
+ export declare type GraphQLScalarLiteralParser<TInternal> = (
349
+ valueNode: ValueNode,
350
+ variables?: Maybe<ObjMap<unknown>>,
351
+ ) => TInternal;
352
+ export interface GraphQLScalarTypeConfig<TInternal, TExternal> {
353
+ name: string;
354
+ description?: Maybe<string>;
355
+ specifiedByURL?: Maybe<string>;
356
+ /** Serializes an internal value to include in a response. */
357
+ serialize?: GraphQLScalarSerializer<TExternal>;
358
+ /** Parses an externally provided value to use as an input. */
359
+ parseValue?: GraphQLScalarValueParser<TInternal>;
360
+ /** Parses an externally provided literal value to use as an input. */
361
+ parseLiteral?: GraphQLScalarLiteralParser<TInternal>;
362
+ extensions?: Maybe<Readonly<GraphQLScalarTypeExtensions>>;
363
+ astNode?: Maybe<ScalarTypeDefinitionNode>;
364
+ extensionASTNodes?: Maybe<ReadonlyArray<ScalarTypeExtensionNode>>;
365
+ }
366
+ interface GraphQLScalarTypeNormalizedConfig<TInternal, TExternal>
367
+ extends GraphQLScalarTypeConfig<TInternal, TExternal> {
368
+ serialize: GraphQLScalarSerializer<TExternal>;
369
+ parseValue: GraphQLScalarValueParser<TInternal>;
370
+ parseLiteral: GraphQLScalarLiteralParser<TInternal>;
371
+ extensions: Readonly<GraphQLScalarTypeExtensions>;
372
+ extensionASTNodes: ReadonlyArray<ScalarTypeExtensionNode>;
373
+ }
374
+ /**
375
+ * Custom extensions
376
+ *
377
+ * @remarks
378
+ * Use a unique identifier name for your extension, for example the name of
379
+ * your library or project. Do not use a shortened identifier as this increases
380
+ * the risk of conflicts. We recommend you add at most one extension field,
381
+ * an object which can contain all the values you need.
382
+ *
383
+ * We've provided these template arguments because this is an open type and
384
+ * you may find them useful.
385
+ */
386
+ export interface GraphQLObjectTypeExtensions<_TSource = any, _TContext = any> {
387
+ [attributeName: string]: unknown;
388
+ }
389
+ /**
390
+ * Object Type Definition
391
+ *
392
+ * Almost all of the GraphQL types you define will be object types. Object types
393
+ * have a name, but most importantly describe their fields.
394
+ *
395
+ * Example:
396
+ *
397
+ * ```ts
398
+ * const AddressType = new GraphQLObjectType({
399
+ * name: 'Address',
400
+ * fields: {
401
+ * street: { type: GraphQLString },
402
+ * number: { type: GraphQLInt },
403
+ * formatted: {
404
+ * type: GraphQLString,
405
+ * resolve(obj) {
406
+ * return obj.number + ' ' + obj.street
407
+ * }
408
+ * }
409
+ * }
410
+ * });
411
+ * ```
412
+ *
413
+ * When two types need to refer to each other, or a type needs to refer to
414
+ * itself in a field, you can use a function expression (aka a closure or a
415
+ * thunk) to supply the fields lazily.
416
+ *
417
+ * Example:
418
+ *
419
+ * ```ts
420
+ * const PersonType = new GraphQLObjectType({
421
+ * name: 'Person',
422
+ * fields: () => ({
423
+ * name: { type: GraphQLString },
424
+ * bestFriend: { type: PersonType },
425
+ * })
426
+ * });
427
+ * ```
428
+ */
429
+ export declare class GraphQLObjectType<TSource = any, TContext = any> {
430
+ name: string;
431
+ description: Maybe<string>;
432
+ isTypeOf: Maybe<GraphQLIsTypeOfFn<TSource, TContext>>;
433
+ extensions: Readonly<GraphQLObjectTypeExtensions<TSource, TContext>>;
434
+ astNode: Maybe<ObjectTypeDefinitionNode>;
435
+ extensionASTNodes: ReadonlyArray<ObjectTypeExtensionNode>;
436
+ private _fields;
437
+ private _interfaces;
438
+ constructor(config: Readonly<GraphQLObjectTypeConfig<TSource, TContext>>);
439
+ get [Symbol.toStringTag](): string;
440
+ getFields(): GraphQLFieldMap<TSource, TContext>;
441
+ getInterfaces(): ReadonlyArray<GraphQLInterfaceType>;
442
+ toConfig(): GraphQLObjectTypeNormalizedConfig<TSource, TContext>;
443
+ toString(): string;
444
+ toJSON(): string;
445
+ }
446
+ export declare function defineArguments(
447
+ config: GraphQLFieldConfigArgumentMap,
448
+ ): ReadonlyArray<GraphQLArgument>;
449
+ /**
450
+ * @internal
451
+ */
452
+ export declare function argsToArgsConfig(
453
+ args: ReadonlyArray<GraphQLArgument>,
454
+ ): GraphQLFieldConfigArgumentMap;
455
+ export interface GraphQLObjectTypeConfig<TSource, TContext> {
456
+ name: string;
457
+ description?: Maybe<string>;
458
+ interfaces?: ThunkReadonlyArray<GraphQLInterfaceType>;
459
+ fields: ThunkObjMap<GraphQLFieldConfig<TSource, TContext>>;
460
+ isTypeOf?: Maybe<GraphQLIsTypeOfFn<TSource, TContext>>;
461
+ extensions?: Maybe<Readonly<GraphQLObjectTypeExtensions<TSource, TContext>>>;
462
+ astNode?: Maybe<ObjectTypeDefinitionNode>;
463
+ extensionASTNodes?: Maybe<ReadonlyArray<ObjectTypeExtensionNode>>;
464
+ }
465
+ interface GraphQLObjectTypeNormalizedConfig<TSource, TContext>
466
+ extends GraphQLObjectTypeConfig<any, any> {
467
+ interfaces: ReadonlyArray<GraphQLInterfaceType>;
468
+ fields: GraphQLFieldConfigMap<any, any>;
469
+ extensions: Readonly<GraphQLObjectTypeExtensions<TSource, TContext>>;
470
+ extensionASTNodes: ReadonlyArray<ObjectTypeExtensionNode>;
471
+ }
472
+ export declare type GraphQLTypeResolver<TSource, TContext> = (
473
+ value: TSource,
474
+ context: TContext,
475
+ info: GraphQLResolveInfo,
476
+ abstractType: GraphQLAbstractType,
477
+ ) => PromiseOrValue<string | undefined>;
478
+ export declare type GraphQLIsTypeOfFn<TSource, TContext> = (
479
+ source: TSource,
480
+ context: TContext,
481
+ info: GraphQLResolveInfo,
482
+ ) => PromiseOrValue<boolean>;
483
+ export declare type GraphQLFieldResolver<
484
+ TSource,
485
+ TContext,
486
+ TArgs = any,
487
+ TResult = unknown,
488
+ > = (
489
+ source: TSource,
490
+ args: TArgs,
491
+ context: TContext,
492
+ info: GraphQLResolveInfo,
493
+ ) => TResult;
494
+ export interface GraphQLResolveInfo {
495
+ readonly fieldName: string;
496
+ readonly fieldNodes: ReadonlyArray<FieldNode>;
497
+ readonly returnType: GraphQLOutputType;
498
+ readonly parentType: GraphQLObjectType;
499
+ readonly path: Path;
500
+ readonly schema: GraphQLSchema;
501
+ readonly fragments: ObjMap<FragmentDefinitionNode>;
502
+ readonly rootValue: unknown;
503
+ readonly operation: OperationDefinitionNode;
504
+ readonly variableValues: {
505
+ [variable: string]: unknown;
506
+ };
507
+ }
508
+ /**
509
+ * Custom extensions
510
+ *
511
+ * @remarks
512
+ * Use a unique identifier name for your extension, for example the name of
513
+ * your library or project. Do not use a shortened identifier as this increases
514
+ * the risk of conflicts. We recommend you add at most one extension field,
515
+ * an object which can contain all the values you need.
516
+ *
517
+ * We've provided these template arguments because this is an open type and
518
+ * you may find them useful.
519
+ */
520
+ export interface GraphQLFieldExtensions<_TSource, _TContext, _TArgs = any> {
521
+ [attributeName: string]: unknown;
522
+ }
523
+ export interface GraphQLFieldConfig<TSource, TContext, TArgs = any> {
524
+ description?: Maybe<string>;
525
+ type: GraphQLOutputType;
526
+ args?: GraphQLFieldConfigArgumentMap;
527
+ resolve?: GraphQLFieldResolver<TSource, TContext, TArgs>;
528
+ subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs>;
529
+ deprecationReason?: Maybe<string>;
530
+ extensions?: Maybe<
531
+ Readonly<GraphQLFieldExtensions<TSource, TContext, TArgs>>
532
+ >;
533
+ astNode?: Maybe<FieldDefinitionNode>;
534
+ }
535
+ export declare type GraphQLFieldConfigArgumentMap =
536
+ ObjMap<GraphQLArgumentConfig>;
537
+ /**
538
+ * Custom extensions
539
+ *
540
+ * @remarks
541
+ * Use a unique identifier name for your extension, for example the name of
542
+ * your library or project. Do not use a shortened identifier as this increases
543
+ * the risk of conflicts. We recommend you add at most one extension field,
544
+ * an object which can contain all the values you need.
545
+ */
546
+ export interface GraphQLArgumentExtensions {
547
+ [attributeName: string]: unknown;
548
+ }
549
+ export interface GraphQLArgumentConfig {
550
+ description?: Maybe<string>;
551
+ type: GraphQLInputType;
552
+ defaultValue?: unknown;
553
+ deprecationReason?: Maybe<string>;
554
+ extensions?: Maybe<Readonly<GraphQLArgumentExtensions>>;
555
+ astNode?: Maybe<InputValueDefinitionNode>;
556
+ }
557
+ export declare type GraphQLFieldConfigMap<TSource, TContext> = ObjMap<
558
+ GraphQLFieldConfig<TSource, TContext>
559
+ >;
560
+ export interface GraphQLField<TSource, TContext, TArgs = any> {
561
+ name: string;
562
+ description: Maybe<string>;
563
+ type: GraphQLOutputType;
564
+ args: ReadonlyArray<GraphQLArgument>;
565
+ resolve?: GraphQLFieldResolver<TSource, TContext, TArgs>;
566
+ subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs>;
567
+ deprecationReason: Maybe<string>;
568
+ extensions: Readonly<GraphQLFieldExtensions<TSource, TContext, TArgs>>;
569
+ astNode: Maybe<FieldDefinitionNode>;
570
+ }
571
+ export interface GraphQLArgument {
572
+ name: string;
573
+ description: Maybe<string>;
574
+ type: GraphQLInputType;
575
+ defaultValue: unknown;
576
+ deprecationReason: Maybe<string>;
577
+ extensions: Readonly<GraphQLArgumentExtensions>;
578
+ astNode: Maybe<InputValueDefinitionNode>;
579
+ }
580
+ export declare function isRequiredArgument(arg: GraphQLArgument): boolean;
581
+ export declare type GraphQLFieldMap<TSource, TContext> = ObjMap<
582
+ GraphQLField<TSource, TContext>
583
+ >;
584
+ /**
585
+ * Custom extensions
586
+ *
587
+ * @remarks
588
+ * Use a unique identifier name for your extension, for example the name of
589
+ * your library or project. Do not use a shortened identifier as this increases
590
+ * the risk of conflicts. We recommend you add at most one extension field,
591
+ * an object which can contain all the values you need.
592
+ */
593
+ export interface GraphQLInterfaceTypeExtensions {
594
+ [attributeName: string]: unknown;
595
+ }
596
+ /**
597
+ * Interface Type Definition
598
+ *
599
+ * When a field can return one of a heterogeneous set of types, a Interface type
600
+ * is used to describe what types are possible, what fields are in common across
601
+ * all types, as well as a function to determine which type is actually used
602
+ * when the field is resolved.
603
+ *
604
+ * Example:
605
+ *
606
+ * ```ts
607
+ * const EntityType = new GraphQLInterfaceType({
608
+ * name: 'Entity',
609
+ * fields: {
610
+ * name: { type: GraphQLString }
611
+ * }
612
+ * });
613
+ * ```
614
+ */
615
+ export declare class GraphQLInterfaceType {
616
+ name: string;
617
+ description: Maybe<string>;
618
+ resolveType: Maybe<GraphQLTypeResolver<any, any>>;
619
+ extensions: Readonly<GraphQLInterfaceTypeExtensions>;
620
+ astNode: Maybe<InterfaceTypeDefinitionNode>;
621
+ extensionASTNodes: ReadonlyArray<InterfaceTypeExtensionNode>;
622
+ private _fields;
623
+ private _interfaces;
624
+ constructor(config: Readonly<GraphQLInterfaceTypeConfig<any, any>>);
625
+ get [Symbol.toStringTag](): string;
626
+ getFields(): GraphQLFieldMap<any, any>;
627
+ getInterfaces(): ReadonlyArray<GraphQLInterfaceType>;
628
+ toConfig(): GraphQLInterfaceTypeNormalizedConfig;
629
+ toString(): string;
630
+ toJSON(): string;
631
+ }
632
+ export interface GraphQLInterfaceTypeConfig<TSource, TContext> {
633
+ name: string;
634
+ description?: Maybe<string>;
635
+ interfaces?: ThunkReadonlyArray<GraphQLInterfaceType>;
636
+ fields: ThunkObjMap<GraphQLFieldConfig<TSource, TContext>>;
637
+ /**
638
+ * Optionally provide a custom type resolver function. If one is not provided,
639
+ * the default implementation will call `isTypeOf` on each implementing
640
+ * Object type.
641
+ */
642
+ resolveType?: Maybe<GraphQLTypeResolver<TSource, TContext>>;
643
+ extensions?: Maybe<Readonly<GraphQLInterfaceTypeExtensions>>;
644
+ astNode?: Maybe<InterfaceTypeDefinitionNode>;
645
+ extensionASTNodes?: Maybe<ReadonlyArray<InterfaceTypeExtensionNode>>;
646
+ }
647
+ export interface GraphQLInterfaceTypeNormalizedConfig
648
+ extends GraphQLInterfaceTypeConfig<any, any> {
649
+ interfaces: ReadonlyArray<GraphQLInterfaceType>;
650
+ fields: GraphQLFieldConfigMap<any, any>;
651
+ extensions: Readonly<GraphQLInterfaceTypeExtensions>;
652
+ extensionASTNodes: ReadonlyArray<InterfaceTypeExtensionNode>;
653
+ }
654
+ /**
655
+ * Custom extensions
656
+ *
657
+ * @remarks
658
+ * Use a unique identifier name for your extension, for example the name of
659
+ * your library or project. Do not use a shortened identifier as this increases
660
+ * the risk of conflicts. We recommend you add at most one extension field,
661
+ * an object which can contain all the values you need.
662
+ */
663
+ export interface GraphQLUnionTypeExtensions {
664
+ [attributeName: string]: unknown;
665
+ }
666
+ /**
667
+ * Union Type Definition
668
+ *
669
+ * When a field can return one of a heterogeneous set of types, a Union type
670
+ * is used to describe what types are possible as well as providing a function
671
+ * to determine which type is actually used when the field is resolved.
672
+ *
673
+ * Example:
674
+ *
675
+ * ```ts
676
+ * const PetType = new GraphQLUnionType({
677
+ * name: 'Pet',
678
+ * types: [ DogType, CatType ],
679
+ * resolveType(value) {
680
+ * if (value instanceof Dog) {
681
+ * return DogType;
682
+ * }
683
+ * if (value instanceof Cat) {
684
+ * return CatType;
685
+ * }
686
+ * }
687
+ * });
688
+ * ```
689
+ */
690
+ export declare class GraphQLUnionType {
691
+ name: string;
692
+ description: Maybe<string>;
693
+ resolveType: Maybe<GraphQLTypeResolver<any, any>>;
694
+ extensions: Readonly<GraphQLUnionTypeExtensions>;
695
+ astNode: Maybe<UnionTypeDefinitionNode>;
696
+ extensionASTNodes: ReadonlyArray<UnionTypeExtensionNode>;
697
+ private _types;
698
+ constructor(config: Readonly<GraphQLUnionTypeConfig<any, any>>);
699
+ get [Symbol.toStringTag](): string;
700
+ getTypes(): ReadonlyArray<GraphQLObjectType>;
701
+ toConfig(): GraphQLUnionTypeNormalizedConfig;
702
+ toString(): string;
703
+ toJSON(): string;
704
+ }
705
+ export interface GraphQLUnionTypeConfig<TSource, TContext> {
706
+ name: string;
707
+ description?: Maybe<string>;
708
+ types: ThunkReadonlyArray<GraphQLObjectType>;
709
+ /**
710
+ * Optionally provide a custom type resolver function. If one is not provided,
711
+ * the default implementation will call `isTypeOf` on each implementing
712
+ * Object type.
713
+ */
714
+ resolveType?: Maybe<GraphQLTypeResolver<TSource, TContext>>;
715
+ extensions?: Maybe<Readonly<GraphQLUnionTypeExtensions>>;
716
+ astNode?: Maybe<UnionTypeDefinitionNode>;
717
+ extensionASTNodes?: Maybe<ReadonlyArray<UnionTypeExtensionNode>>;
718
+ }
719
+ interface GraphQLUnionTypeNormalizedConfig
720
+ extends GraphQLUnionTypeConfig<any, any> {
721
+ types: ReadonlyArray<GraphQLObjectType>;
722
+ extensions: Readonly<GraphQLUnionTypeExtensions>;
723
+ extensionASTNodes: ReadonlyArray<UnionTypeExtensionNode>;
724
+ }
725
+ /**
726
+ * Custom extensions
727
+ *
728
+ * @remarks
729
+ * Use a unique identifier name for your extension, for example the name of
730
+ * your library or project. Do not use a shortened identifier as this increases
731
+ * the risk of conflicts. We recommend you add at most one extension field,
732
+ * an object which can contain all the values you need.
733
+ */
734
+ export interface GraphQLEnumTypeExtensions {
735
+ [attributeName: string]: unknown;
736
+ }
737
+ /**
738
+ * Enum Type Definition
739
+ *
740
+ * Some leaf values of requests and input values are Enums. GraphQL serializes
741
+ * Enum values as strings, however internally Enums can be represented by any
742
+ * kind of type, often integers.
743
+ *
744
+ * Example:
745
+ *
746
+ * ```ts
747
+ * const RGBType = new GraphQLEnumType({
748
+ * name: 'RGB',
749
+ * values: {
750
+ * RED: { value: 0 },
751
+ * GREEN: { value: 1 },
752
+ * BLUE: { value: 2 }
753
+ * }
754
+ * });
755
+ * ```
756
+ *
757
+ * Note: If a value is not provided in a definition, the name of the enum value
758
+ * will be used as its internal value.
759
+ */
760
+ export declare class GraphQLEnumType {
761
+ name: string;
762
+ description: Maybe<string>;
763
+ extensions: Readonly<GraphQLEnumTypeExtensions>;
764
+ astNode: Maybe<EnumTypeDefinitionNode>;
765
+ extensionASTNodes: ReadonlyArray<EnumTypeExtensionNode>;
766
+ private _values;
767
+ private _valueLookup;
768
+ private _nameLookup;
769
+ constructor(config: Readonly<GraphQLEnumTypeConfig>);
770
+ get [Symbol.toStringTag](): string;
771
+ getValues(): ReadonlyArray<GraphQLEnumValue>;
772
+ getValue(name: string): Maybe<GraphQLEnumValue>;
773
+ serialize(outputValue: unknown): Maybe<string>;
774
+ parseValue(inputValue: unknown): Maybe<any>;
775
+ parseLiteral(
776
+ valueNode: ValueNode,
777
+ _variables: Maybe<ObjMap<unknown>>,
778
+ ): Maybe<any>;
779
+ toConfig(): GraphQLEnumTypeNormalizedConfig;
780
+ toString(): string;
781
+ toJSON(): string;
782
+ }
783
+ export interface GraphQLEnumTypeConfig {
784
+ name: string;
785
+ description?: Maybe<string>;
786
+ values: GraphQLEnumValueConfigMap;
787
+ extensions?: Maybe<Readonly<GraphQLEnumTypeExtensions>>;
788
+ astNode?: Maybe<EnumTypeDefinitionNode>;
789
+ extensionASTNodes?: Maybe<ReadonlyArray<EnumTypeExtensionNode>>;
790
+ }
791
+ interface GraphQLEnumTypeNormalizedConfig extends GraphQLEnumTypeConfig {
792
+ extensions: Readonly<GraphQLEnumTypeExtensions>;
793
+ extensionASTNodes: ReadonlyArray<EnumTypeExtensionNode>;
794
+ }
795
+ export declare type GraphQLEnumValueConfigMap = ObjMap<GraphQLEnumValueConfig>;
796
+ /**
797
+ * Custom extensions
798
+ *
799
+ * @remarks
800
+ * Use a unique identifier name for your extension, for example the name of
801
+ * your library or project. Do not use a shortened identifier as this increases
802
+ * the risk of conflicts. We recommend you add at most one extension field,
803
+ * an object which can contain all the values you need.
804
+ */
805
+ export interface GraphQLEnumValueExtensions {
806
+ [attributeName: string]: unknown;
807
+ }
808
+ export interface GraphQLEnumValueConfig {
809
+ description?: Maybe<string>;
810
+ value?: any;
811
+ deprecationReason?: Maybe<string>;
812
+ extensions?: Maybe<Readonly<GraphQLEnumValueExtensions>>;
813
+ astNode?: Maybe<EnumValueDefinitionNode>;
814
+ }
815
+ export interface GraphQLEnumValue {
816
+ name: string;
817
+ description: Maybe<string>;
818
+ value: any;
819
+ deprecationReason: Maybe<string>;
820
+ extensions: Readonly<GraphQLEnumValueExtensions>;
821
+ astNode: Maybe<EnumValueDefinitionNode>;
822
+ }
823
+ /**
824
+ * Custom extensions
825
+ *
826
+ * @remarks
827
+ * Use a unique identifier name for your extension, for example the name of
828
+ * your library or project. Do not use a shortened identifier as this increases
829
+ * the risk of conflicts. We recommend you add at most one extension field,
830
+ * an object which can contain all the values you need.
831
+ */
832
+ export interface GraphQLInputObjectTypeExtensions {
833
+ [attributeName: string]: unknown;
834
+ }
835
+ /**
836
+ * Input Object Type Definition
837
+ *
838
+ * An input object defines a structured collection of fields which may be
839
+ * supplied to a field argument.
840
+ *
841
+ * Using `NonNull` will ensure that a value must be provided by the query
842
+ *
843
+ * Example:
844
+ *
845
+ * ```ts
846
+ * const GeoPoint = new GraphQLInputObjectType({
847
+ * name: 'GeoPoint',
848
+ * fields: {
849
+ * lat: { type: new GraphQLNonNull(GraphQLFloat) },
850
+ * lon: { type: new GraphQLNonNull(GraphQLFloat) },
851
+ * alt: { type: GraphQLFloat, defaultValue: 0 },
852
+ * }
853
+ * });
854
+ * ```
855
+ */
856
+ export declare class GraphQLInputObjectType {
857
+ name: string;
858
+ description: Maybe<string>;
859
+ extensions: Readonly<GraphQLInputObjectTypeExtensions>;
860
+ astNode: Maybe<InputObjectTypeDefinitionNode>;
861
+ extensionASTNodes: ReadonlyArray<InputObjectTypeExtensionNode>;
862
+ private _fields;
863
+ constructor(config: Readonly<GraphQLInputObjectTypeConfig>);
864
+ get [Symbol.toStringTag](): string;
865
+ getFields(): GraphQLInputFieldMap;
866
+ toConfig(): GraphQLInputObjectTypeNormalizedConfig;
867
+ toString(): string;
868
+ toJSON(): string;
869
+ }
870
+ export interface GraphQLInputObjectTypeConfig {
871
+ name: string;
872
+ description?: Maybe<string>;
873
+ fields: ThunkObjMap<GraphQLInputFieldConfig>;
874
+ extensions?: Maybe<Readonly<GraphQLInputObjectTypeExtensions>>;
875
+ astNode?: Maybe<InputObjectTypeDefinitionNode>;
876
+ extensionASTNodes?: Maybe<ReadonlyArray<InputObjectTypeExtensionNode>>;
877
+ }
878
+ interface GraphQLInputObjectTypeNormalizedConfig
879
+ extends GraphQLInputObjectTypeConfig {
880
+ fields: GraphQLInputFieldConfigMap;
881
+ extensions: Readonly<GraphQLInputObjectTypeExtensions>;
882
+ extensionASTNodes: ReadonlyArray<InputObjectTypeExtensionNode>;
883
+ }
884
+ /**
885
+ * Custom extensions
886
+ *
887
+ * @remarks
888
+ * Use a unique identifier name for your extension, for example the name of
889
+ * your library or project. Do not use a shortened identifier as this increases
890
+ * the risk of conflicts. We recommend you add at most one extension field,
891
+ * an object which can contain all the values you need.
892
+ */
893
+ export interface GraphQLInputFieldExtensions {
894
+ [attributeName: string]: unknown;
895
+ }
896
+ export interface GraphQLInputFieldConfig {
897
+ description?: Maybe<string>;
898
+ type: GraphQLInputType;
899
+ defaultValue?: unknown;
900
+ deprecationReason?: Maybe<string>;
901
+ extensions?: Maybe<Readonly<GraphQLInputFieldExtensions>>;
902
+ astNode?: Maybe<InputValueDefinitionNode>;
903
+ }
904
+ export declare type GraphQLInputFieldConfigMap =
905
+ ObjMap<GraphQLInputFieldConfig>;
906
+ export interface GraphQLInputField {
907
+ name: string;
908
+ description: Maybe<string>;
909
+ type: GraphQLInputType;
910
+ defaultValue: unknown;
911
+ deprecationReason: Maybe<string>;
912
+ extensions: Readonly<GraphQLInputFieldExtensions>;
913
+ astNode: Maybe<InputValueDefinitionNode>;
914
+ }
915
+ export declare function isRequiredInputField(field: GraphQLInputField): boolean;
916
+ export declare type GraphQLInputFieldMap = ObjMap<GraphQLInputField>;
917
+ export {};