-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codegen.ts
41 lines (38 loc) · 983 Bytes
/
codegen.ts
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
import type { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
overwrite: true,
schema: {
'https://www.fflogs.com/api/v2/client': {
headers: {
Authorization: `Bearer ${process.env.FFLOGS_API_ACCESS_TOKEN}`,
},
experimentalFragmentVariables: true,
},
},
documents: ['src/**/*.graphql', 'src/fflogs/queries.ts'],
ignoreNoDocuments: true,
emitLegacyCommonJSImports: false,
generates: {
'./src/fflogs/graphql/schema.graphql': {
plugins: ['schema-ast'],
config: {
includeDirectives: true,
includeIntrospectionTypes: true,
},
},
'./src/fflogs/graphql/sdk.ts': {
plugins: [
'typescript',
'typescript-operations',
'typescript-graphql-request',
],
config: {
enumsAsConst: true,
documentMode: 'string',
immutableTypes: true,
useTypeImports: true,
},
},
},
};
export default config;