UNPKG

11.5 kBTypeScriptView Raw
1// Type definitions for graphql 14.0
2// Project: https://github.com/graphql/graphql-js
3// Definitions by: TonyYang <https://github.com/TonyPythoneer>
4// Caleb Meredith <https://github.com/calebmer>
5// Dominic Watson <https://github.com/intellix>
6// Firede <https://github.com/firede>
7// Kepennar <https://github.com/kepennar>
8// Mikhail Novikov <https://github.com/freiksenet>
9// Ivan Goncharov <https://github.com/IvanGoncharov>
10// Hagai Cohen <https://github.com/DxCx>
11// Ricardo Portugal <https://github.com/rportugal>
12// Tim Griesser <https://github.com/tgriesser>
13// Dylan Stewart <https://github.com/dyst5422>
14// Alessio Dionisi <https://github.com/adnsio>
15// Divyendu Singh <https://github.com/divyenduz>
16// Brad Zacher <https://github.com/bradzacher>
17// Curtis Layne <https://github.com/clayne11>
18// Jonathan Cardoso <https://github.com/JCMais>
19// Pavel Lang <https://github.com/langpavel>
20// Mark Caudill <https://github.com/mc0>
21// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
22// TypeScript Version: 2.6
23
24// The primary entry point into fulfilling a GraphQL request.
25export { graphql, graphqlSync, GraphQLArgs } from "./graphql";
26
27// Create and operate on GraphQL type definitions and schema.
28export {
29 GraphQLSchema,
30 // Definitions
31 GraphQLScalarType,
32 GraphQLObjectType,
33 GraphQLInterfaceType,
34 GraphQLUnionType,
35 GraphQLEnumType,
36 GraphQLInputObjectType,
37 GraphQLList,
38 GraphQLNonNull,
39 GraphQLDirective,
40 // "Enum" of Type Kinds
41 TypeKind,
42 // Scalars
43 specifiedScalarTypes,
44 GraphQLInt,
45 GraphQLFloat,
46 GraphQLString,
47 GraphQLBoolean,
48 GraphQLID,
49 // Built-in Directives defined by the Spec
50 specifiedDirectives,
51 GraphQLIncludeDirective,
52 GraphQLSkipDirective,
53 GraphQLDeprecatedDirective,
54 // Constant Deprecation Reason
55 DEFAULT_DEPRECATION_REASON,
56 // Meta-field definitions.
57 SchemaMetaFieldDef,
58 TypeMetaFieldDef,
59 TypeNameMetaFieldDef,
60 // GraphQL Types for introspection.
61 introspectionTypes,
62 __Schema,
63 __Directive,
64 __DirectiveLocation,
65 __Type,
66 __Field,
67 __InputValue,
68 __EnumValue,
69 __TypeKind,
70 // Predicates
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 // Assertions
96 assertType,
97 assertScalarType,
98 assertObjectType,
99 assertInterfaceType,
100 assertUnionType,
101 assertEnumType,
102 assertInputObjectType,
103 assertListType,
104 assertNonNullType,
105 assertInputType,
106 assertOutputType,
107 assertLeafType,
108 assertCompositeType,
109 assertAbstractType,
110 assertWrappingType,
111 assertNullableType,
112 assertNamedType,
113 // Un-modifiers
114 getNullableType,
115 getNamedType,
116 // Validate GraphQL schema.
117 validateSchema,
118 assertValidSchema,
119 // type
120 GraphQLType,
121 GraphQLInputType,
122 GraphQLOutputType,
123 GraphQLLeafType,
124 GraphQLCompositeType,
125 GraphQLAbstractType,
126 GraphQLWrappingType,
127 GraphQLNullableType,
128 GraphQLNamedType,
129 Thunk,
130 GraphQLSchemaConfig,
131 GraphQLArgument,
132 GraphQLArgumentConfig,
133 GraphQLEnumTypeConfig,
134 GraphQLEnumValue,
135 GraphQLEnumValueConfig,
136 GraphQLEnumValueConfigMap,
137 GraphQLField,
138 GraphQLFieldConfig,
139 GraphQLFieldConfigArgumentMap,
140 GraphQLFieldConfigMap,
141 GraphQLFieldMap,
142 GraphQLFieldResolver,
143 GraphQLInputField,
144 GraphQLInputFieldConfig,
145 GraphQLInputFieldConfigMap,
146 GraphQLInputFieldMap,
147 GraphQLInputObjectTypeConfig,
148 GraphQLInterfaceTypeConfig,
149 GraphQLIsTypeOfFn,
150 GraphQLObjectTypeConfig,
151 GraphQLResolveInfo,
152 ResponsePath,
153 GraphQLScalarTypeConfig,
154 GraphQLTypeResolver,
155 GraphQLUnionTypeConfig,
156 GraphQLDirectiveConfig,
157 GraphQLScalarSerializer,
158 GraphQLScalarValueParser,
159 GraphQLScalarLiteralParser,
160} from "./type";
161
162// Parse and operate on GraphQL language source files.
163export {
164 Source,
165 getLocation,
166 // Parse
167 parse,
168 parseValue,
169 parseType,
170 // Print
171 print,
172 // Visit
173 visit,
174 visitInParallel,
175 visitWithTypeInfo,
176 getVisitFn,
177 Kind,
178 TokenKind,
179 DirectiveLocation,
180 BREAK,
181 // Predicates
182 isDefinitionNode,
183 isExecutableDefinitionNode,
184 isSelectionNode,
185 isValueNode,
186 isTypeNode,
187 isTypeSystemDefinitionNode,
188 isTypeDefinitionNode,
189 isTypeSystemExtensionNode,
190 isTypeExtensionNode,
191 // type
192 Lexer,
193 ParseOptions,
194 SourceLocation,
195 // Visitor utilities
196 ASTVisitor,
197 Visitor,
198 VisitFn,
199 VisitorKeyMap,
200 // AST nodes
201 Location,
202 Token,
203 ASTNode,
204 ASTKindToNode,
205 NameNode,
206 DocumentNode,
207 DefinitionNode,
208 ExecutableDefinitionNode,
209 OperationDefinitionNode,
210 OperationTypeNode,
211 VariableDefinitionNode,
212 VariableNode,
213 SelectionSetNode,
214 SelectionNode,
215 FieldNode,
216 ArgumentNode,
217 FragmentSpreadNode,
218 InlineFragmentNode,
219 FragmentDefinitionNode,
220 ValueNode,
221 IntValueNode,
222 FloatValueNode,
223 StringValueNode,
224 BooleanValueNode,
225 NullValueNode,
226 EnumValueNode,
227 ListValueNode,
228 ObjectValueNode,
229 ObjectFieldNode,
230 DirectiveNode,
231 TypeNode,
232 NamedTypeNode,
233 ListTypeNode,
234 NonNullTypeNode,
235 TypeSystemDefinitionNode,
236 SchemaDefinitionNode,
237 OperationTypeDefinitionNode,
238 TypeDefinitionNode,
239 ScalarTypeDefinitionNode,
240 ObjectTypeDefinitionNode,
241 FieldDefinitionNode,
242 InputValueDefinitionNode,
243 InterfaceTypeDefinitionNode,
244 UnionTypeDefinitionNode,
245 EnumTypeDefinitionNode,
246 EnumValueDefinitionNode,
247 InputObjectTypeDefinitionNode,
248 DirectiveDefinitionNode,
249 TypeSystemExtensionNode,
250 SchemaExtensionNode,
251 TypeExtensionNode,
252 ScalarTypeExtensionNode,
253 ObjectTypeExtensionNode,
254 InterfaceTypeExtensionNode,
255 UnionTypeExtensionNode,
256 EnumTypeExtensionNode,
257 InputObjectTypeExtensionNode,
258 KindEnum,
259 TokenKindEnum,
260 DirectiveLocationEnum,
261} from "./language";
262
263// Execute GraphQL queries.
264export {
265 execute,
266 defaultFieldResolver,
267 responsePathAsArray,
268 getDirectiveValues,
269 // type
270 ExecutionArgs,
271 ExecutionResult,
272} from "./execution";
273
274export { subscribe, createSourceEventStream } from "./subscription";
275
276// Validate GraphQL queries.
277export {
278 validate,
279 ValidationContext,
280 // All validation rules in the GraphQL Specification.
281 specifiedRules,
282 // Individual validation rules.
283 FieldsOnCorrectTypeRule,
284 FragmentsOnCompositeTypesRule,
285 KnownArgumentNamesRule,
286 KnownDirectivesRule,
287 KnownFragmentNamesRule,
288 KnownTypeNamesRule,
289 LoneAnonymousOperationRule,
290 NoFragmentCyclesRule,
291 NoUndefinedVariablesRule,
292 NoUnusedFragmentsRule,
293 NoUnusedVariablesRule,
294 OverlappingFieldsCanBeMergedRule,
295 PossibleFragmentSpreadsRule,
296 ProvidedRequiredArgumentsRule,
297 ScalarLeafsRule,
298 SingleFieldSubscriptionsRule,
299 UniqueArgumentNamesRule,
300 UniqueDirectivesPerLocationRule,
301 UniqueFragmentNamesRule,
302 UniqueInputFieldNamesRule,
303 UniqueOperationNamesRule,
304 UniqueVariableNamesRule,
305 ValuesOfCorrectTypeRule,
306 VariablesAreInputTypesRule,
307 VariablesInAllowedPositionRule,
308} from "./validation";
309
310// Create and format GraphQL errors.
311export { GraphQLError, formatError, printError, GraphQLFormattedError } from "./error";
312
313// Utilities for operating on GraphQL type schema and parsed sources.
314export {
315 // Produce the GraphQL query recommended for a full schema introspection.
316 // Accepts optional IntrospectionOptions.
317 getIntrospectionQuery,
318 // @deprecated: use getIntrospectionQuery - will be removed in v15
319 introspectionQuery,
320 // Gets the target Operation from a Document
321 getOperationAST,
322 // Gets the Type for the target Operation AST.
323 getOperationRootType,
324 // Convert a GraphQLSchema to an IntrospectionQuery
325 introspectionFromSchema,
326 // Build a GraphQLSchema from an introspection result.
327 buildClientSchema,
328 // Build a GraphQLSchema from a parsed GraphQL Schema language AST.
329 buildASTSchema,
330 // Build a GraphQLSchema from a GraphQL schema language document.
331 buildSchema,
332 // @deprecated: Get the description from a schema AST node and supports legacy
333 // syntax for specifying descriptions - will be removed in v16
334 getDescription,
335 // Extends an existing GraphQLSchema from a parsed GraphQL Schema
336 // language AST.
337 extendSchema,
338 // Sort a GraphQLSchema.
339 lexicographicSortSchema,
340 // Print a GraphQLSchema to GraphQL Schema language.
341 printSchema,
342 // Prints the built-in introspection schema in the Schema Language
343 // format.
344 printIntrospectionSchema,
345 // Print a GraphQLType to GraphQL Schema language.
346 printType,
347 // Create a GraphQLType from a GraphQL language AST.
348 typeFromAST,
349 // Create a JavaScript value from a GraphQL language AST with a Type.
350 valueFromAST,
351 // Create a JavaScript value from a GraphQL language AST without a Type.
352 valueFromASTUntyped,
353 // Create a GraphQL language AST from a JavaScript value.
354 astFromValue,
355 // A helper to use within recursive-descent visitors which need to be aware of
356 // the GraphQL type system.
357 TypeInfo,
358 // Coerces a JavaScript value to a GraphQL type, or produces errors.
359 coerceValue,
360 // @deprecated use coerceValue - will be removed in v15
361 isValidJSValue,
362 // @deprecated use validation - will be removed in v15
363 isValidLiteralValue,
364 // Concatenates multiple AST together.
365 concatAST,
366 // Separates an AST into an AST per Operation.
367 separateOperations,
368 // Comparators for types
369 isEqualType,
370 isTypeSubTypeOf,
371 doTypesOverlap,
372 // Asserts a string is a valid GraphQL name.
373 assertValidName,
374 // Determine if a string is a valid GraphQL name.
375 isValidNameError,
376 // Compares two GraphQLSchemas and detects breaking changes.
377 findBreakingChanges,
378 findDangerousChanges,
379 BreakingChangeType,
380 DangerousChangeType,
381 // Report all deprecated usage within a GraphQL document.
382 findDeprecatedUsages,
383 // type
384 BuildSchemaOptions,
385 BreakingChange,
386 DangerousChange,
387 IntrospectionOptions,
388 IntrospectionDirective,
389 IntrospectionEnumType,
390 IntrospectionEnumValue,
391 IntrospectionField,
392 IntrospectionInputObjectType,
393 IntrospectionInputType,
394 IntrospectionInputTypeRef,
395 IntrospectionInputValue,
396 IntrospectionInterfaceType,
397 IntrospectionListTypeRef,
398 IntrospectionNamedTypeRef,
399 IntrospectionNonNullTypeRef,
400 IntrospectionObjectType,
401 IntrospectionOutputType,
402 IntrospectionOutputTypeRef,
403 IntrospectionQuery,
404 IntrospectionScalarType,
405 IntrospectionSchema,
406 IntrospectionType,
407 IntrospectionTypeRef,
408 IntrospectionUnionType,
409} from "./utilities";