1import type * as GraphQL from 'graphql';
2
3type OrNever<T> = void extends T ? never : T;
4
5export type IntrospectionQuery =
6 | {
7 readonly __schema: {
8 queryType: { name: string; kind?: any };
9 mutationType?: { name: string; kind?: any } | null;
10 subscriptionType?: { name: string; kind?: any } | null;
11 types?: readonly IntrospectionType[];
12 };
13 }
14 | OrNever<GraphQL.IntrospectionQuery>;
15
16export type IntrospectionTypeRef =
17 | {
18 readonly kind:
19 | 'SCALAR'
20 | 'OBJECT'
21 | 'INTERFACE'
22 | 'ENUM'
23 | 'UNION'
24 | 'INPUT_OBJECT';
25 readonly name?: string;
26 readonly ofType?: IntrospectionTypeRef;
27 }
28 | OrNever<GraphQL.IntrospectionTypeRef>;
29
30export type IntrospectionInputTypeRef =
31 | {
32 readonly kind: 'SCALAR' | 'ENUM' | 'INPUT_OBJECT';
33 readonly name?: string;
34 readonly ofType?: IntrospectionInputTypeRef;
35 }
36 | OrNever<GraphQL.IntrospectionInputTypeRef>;
37
38export type IntrospectionInputValue =
39 | {
40 readonly name: string;
41 readonly description?: string | null;
42 readonly defaultValue?: string | null;
43 readonly type: IntrospectionInputTypeRef;
44 }
45 | OrNever<GraphQL.IntrospectionInputValue>;
46
47export type IntrospectionType =
48 | {
49 readonly kind: string;
50 readonly name: string;
51 readonly fields?: readonly any[];
52 readonly interfaces?: readonly any[];
53 readonly possibleTypes?: readonly any[];
54 }
55 | OrNever<GraphQL.IntrospectionType>;