UNPKG

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