forked from gitify-app/gitify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodegen.ts
More file actions
37 lines (34 loc) · 885 Bytes
/
codegen.ts
File metadata and controls
37 lines (34 loc) · 885 Bytes
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
import type { CodegenConfig } from '@graphql-codegen/cli';
import dotenv from 'dotenv';
dotenv.config();
const config: CodegenConfig = {
overwrite: true,
schema: {
'https://api.github.com/graphql': {
// Add a custom header for authorization using your PAT
headers: {
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`,
},
},
},
documents: ['src/renderer/utils/api/**/*.graphql'],
generates: {
'src/renderer/utils/api/graphql/generated/': {
preset: 'client',
presetConfig: {
fragmentMasking: false, // Disables masking
},
config: {
documentMode: 'string',
useTypeImports: true,
},
},
'src/renderer/utils/api/graphql/generated/schema.graphql': {
plugins: ['schema-ast'],
config: {
includeDirectives: true,
},
},
},
};
export default config;