-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathgraphql.ts
More file actions
138 lines (132 loc) · 4.76 KB
/
graphql.ts
File metadata and controls
138 lines (132 loc) · 4.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/* eslint-disable */
import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
export type Maybe<T> = T | null;
export type InputMaybe<T> = T | null | undefined;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: { input: string; output: string };
String: { input: string; output: string };
Boolean: { input: boolean; output: boolean };
Int: { input: number; output: number };
Float: { input: number; output: number };
};
export type Query = {
__typename?: 'Query';
alphabet: Array<Scalars['String']['output']>;
/** A field that resolves fast. */
fastField: Scalars['String']['output'];
/**
* A field that resolves slowly.
* Maybe you want to @defer this field ;)
*/
slowField: Scalars['String']['output'];
};
export type QuerySlowFieldArgs = {
waitFor?: Scalars['Int']['input'];
};
export type SlowFieldFragmentFragment = { __typename?: 'Query'; slowField: string } & {
' $fragmentName'?: 'SlowFieldFragmentFragment';
};
export type SlowAndFastFieldWithDeferQueryVariables = Exact<{ [key: string]: never }>;
export type SlowAndFastFieldWithDeferQuery = { __typename?: 'Query'; fastField: string } & (
| { __typename?: 'Query'; inlinedSlowField: string }
| { __typename?: 'Query'; inlinedSlowField?: never }
) &
({ __typename?: 'Query' } & {
' $fragmentRefs'?: { SlowFieldFragmentFragment: Incremental<SlowFieldFragmentFragment> };
});
export const SlowFieldFragmentFragmentDoc = {
kind: 'Document',
definitions: [
{
kind: 'FragmentDefinition',
name: { kind: 'Name', value: 'SlowFieldFragment' },
typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'Query' } },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'slowField' },
arguments: [
{
kind: 'Argument',
name: { kind: 'Name', value: 'waitFor' },
value: { kind: 'IntValue', value: '5000' },
},
],
},
],
},
},
],
} as unknown as DocumentNode<SlowFieldFragmentFragment, unknown>;
export const SlowAndFastFieldWithDeferDocument = {
__meta__: { deferredFields: { SlowFieldFragment: ['slowField'] } },
kind: 'Document',
definitions: [
{
kind: 'OperationDefinition',
operation: 'query',
name: { kind: 'Name', value: 'SlowAndFastFieldWithDefer' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{ kind: 'Field', name: { kind: 'Name', value: 'fastField' } },
{
kind: 'FragmentSpread',
name: { kind: 'Name', value: 'SlowFieldFragment' },
directives: [{ kind: 'Directive', name: { kind: 'Name', value: 'defer' } }],
},
{
kind: 'InlineFragment',
directives: [{ kind: 'Directive', name: { kind: 'Name', value: 'defer' } }],
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
alias: { kind: 'Name', value: 'inlinedSlowField' },
name: { kind: 'Name', value: 'slowField' },
arguments: [
{
kind: 'Argument',
name: { kind: 'Name', value: 'waitFor' },
value: { kind: 'IntValue', value: '5000' },
},
],
},
],
},
},
],
},
},
{
kind: 'FragmentDefinition',
name: { kind: 'Name', value: 'SlowFieldFragment' },
typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'Query' } },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'slowField' },
arguments: [
{
kind: 'Argument',
name: { kind: 'Name', value: 'waitFor' },
value: { kind: 'IntValue', value: '5000' },
},
],
},
],
},
},
],
} as unknown as DocumentNode<SlowAndFastFieldWithDeferQuery, SlowAndFastFieldWithDeferQueryVariables>;