index.d.ts 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. /**
  2. * GraphQL.js provides a reference implementation for the GraphQL specification
  3. * but is also a useful utility for operating on GraphQL files and building
  4. * sophisticated tools.
  5. *
  6. * This primary module exports a general purpose function for fulfilling all
  7. * steps of the GraphQL specification in a single operation, but also includes
  8. * utilities for every part of the GraphQL specification:
  9. *
  10. * - Parsing the GraphQL language.
  11. * - Building a GraphQL type schema.
  12. * - Validating a GraphQL request against a type schema.
  13. * - Executing a GraphQL request against a type schema.
  14. *
  15. * This also includes utility functions for operating on GraphQL types and
  16. * GraphQL documents to facilitate building tools.
  17. *
  18. * You may also import from each sub-directory directly. For example, the
  19. * following two import statements are equivalent:
  20. *
  21. * ```ts
  22. * import { parse } from 'graphql';
  23. * import { parse } from 'graphql/language';
  24. * ```
  25. *
  26. * @packageDocumentation
  27. */
  28. export { version, versionInfo } from './version';
  29. export type { GraphQLArgs } from './graphql';
  30. export { graphql, graphqlSync } from './graphql';
  31. export {
  32. resolveObjMapThunk,
  33. resolveReadonlyArrayThunk,
  34. GraphQLSchema,
  35. GraphQLDirective,
  36. GraphQLScalarType,
  37. GraphQLObjectType,
  38. GraphQLInterfaceType,
  39. GraphQLUnionType,
  40. GraphQLEnumType,
  41. GraphQLInputObjectType,
  42. GraphQLList,
  43. GraphQLNonNull,
  44. specifiedScalarTypes,
  45. GraphQLInt,
  46. GraphQLFloat,
  47. GraphQLString,
  48. GraphQLBoolean,
  49. GraphQLID,
  50. GRAPHQL_MAX_INT,
  51. GRAPHQL_MIN_INT,
  52. specifiedDirectives,
  53. GraphQLIncludeDirective,
  54. GraphQLSkipDirective,
  55. GraphQLDeprecatedDirective,
  56. GraphQLSpecifiedByDirective,
  57. TypeKind,
  58. DEFAULT_DEPRECATION_REASON,
  59. introspectionTypes,
  60. __Schema,
  61. __Directive,
  62. __DirectiveLocation,
  63. __Type,
  64. __Field,
  65. __InputValue,
  66. __EnumValue,
  67. __TypeKind,
  68. SchemaMetaFieldDef,
  69. TypeMetaFieldDef,
  70. TypeNameMetaFieldDef,
  71. isSchema,
  72. isDirective,
  73. isType,
  74. isScalarType,
  75. isObjectType,
  76. isInterfaceType,
  77. isUnionType,
  78. isEnumType,
  79. isInputObjectType,
  80. isListType,
  81. isNonNullType,
  82. isInputType,
  83. isOutputType,
  84. isLeafType,
  85. isCompositeType,
  86. isAbstractType,
  87. isWrappingType,
  88. isNullableType,
  89. isNamedType,
  90. isRequiredArgument,
  91. isRequiredInputField,
  92. isSpecifiedScalarType,
  93. isIntrospectionType,
  94. isSpecifiedDirective,
  95. assertSchema,
  96. assertDirective,
  97. assertType,
  98. assertScalarType,
  99. assertObjectType,
  100. assertInterfaceType,
  101. assertUnionType,
  102. assertEnumType,
  103. assertInputObjectType,
  104. assertListType,
  105. assertNonNullType,
  106. assertInputType,
  107. assertOutputType,
  108. assertLeafType,
  109. assertCompositeType,
  110. assertAbstractType,
  111. assertWrappingType,
  112. assertNullableType,
  113. assertNamedType,
  114. getNullableType,
  115. getNamedType,
  116. validateSchema,
  117. assertValidSchema,
  118. assertName,
  119. assertEnumValueName,
  120. } from './type/index';
  121. export type {
  122. GraphQLType,
  123. GraphQLInputType,
  124. GraphQLOutputType,
  125. GraphQLLeafType,
  126. GraphQLCompositeType,
  127. GraphQLAbstractType,
  128. GraphQLWrappingType,
  129. GraphQLNullableType,
  130. GraphQLNamedType,
  131. GraphQLNamedInputType,
  132. GraphQLNamedOutputType,
  133. ThunkReadonlyArray,
  134. ThunkObjMap,
  135. GraphQLSchemaConfig,
  136. GraphQLSchemaExtensions,
  137. GraphQLDirectiveConfig,
  138. GraphQLDirectiveExtensions,
  139. GraphQLArgument,
  140. GraphQLArgumentConfig,
  141. GraphQLArgumentExtensions,
  142. GraphQLEnumTypeConfig,
  143. GraphQLEnumTypeExtensions,
  144. GraphQLEnumValue,
  145. GraphQLEnumValueConfig,
  146. GraphQLEnumValueConfigMap,
  147. GraphQLEnumValueExtensions,
  148. GraphQLField,
  149. GraphQLFieldConfig,
  150. GraphQLFieldConfigArgumentMap,
  151. GraphQLFieldConfigMap,
  152. GraphQLFieldExtensions,
  153. GraphQLFieldMap,
  154. GraphQLFieldResolver,
  155. GraphQLInputField,
  156. GraphQLInputFieldConfig,
  157. GraphQLInputFieldConfigMap,
  158. GraphQLInputFieldExtensions,
  159. GraphQLInputFieldMap,
  160. GraphQLInputObjectTypeConfig,
  161. GraphQLInputObjectTypeExtensions,
  162. GraphQLInterfaceTypeConfig,
  163. GraphQLInterfaceTypeExtensions,
  164. GraphQLIsTypeOfFn,
  165. GraphQLObjectTypeConfig,
  166. GraphQLObjectTypeExtensions,
  167. GraphQLResolveInfo,
  168. ResponsePath,
  169. GraphQLScalarTypeConfig,
  170. GraphQLScalarTypeExtensions,
  171. GraphQLTypeResolver,
  172. GraphQLUnionTypeConfig,
  173. GraphQLUnionTypeExtensions,
  174. GraphQLScalarSerializer,
  175. GraphQLScalarValueParser,
  176. GraphQLScalarLiteralParser,
  177. } from './type/index';
  178. export {
  179. Token,
  180. Source,
  181. Location,
  182. OperationTypeNode,
  183. getLocation,
  184. printLocation,
  185. printSourceLocation,
  186. Lexer,
  187. TokenKind,
  188. parse,
  189. parseValue,
  190. parseConstValue,
  191. parseType,
  192. print,
  193. visit,
  194. visitInParallel,
  195. getVisitFn,
  196. getEnterLeaveForKind,
  197. BREAK,
  198. Kind,
  199. DirectiveLocation,
  200. isDefinitionNode,
  201. isExecutableDefinitionNode,
  202. isSelectionNode,
  203. isValueNode,
  204. isConstValueNode,
  205. isTypeNode,
  206. isTypeSystemDefinitionNode,
  207. isTypeDefinitionNode,
  208. isTypeSystemExtensionNode,
  209. isTypeExtensionNode,
  210. } from './language/index';
  211. export type {
  212. ParseOptions,
  213. SourceLocation,
  214. TokenKindEnum,
  215. KindEnum,
  216. DirectiveLocationEnum,
  217. ASTVisitor,
  218. ASTVisitFn,
  219. ASTVisitorKeyMap,
  220. ASTNode,
  221. ASTKindToNode,
  222. NameNode,
  223. DocumentNode,
  224. DefinitionNode,
  225. ExecutableDefinitionNode,
  226. OperationDefinitionNode,
  227. VariableDefinitionNode,
  228. VariableNode,
  229. SelectionSetNode,
  230. SelectionNode,
  231. FieldNode,
  232. ArgumentNode,
  233. ConstArgumentNode,
  234. FragmentSpreadNode,
  235. InlineFragmentNode,
  236. FragmentDefinitionNode,
  237. ValueNode,
  238. ConstValueNode,
  239. IntValueNode,
  240. FloatValueNode,
  241. StringValueNode,
  242. BooleanValueNode,
  243. NullValueNode,
  244. EnumValueNode,
  245. ListValueNode,
  246. ConstListValueNode,
  247. ObjectValueNode,
  248. ConstObjectValueNode,
  249. ObjectFieldNode,
  250. ConstObjectFieldNode,
  251. DirectiveNode,
  252. ConstDirectiveNode,
  253. TypeNode,
  254. NamedTypeNode,
  255. ListTypeNode,
  256. NonNullTypeNode,
  257. TypeSystemDefinitionNode,
  258. SchemaDefinitionNode,
  259. OperationTypeDefinitionNode,
  260. TypeDefinitionNode,
  261. ScalarTypeDefinitionNode,
  262. ObjectTypeDefinitionNode,
  263. FieldDefinitionNode,
  264. InputValueDefinitionNode,
  265. InterfaceTypeDefinitionNode,
  266. UnionTypeDefinitionNode,
  267. EnumTypeDefinitionNode,
  268. EnumValueDefinitionNode,
  269. InputObjectTypeDefinitionNode,
  270. DirectiveDefinitionNode,
  271. TypeSystemExtensionNode,
  272. SchemaExtensionNode,
  273. TypeExtensionNode,
  274. ScalarTypeExtensionNode,
  275. ObjectTypeExtensionNode,
  276. InterfaceTypeExtensionNode,
  277. UnionTypeExtensionNode,
  278. EnumTypeExtensionNode,
  279. InputObjectTypeExtensionNode,
  280. } from './language/index';
  281. export {
  282. execute,
  283. executeSync,
  284. defaultFieldResolver,
  285. defaultTypeResolver,
  286. responsePathAsArray,
  287. getArgumentValues,
  288. getVariableValues,
  289. getDirectiveValues,
  290. subscribe,
  291. createSourceEventStream,
  292. } from './execution/index';
  293. export type {
  294. ExecutionArgs,
  295. ExecutionResult,
  296. FormattedExecutionResult,
  297. } from './execution/index';
  298. export type { SubscriptionArgs } from './subscription/index';
  299. export {
  300. validate,
  301. ValidationContext,
  302. specifiedRules,
  303. ExecutableDefinitionsRule,
  304. FieldsOnCorrectTypeRule,
  305. FragmentsOnCompositeTypesRule,
  306. KnownArgumentNamesRule,
  307. KnownDirectivesRule,
  308. KnownFragmentNamesRule,
  309. KnownTypeNamesRule,
  310. LoneAnonymousOperationRule,
  311. NoFragmentCyclesRule,
  312. NoUndefinedVariablesRule,
  313. NoUnusedFragmentsRule,
  314. NoUnusedVariablesRule,
  315. OverlappingFieldsCanBeMergedRule,
  316. PossibleFragmentSpreadsRule,
  317. ProvidedRequiredArgumentsRule,
  318. ScalarLeafsRule,
  319. SingleFieldSubscriptionsRule,
  320. UniqueArgumentNamesRule,
  321. UniqueDirectivesPerLocationRule,
  322. UniqueFragmentNamesRule,
  323. UniqueInputFieldNamesRule,
  324. UniqueOperationNamesRule,
  325. UniqueVariableNamesRule,
  326. ValuesOfCorrectTypeRule,
  327. VariablesAreInputTypesRule,
  328. VariablesInAllowedPositionRule,
  329. LoneSchemaDefinitionRule,
  330. UniqueOperationTypesRule,
  331. UniqueTypeNamesRule,
  332. UniqueEnumValueNamesRule,
  333. UniqueFieldDefinitionNamesRule,
  334. UniqueArgumentDefinitionNamesRule,
  335. UniqueDirectiveNamesRule,
  336. PossibleTypeExtensionsRule,
  337. NoDeprecatedCustomRule,
  338. NoSchemaIntrospectionCustomRule,
  339. } from './validation/index';
  340. export type { ValidationRule } from './validation/index';
  341. export {
  342. GraphQLError,
  343. syntaxError,
  344. locatedError,
  345. printError,
  346. formatError,
  347. } from './error/index';
  348. export type {
  349. GraphQLErrorOptions,
  350. GraphQLFormattedError,
  351. GraphQLErrorExtensions,
  352. } from './error/index';
  353. export {
  354. getIntrospectionQuery,
  355. getOperationAST,
  356. getOperationRootType,
  357. introspectionFromSchema,
  358. buildClientSchema,
  359. buildASTSchema,
  360. buildSchema,
  361. extendSchema,
  362. lexicographicSortSchema,
  363. printSchema,
  364. printType,
  365. printIntrospectionSchema,
  366. typeFromAST,
  367. valueFromAST,
  368. valueFromASTUntyped,
  369. astFromValue,
  370. TypeInfo,
  371. visitWithTypeInfo,
  372. coerceInputValue,
  373. concatAST,
  374. separateOperations,
  375. stripIgnoredCharacters,
  376. isEqualType,
  377. isTypeSubTypeOf,
  378. doTypesOverlap,
  379. assertValidName,
  380. isValidNameError,
  381. BreakingChangeType,
  382. DangerousChangeType,
  383. findBreakingChanges,
  384. findDangerousChanges,
  385. } from './utilities/index';
  386. export type {
  387. IntrospectionOptions,
  388. IntrospectionQuery,
  389. IntrospectionSchema,
  390. IntrospectionType,
  391. IntrospectionInputType,
  392. IntrospectionOutputType,
  393. IntrospectionScalarType,
  394. IntrospectionObjectType,
  395. IntrospectionInterfaceType,
  396. IntrospectionUnionType,
  397. IntrospectionEnumType,
  398. IntrospectionInputObjectType,
  399. IntrospectionTypeRef,
  400. IntrospectionInputTypeRef,
  401. IntrospectionOutputTypeRef,
  402. IntrospectionNamedTypeRef,
  403. IntrospectionListTypeRef,
  404. IntrospectionNonNullTypeRef,
  405. IntrospectionField,
  406. IntrospectionInputValue,
  407. IntrospectionEnumValue,
  408. IntrospectionDirective,
  409. BuildSchemaOptions,
  410. BreakingChange,
  411. DangerousChange,
  412. TypedQueryDocumentNode,
  413. } from './utilities/index';