1 |
|
2 |
|
3 |
|
4 | import { Maybe } from '../jsutils/Maybe';
|
5 |
|
6 | import { PromiseOrValue } from '../jsutils/PromiseOrValue';
|
7 | import { Path } from '../jsutils/Path';
|
8 |
|
9 | import {
|
10 | ScalarTypeDefinitionNode,
|
11 | ObjectTypeDefinitionNode,
|
12 | FieldDefinitionNode,
|
13 | InputValueDefinitionNode,
|
14 | InterfaceTypeDefinitionNode,
|
15 | UnionTypeDefinitionNode,
|
16 | EnumTypeDefinitionNode,
|
17 | EnumValueDefinitionNode,
|
18 | InputObjectTypeDefinitionNode,
|
19 | ObjectTypeExtensionNode,
|
20 | InterfaceTypeExtensionNode,
|
21 | OperationDefinitionNode,
|
22 | FieldNode,
|
23 | FragmentDefinitionNode,
|
24 | ValueNode,
|
25 | ScalarTypeExtensionNode,
|
26 | UnionTypeExtensionNode,
|
27 | EnumTypeExtensionNode,
|
28 | InputObjectTypeExtensionNode,
|
29 | } from '../language/ast';
|
30 |
|
31 | import { GraphQLSchema } from './schema';
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | export type GraphQLType =
|
37 | | GraphQLScalarType
|
38 | | GraphQLObjectType
|
39 | | GraphQLInterfaceType
|
40 | | GraphQLUnionType
|
41 | | GraphQLEnumType
|
42 | | GraphQLInputObjectType
|
43 | | GraphQLList<any>
|
44 | | GraphQLNonNull<any>;
|
45 |
|
46 | export function isType(type: any): type is GraphQLType;
|
47 |
|
48 | export function assertType(type: any): GraphQLType;
|
49 |
|
50 | export function isScalarType(type: any): type is GraphQLScalarType;
|
51 |
|
52 | export function assertScalarType(type: any): GraphQLScalarType;
|
53 |
|
54 | export function isObjectType(type: any): type is GraphQLObjectType;
|
55 |
|
56 | export function assertObjectType(type: any): GraphQLObjectType;
|
57 |
|
58 | export function isInterfaceType(type: any): type is GraphQLInterfaceType;
|
59 |
|
60 | export function assertInterfaceType(type: any): GraphQLInterfaceType;
|
61 |
|
62 | export function isUnionType(type: any): type is GraphQLUnionType;
|
63 |
|
64 | export function assertUnionType(type: any): GraphQLUnionType;
|
65 |
|
66 | export function isEnumType(type: any): type is GraphQLEnumType;
|
67 |
|
68 | export function assertEnumType(type: any): GraphQLEnumType;
|
69 |
|
70 | export function isInputObjectType(type: any): type is GraphQLInputObjectType;
|
71 |
|
72 | export function assertInputObjectType(type: any): GraphQLInputObjectType;
|
73 |
|
74 | export function isListType(type: any): type is GraphQLList<any>;
|
75 |
|
76 | export function assertListType(type: any): GraphQLList<any>;
|
77 |
|
78 | export function isNonNullType(type: any): type is GraphQLNonNull<any>;
|
79 |
|
80 | export function assertNonNullType(type: any): GraphQLNonNull<any>;
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 | export type GraphQLInputType =
|
87 | | GraphQLScalarType
|
88 | | GraphQLEnumType
|
89 | | GraphQLInputObjectType
|
90 | | GraphQLList<any>
|
91 | | GraphQLNonNull<
|
92 | | GraphQLScalarType
|
93 | | GraphQLEnumType
|
94 | | GraphQLInputObjectType
|
95 | | GraphQLList<any>
|
96 | >;
|
97 |
|
98 | export function isInputType(type: any): type is GraphQLInputType;
|
99 |
|
100 | export function assertInputType(type: any): GraphQLInputType;
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 | export type GraphQLOutputType =
|
107 | | GraphQLScalarType
|
108 | | GraphQLObjectType
|
109 | | GraphQLInterfaceType
|
110 | | GraphQLUnionType
|
111 | | GraphQLEnumType
|
112 | | GraphQLList<any>
|
113 | | GraphQLNonNull<
|
114 | | GraphQLScalarType
|
115 | | GraphQLObjectType
|
116 | | GraphQLInterfaceType
|
117 | | GraphQLUnionType
|
118 | | GraphQLEnumType
|
119 | | GraphQLList<any>
|
120 | >;
|
121 |
|
122 | export function isOutputType(type: any): type is GraphQLOutputType;
|
123 |
|
124 | export function assertOutputType(type: any): GraphQLOutputType;
|
125 |
|
126 |
|
127 |
|
128 |
|
129 | export type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType;
|
130 |
|
131 | export function isLeafType(type: any): type is GraphQLLeafType;
|
132 |
|
133 | export function assertLeafType(type: any): GraphQLLeafType;
|
134 |
|
135 |
|
136 |
|
137 |
|
138 | export type GraphQLCompositeType =
|
139 | | GraphQLObjectType
|
140 | | GraphQLInterfaceType
|
141 | | GraphQLUnionType;
|
142 |
|
143 | export function isCompositeType(type: any): type is GraphQLCompositeType;
|
144 |
|
145 | export function assertCompositeType(type: any): GraphQLCompositeType;
|
146 |
|
147 |
|
148 |
|
149 |
|
150 | export type GraphQLAbstractType = GraphQLInterfaceType | GraphQLUnionType;
|
151 |
|
152 | export function isAbstractType(type: any): type is GraphQLAbstractType;
|
153 |
|
154 | export function assertAbstractType(type: any): GraphQLAbstractType;
|
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 |
|
165 |
|
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 |
|
174 | interface GraphQLList<T extends GraphQLType> {
|
175 | readonly ofType: T;
|
176 | toString: () => string;
|
177 | toJSON: () => string;
|
178 | inspect: () => string;
|
179 | }
|
180 |
|
181 | interface _GraphQLList<T extends GraphQLType> {
|
182 | (type: T): GraphQLList<T>;
|
183 | new (type: T): GraphQLList<T>;
|
184 | }
|
185 |
|
186 |
|
187 | export const GraphQLList: _GraphQLList<GraphQLType>;
|
188 |
|
189 |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 |
|
200 |
|
201 |
|
202 |
|
203 |
|
204 |
|
205 |
|
206 |
|
207 |
|
208 |
|
209 | interface GraphQLNonNull<T extends GraphQLNullableType> {
|
210 | readonly ofType: T;
|
211 | toString: () => string;
|
212 | toJSON: () => string;
|
213 | inspect: () => string;
|
214 | }
|
215 |
|
216 | interface _GraphQLNonNull<T extends GraphQLNullableType> {
|
217 | (type: T): GraphQLNonNull<T>;
|
218 | new (type: T): GraphQLNonNull<T>;
|
219 | }
|
220 |
|
221 |
|
222 | export const GraphQLNonNull: _GraphQLNonNull<GraphQLNullableType>;
|
223 |
|
224 | export type GraphQLWrappingType = GraphQLList<any> | GraphQLNonNull<any>;
|
225 |
|
226 | export function isWrappingType(type: any): type is GraphQLWrappingType;
|
227 |
|
228 | export function assertWrappingType(type: any): GraphQLWrappingType;
|
229 |
|
230 |
|
231 |
|
232 |
|
233 | export type GraphQLNullableType =
|
234 | | GraphQLScalarType
|
235 | | GraphQLObjectType
|
236 | | GraphQLInterfaceType
|
237 | | GraphQLUnionType
|
238 | | GraphQLEnumType
|
239 | | GraphQLInputObjectType
|
240 | | GraphQLList<any>;
|
241 |
|
242 | export function isNullableType(type: any): type is GraphQLNullableType;
|
243 |
|
244 | export function assertNullableType(type: any): GraphQLNullableType;
|
245 |
|
246 | export function getNullableType(type: undefined): undefined;
|
247 | export function getNullableType<T extends GraphQLNullableType>(type: T): T;
|
248 | export function getNullableType<T extends GraphQLNullableType>(
|
249 |
|
250 |
|
251 | type: GraphQLNonNull<T>,
|
252 | ): T;
|
253 |
|
254 |
|
255 |
|
256 |
|
257 | export type GraphQLNamedType =
|
258 | | GraphQLScalarType
|
259 | | GraphQLObjectType
|
260 | | GraphQLInterfaceType
|
261 | | GraphQLUnionType
|
262 | | GraphQLEnumType
|
263 | | GraphQLInputObjectType;
|
264 |
|
265 | export function isNamedType(type: any): type is GraphQLNamedType;
|
266 |
|
267 | export function assertNamedType(type: any): GraphQLNamedType;
|
268 |
|
269 | export function getNamedType(type: undefined): undefined;
|
270 | export function getNamedType(type: GraphQLType): GraphQLNamedType;
|
271 |
|
272 |
|
273 |
|
274 |
|
275 |
|
276 | export type Thunk<T> = (() => T) | T;
|
277 |
|
278 | /**
|
279 | * Custom extensions
|
280 | *
|
281 | * @remarks
|
282 | * Use a unique identifier name for your extension, for example the name of
|
283 | * your library or project. Do not use a shortened identifier as this increases
|
284 | * the risk of conflicts. We recommend you add at most one extension field,
|
285 | * an object which can contain all the values you need.
|
286 | */
|
287 | export interface GraphQLScalarTypeExtensions {
|
288 | [attributeName: string]: any;
|
289 | }
|
290 |
|
291 | /**
|
292 | * Scalar Type Definition
|
293 | *
|
294 | * The leaf values of any request and input values to arguments are
|
295 | * Scalars (or Enums) and are defined with a name and a series of functions
|
296 | * used to parse input from ast or variables and to ensure validity.
|
297 | *
|
298 | * Example:
|
299 | *
|
300 | * const OddType = new GraphQLScalarType({
|
301 | * name: 'Odd',
|
302 | * serialize(value) {
|
303 | * return value % 2 === 1 ? value : null;
|
304 | * }
|
305 | * });
|
306 | *
|
307 | */
|
308 | export class GraphQLScalarType {
|
309 | name: string;
|
310 | description: Maybe<string>;
|
311 | specifiedByUrl: Maybe<string>;
|
312 | serialize: GraphQLScalarSerializer<any>;
|
313 | parseValue: GraphQLScalarValueParser<any>;
|
314 | parseLiteral: GraphQLScalarLiteralParser<any>;
|
315 | extensions: Maybe<Readonly<GraphQLScalarTypeExtensions>>;
|
316 | astNode: Maybe<ScalarTypeDefinitionNode>;
|
317 | extensionASTNodes: Maybe<ReadonlyArray<ScalarTypeExtensionNode>>;
|
318 |
|
319 | constructor(config: Readonly<GraphQLScalarTypeConfig<any, any>>);
|
320 |
|
321 | toConfig(): GraphQLScalarTypeConfig<any, any> & {
|
322 | specifiedByUrl: Maybe<string>;
|
323 | serialize: GraphQLScalarSerializer<any>;
|
324 | parseValue: GraphQLScalarValueParser<any>;
|
325 | parseLiteral: GraphQLScalarLiteralParser<any>;
|
326 | extensions: Maybe<Readonly<GraphQLScalarTypeExtensions>>;
|
327 | extensionASTNodes: ReadonlyArray<ScalarTypeExtensionNode>;
|
328 | };
|
329 |
|
330 | toString(): string;
|
331 | toJSON(): string;
|
332 | inspect(): string;
|
333 | }
|
334 |
|
335 | export type GraphQLScalarSerializer<TExternal> = (
|
336 | value: any,
|
337 | ) => Maybe<TExternal>;
|
338 | export type GraphQLScalarValueParser<TInternal> = (
|
339 | value: any,
|
340 | ) => Maybe<TInternal>;
|
341 | export type GraphQLScalarLiteralParser<TInternal> = (
|
342 | valueNode: ValueNode,
|
343 | variables: Maybe<{ [key: string]: any }>,
|
344 | ) => Maybe<TInternal>;
|
345 |
|
346 | export interface GraphQLScalarTypeConfig<TInternal, TExternal> {
|
347 | name: string;
|
348 | description?: Maybe<string>;
|
349 | specifiedByUrl?: Maybe<string>;
|
350 |
|
351 | serialize?: GraphQLScalarSerializer<TExternal>;
|
352 |
|
353 | parseValue?: GraphQLScalarValueParser<TInternal>;
|
354 |
|
355 | parseLiteral?: GraphQLScalarLiteralParser<TInternal>;
|
356 | extensions?: Maybe<Readonly<GraphQLScalarTypeExtensions>>;
|
357 | astNode?: Maybe<ScalarTypeDefinitionNode>;
|
358 | extensionASTNodes?: Maybe<ReadonlyArray<ScalarTypeExtensionNode>>;
|
359 | }
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 |
|
371 |
|
372 |
|
373 | export interface GraphQLObjectTypeExtensions<_TSource = any, _TContext = any> {
|
374 | [attributeName: string]: any;
|
375 | }
|
376 |
|
377 |
|
378 |
|
379 |
|
380 |
|
381 |
|
382 |
|
383 |
|
384 |
|
385 |
|
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 |
|
397 |
|
398 |
|
399 |
|
400 |
|
401 |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 |
|
411 |
|
412 |
|
413 |
|
414 | export class GraphQLObjectType<TSource = any, TContext = any> {
|
415 | name: string;
|
416 | description: Maybe<string>;
|
417 | isTypeOf: Maybe<GraphQLIsTypeOfFn<TSource, TContext>>;
|
418 | extensions: Maybe<Readonly<GraphQLObjectTypeExtensions<TSource, TContext>>>;
|
419 | astNode: Maybe<ObjectTypeDefinitionNode>;
|
420 | extensionASTNodes: Maybe<ReadonlyArray<ObjectTypeExtensionNode>>;
|
421 |
|
422 | constructor(config: Readonly<GraphQLObjectTypeConfig<TSource, TContext>>);
|
423 |
|
424 | getFields(): GraphQLFieldMap<any, TContext>;
|
425 | getInterfaces(): Array<GraphQLInterfaceType>;
|
426 |
|
427 | toConfig(): GraphQLObjectTypeConfig<any, any> & {
|
428 | interfaces: Array<GraphQLInterfaceType>;
|
429 | fields: GraphQLFieldConfigMap<any, any>;
|
430 | extensions: Maybe<Readonly<GraphQLObjectTypeExtensions<TSource, TContext>>>;
|
431 | extensionASTNodes: ReadonlyArray<ObjectTypeExtensionNode>;
|
432 | };
|
433 |
|
434 | toString(): string;
|
435 | toJSON(): string;
|
436 | inspect(): string;
|
437 | }
|
438 |
|
439 | export function argsToArgsConfig(
|
440 | args: ReadonlyArray<GraphQLArgument>,
|
441 | ): GraphQLFieldConfigArgumentMap;
|
442 |
|
443 | export interface GraphQLObjectTypeConfig<TSource, TContext> {
|
444 | name: string;
|
445 | description?: Maybe<string>;
|
446 | interfaces?: Thunk<Maybe<Array<GraphQLInterfaceType>>>;
|
447 | fields: Thunk<GraphQLFieldConfigMap<TSource, TContext>>;
|
448 | isTypeOf?: Maybe<GraphQLIsTypeOfFn<TSource, TContext>>;
|
449 | extensions?: Maybe<Readonly<GraphQLObjectTypeExtensions<TSource, TContext>>>;
|
450 | astNode?: Maybe<ObjectTypeDefinitionNode>;
|
451 | extensionASTNodes?: Maybe<ReadonlyArray<ObjectTypeExtensionNode>>;
|
452 | }
|
453 |
|
454 | export type GraphQLTypeResolver<TSource, TContext> = (
|
455 | value: TSource,
|
456 | context: TContext,
|
457 | info: GraphQLResolveInfo,
|
458 | abstractType: GraphQLAbstractType,
|
459 | ) => PromiseOrValue<Maybe<GraphQLObjectType<TSource, TContext> | string>>;
|
460 |
|
461 | export type GraphQLIsTypeOfFn<TSource, TContext> = (
|
462 | source: TSource,
|
463 | context: TContext,
|
464 | info: GraphQLResolveInfo,
|
465 | ) => PromiseOrValue<boolean>;
|
466 |
|
467 | export type GraphQLFieldResolver<
|
468 | TSource,
|
469 | TContext,
|
470 | TArgs = { [argName: string]: any }
|
471 | > = (
|
472 | source: TSource,
|
473 | args: TArgs,
|
474 | context: TContext,
|
475 | info: GraphQLResolveInfo,
|
476 | ) => any;
|
477 |
|
478 | export interface GraphQLResolveInfo {
|
479 | readonly fieldName: string;
|
480 | readonly fieldNodes: ReadonlyArray<FieldNode>;
|
481 | readonly returnType: GraphQLOutputType;
|
482 | readonly parentType: GraphQLObjectType;
|
483 | readonly path: Path;
|
484 | readonly schema: GraphQLSchema;
|
485 | readonly fragments: { [key: string]: FragmentDefinitionNode };
|
486 | readonly rootValue: any;
|
487 | readonly operation: OperationDefinitionNode;
|
488 | readonly variableValues: { [variableName: string]: any };
|
489 | }
|
490 |
|
491 |
|
492 |
|
493 |
|
494 |
|
495 |
|
496 |
|
497 |
|
498 |
|
499 |
|
500 |
|
501 |
|
502 |
|
503 | export interface GraphQLFieldExtensions<
|
504 | _TSource,
|
505 | _TContext,
|
506 | _TArgs = { [argName: string]: any }
|
507 | > {
|
508 | [attributeName: string]: any;
|
509 | }
|
510 |
|
511 | export interface GraphQLFieldConfig<
|
512 | TSource,
|
513 | TContext,
|
514 | TArgs = { [argName: string]: any }
|
515 | > {
|
516 | description?: Maybe<string>;
|
517 | type: GraphQLOutputType;
|
518 | args?: GraphQLFieldConfigArgumentMap;
|
519 | resolve?: GraphQLFieldResolver<TSource, TContext, TArgs>;
|
520 | subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs>;
|
521 | deprecationReason?: Maybe<string>;
|
522 | extensions?: Maybe<
|
523 | Readonly<GraphQLFieldExtensions<TSource, TContext, TArgs>>
|
524 | >;
|
525 | astNode?: Maybe<FieldDefinitionNode>;
|
526 | }
|
527 |
|
528 | export interface GraphQLFieldConfigArgumentMap {
|
529 | [key: string]: GraphQLArgumentConfig;
|
530 | }
|
531 |
|
532 |
|
533 |
|
534 |
|
535 |
|
536 |
|
537 |
|
538 |
|
539 |
|
540 |
|
541 | export interface GraphQLArgumentExtensions {
|
542 | [attributeName: string]: any;
|
543 | }
|
544 |
|
545 | export interface GraphQLArgumentConfig {
|
546 | description?: Maybe<string>;
|
547 | type: GraphQLInputType;
|
548 | defaultValue?: any;
|
549 | deprecationReason?: Maybe<string>;
|
550 | extensions?: Maybe<Readonly<GraphQLArgumentExtensions>>;
|
551 | astNode?: Maybe<InputValueDefinitionNode>;
|
552 | }
|
553 |
|
554 | export interface GraphQLFieldConfigMap<TSource, TContext> {
|
555 | [key: string]: GraphQLFieldConfig<TSource, TContext>;
|
556 | }
|
557 |
|
558 | export interface GraphQLField<
|
559 | TSource,
|
560 | TContext,
|
561 | TArgs = { [key: string]: any }
|
562 | > {
|
563 | name: string;
|
564 | description: Maybe<string>;
|
565 | type: GraphQLOutputType;
|
566 | args: Array<GraphQLArgument>;
|
567 | resolve?: GraphQLFieldResolver<TSource, TContext, TArgs>;
|
568 | subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs>;
|
569 | deprecationReason: Maybe<string>;
|
570 | extensions: Maybe<Readonly<GraphQLFieldExtensions<TSource, TContext, TArgs>>>;
|
571 | astNode?: Maybe<FieldDefinitionNode>;
|
572 |
|
573 |
|
574 | isDeprecated: boolean;
|
575 | }
|
576 |
|
577 | export interface GraphQLArgument {
|
578 | name: string;
|
579 | description: Maybe<string>;
|
580 | type: GraphQLInputType;
|
581 | defaultValue: any;
|
582 | deprecationReason: Maybe<string>;
|
583 | extensions: Maybe<Readonly<GraphQLArgumentExtensions>>;
|
584 | astNode: Maybe<InputValueDefinitionNode>;
|
585 | }
|
586 |
|
587 | export function isRequiredArgument(arg: GraphQLArgument): boolean;
|
588 |
|
589 | export interface GraphQLFieldMap<TSource, TContext> {
|
590 | [key: string]: GraphQLField<TSource, TContext>;
|
591 | }
|
592 |
|
593 |
|
594 |
|
595 |
|
596 |
|
597 |
|
598 |
|
599 |
|
600 |
|
601 |
|
602 | export interface GraphQLInterfaceTypeExtensions {
|
603 | [attributeName: string]: any;
|
604 | }
|
605 |
|
606 |
|
607 |
|
608 |
|
609 |
|
610 |
|
611 |
|
612 |
|
613 |
|
614 |
|
615 |
|
616 |
|
617 |
|
618 |
|
619 |
|
620 |
|
621 |
|
622 |
|
623 |
|
624 | export class GraphQLInterfaceType {
|
625 | name: string;
|
626 | description: Maybe<string>;
|
627 | resolveType: Maybe<GraphQLTypeResolver<any, any>>;
|
628 | extensions: Maybe<Readonly<GraphQLInterfaceTypeExtensions>>;
|
629 | astNode?: Maybe<InterfaceTypeDefinitionNode>;
|
630 | extensionASTNodes: Maybe<ReadonlyArray<InterfaceTypeExtensionNode>>;
|
631 |
|
632 | constructor(config: Readonly<GraphQLInterfaceTypeConfig<any, any>>);
|
633 | getFields(): GraphQLFieldMap<any, any>;
|
634 | getInterfaces(): Array<GraphQLInterfaceType>;
|
635 |
|
636 | toConfig(): GraphQLInterfaceTypeConfig<any, any> & {
|
637 | interfaces: Array<GraphQLInterfaceType>;
|
638 | fields: GraphQLFieldConfigMap<any, any>;
|
639 | extensions: Maybe<Readonly<GraphQLInterfaceTypeExtensions>>;
|
640 | extensionASTNodes: ReadonlyArray<InterfaceTypeExtensionNode>;
|
641 | };
|
642 |
|
643 | toString(): string;
|
644 | toJSON(): string;
|
645 | inspect(): string;
|
646 | }
|
647 |
|
648 | export interface GraphQLInterfaceTypeConfig<TSource, TContext> {
|
649 | name: string;
|
650 | description?: Maybe<string>;
|
651 | interfaces?: Thunk<Maybe<Array<GraphQLInterfaceType>>>;
|
652 | fields: Thunk<GraphQLFieldConfigMap<TSource, TContext>>;
|
653 | |
654 |
|
655 |
|
656 |
|
657 |
|
658 | resolveType?: Maybe<GraphQLTypeResolver<TSource, TContext>>;
|
659 | extensions?: Maybe<Readonly<GraphQLInterfaceTypeExtensions>>;
|
660 | astNode?: Maybe<InterfaceTypeDefinitionNode>;
|
661 | extensionASTNodes?: Maybe<ReadonlyArray<InterfaceTypeExtensionNode>>;
|
662 | }
|
663 |
|
664 |
|
665 |
|
666 |
|
667 |
|
668 |
|
669 |
|
670 |
|
671 |
|
672 |
|
673 | export interface GraphQLUnionTypeExtensions {
|
674 | [attributeName: string]: any;
|
675 | }
|
676 |
|
677 |
|
678 |
|
679 |
|
680 |
|
681 |
|
682 |
|
683 |
|
684 |
|
685 |
|
686 |
|
687 |
|
688 |
|
689 |
|
690 |
|
691 |
|
692 |
|
693 |
|
694 |
|
695 |
|
696 |
|
697 |
|
698 |
|
699 |
|
700 | export class GraphQLUnionType {
|
701 | name: string;
|
702 | description: Maybe<string>;
|
703 | resolveType: Maybe<GraphQLTypeResolver<any, any>>;
|
704 | extensions: Maybe<Readonly<GraphQLUnionTypeExtensions>>;
|
705 | astNode: Maybe<UnionTypeDefinitionNode>;
|
706 | extensionASTNodes: Maybe<ReadonlyArray<UnionTypeExtensionNode>>;
|
707 |
|
708 | constructor(config: Readonly<GraphQLUnionTypeConfig<any, any>>);
|
709 | getTypes(): Array<GraphQLObjectType>;
|
710 |
|
711 | toConfig(): GraphQLUnionTypeConfig<any, any> & {
|
712 | types: Array<GraphQLObjectType>;
|
713 | extensions: Maybe<Readonly<GraphQLUnionTypeExtensions>>;
|
714 | extensionASTNodes: ReadonlyArray<UnionTypeExtensionNode>;
|
715 | };
|
716 |
|
717 | toString(): string;
|
718 | toJSON(): string;
|
719 | inspect(): string;
|
720 | }
|
721 |
|
722 | export interface GraphQLUnionTypeConfig<TSource, TContext> {
|
723 | name: string;
|
724 | description?: Maybe<string>;
|
725 | types: Thunk<Array<GraphQLObjectType>>;
|
726 | |
727 |
|
728 |
|
729 |
|
730 |
|
731 | resolveType?: Maybe<GraphQLTypeResolver<TSource, TContext>>;
|
732 | extensions?: Maybe<Readonly<GraphQLUnionTypeExtensions>>;
|
733 | astNode?: Maybe<UnionTypeDefinitionNode>;
|
734 | extensionASTNodes?: Maybe<ReadonlyArray<UnionTypeExtensionNode>>;
|
735 | }
|
736 |
|
737 |
|
738 |
|
739 |
|
740 |
|
741 |
|
742 |
|
743 |
|
744 |
|
745 |
|
746 | export interface GraphQLEnumTypeExtensions {
|
747 | [attributeName: string]: any;
|
748 | }
|
749 |
|
750 |
|
751 |
|
752 |
|
753 |
|
754 |
|
755 |
|
756 |
|
757 |
|
758 |
|
759 |
|
760 |
|
761 |
|
762 |
|
763 |
|
764 |
|
765 |
|
766 |
|
767 |
|
768 |
|
769 |
|
770 |
|
771 | export class GraphQLEnumType {
|
772 | name: string;
|
773 | description: Maybe<string>;
|
774 | extensions: Maybe<Readonly<GraphQLEnumTypeExtensions>>;
|
775 | astNode: Maybe<EnumTypeDefinitionNode>;
|
776 | extensionASTNodes: Maybe<ReadonlyArray<EnumTypeExtensionNode>>;
|
777 |
|
778 | constructor(config: Readonly<GraphQLEnumTypeConfig>);
|
779 | getValues(): Array<GraphQLEnumValue>;
|
780 | getValue(name: string): Maybe<GraphQLEnumValue>;
|
781 | serialize(value: any): Maybe<string>;
|
782 | parseValue(value: any): Maybe<any>;
|
783 | parseLiteral(
|
784 | valueNode: ValueNode,
|
785 | _variables: Maybe<{ [key: string]: any }>,
|
786 | ): Maybe<any>;
|
787 |
|
788 | toConfig(): GraphQLEnumTypeConfig & {
|
789 | extensions: Maybe<Readonly<GraphQLEnumTypeExtensions>>;
|
790 | extensionASTNodes: ReadonlyArray<EnumTypeExtensionNode>;
|
791 | };
|
792 |
|
793 | toString(): string;
|
794 | toJSON(): string;
|
795 | inspect(): string;
|
796 | }
|
797 |
|
798 | export interface GraphQLEnumTypeConfig {
|
799 | name: string;
|
800 | description?: Maybe<string>;
|
801 | values: GraphQLEnumValueConfigMap;
|
802 | extensions?: Maybe<Readonly<GraphQLEnumTypeExtensions>>;
|
803 | astNode?: Maybe<EnumTypeDefinitionNode>;
|
804 | extensionASTNodes?: Maybe<ReadonlyArray<EnumTypeExtensionNode>>;
|
805 | }
|
806 |
|
807 | export interface GraphQLEnumValueConfigMap {
|
808 | [key: string]: GraphQLEnumValueConfig;
|
809 | }
|
810 |
|
811 |
|
812 |
|
813 |
|
814 |
|
815 |
|
816 |
|
817 |
|
818 |
|
819 |
|
820 | export interface GraphQLEnumValueExtensions {
|
821 | [attributeName: string]: any;
|
822 | }
|
823 |
|
824 | export interface GraphQLEnumValueConfig {
|
825 | description?: Maybe<string>;
|
826 | value?: any;
|
827 | deprecationReason?: Maybe<string>;
|
828 | extensions?: Maybe<Readonly<GraphQLEnumValueExtensions>>;
|
829 | astNode?: Maybe<EnumValueDefinitionNode>;
|
830 | }
|
831 |
|
832 | export interface GraphQLEnumValue {
|
833 | name: string;
|
834 | description: Maybe<string>;
|
835 | value: any;
|
836 | deprecationReason: Maybe<string>;
|
837 | extensions: Maybe<Readonly<GraphQLEnumValueExtensions>>;
|
838 | astNode?: Maybe<EnumValueDefinitionNode>;
|
839 |
|
840 |
|
841 | isDeprecated: boolean;
|
842 | }
|
843 |
|
844 |
|
845 |
|
846 |
|
847 |
|
848 |
|
849 |
|
850 |
|
851 |
|
852 |
|
853 | export interface GraphQLInputObjectTypeExtensions {
|
854 | [attributeName: string]: any;
|
855 | }
|
856 |
|
857 |
|
858 |
|
859 |
|
860 |
|
861 |
|
862 |
|
863 |
|
864 |
|
865 |
|
866 |
|
867 |
|
868 |
|
869 |
|
870 |
|
871 |
|
872 |
|
873 |
|
874 |
|
875 |
|
876 |
|
877 | export class GraphQLInputObjectType {
|
878 | name: string;
|
879 | description: Maybe<string>;
|
880 | extensions: Maybe<Readonly<GraphQLInputObjectTypeExtensions>>;
|
881 | astNode: Maybe<InputObjectTypeDefinitionNode>;
|
882 | extensionASTNodes: Maybe<ReadonlyArray<InputObjectTypeExtensionNode>>;
|
883 |
|
884 | constructor(config: Readonly<GraphQLInputObjectTypeConfig>);
|
885 | getFields(): GraphQLInputFieldMap;
|
886 |
|
887 | toConfig(): GraphQLInputObjectTypeConfig & {
|
888 | fields: GraphQLInputFieldConfigMap;
|
889 | extensions: Maybe<Readonly<GraphQLInputObjectTypeExtensions>>;
|
890 | extensionASTNodes: ReadonlyArray<InputObjectTypeExtensionNode>;
|
891 | };
|
892 |
|
893 | toString(): string;
|
894 | toJSON(): string;
|
895 | inspect(): string;
|
896 | }
|
897 |
|
898 | export interface GraphQLInputObjectTypeConfig {
|
899 | name: string;
|
900 | description?: Maybe<string>;
|
901 | fields: Thunk<GraphQLInputFieldConfigMap>;
|
902 | extensions?: Maybe<Readonly<GraphQLInputObjectTypeExtensions>>;
|
903 | astNode?: Maybe<InputObjectTypeDefinitionNode>;
|
904 | extensionASTNodes?: Maybe<ReadonlyArray<InputObjectTypeExtensionNode>>;
|
905 | }
|
906 |
|
907 |
|
908 |
|
909 |
|
910 |
|
911 |
|
912 |
|
913 |
|
914 |
|
915 |
|
916 | export interface GraphQLInputFieldExtensions {
|
917 | [attributeName: string]: any;
|
918 | }
|
919 |
|
920 | export interface GraphQLInputFieldConfig {
|
921 | description?: Maybe<string>;
|
922 | type: GraphQLInputType;
|
923 | defaultValue?: any;
|
924 | deprecationReason?: Maybe<string>;
|
925 | extensions?: Maybe<Readonly<GraphQLInputFieldExtensions>>;
|
926 | astNode?: Maybe<InputValueDefinitionNode>;
|
927 | }
|
928 |
|
929 | export interface GraphQLInputFieldConfigMap {
|
930 | [key: string]: GraphQLInputFieldConfig;
|
931 | }
|
932 |
|
933 | export interface GraphQLInputField {
|
934 | name: string;
|
935 | description?: Maybe<string>;
|
936 | type: GraphQLInputType;
|
937 | defaultValue?: any;
|
938 | deprecationReason: Maybe<string>;
|
939 | extensions: Maybe<Readonly<GraphQLInputFieldExtensions>>;
|
940 | astNode?: Maybe<InputValueDefinitionNode>;
|
941 | }
|
942 |
|
943 | export function isRequiredInputField(field: GraphQLInputField): boolean;
|
944 |
|
945 | export interface GraphQLInputFieldMap {
|
946 | [key: string]: GraphQLInputField;
|
947 | }
|