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