-
Notifications
You must be signed in to change notification settings - Fork 1
/
codegen.ts
100 lines (96 loc) · 2.53 KB
/
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
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
import {
join as pathJoin,
} from "node:path";
import {
type CodegenConfig,
} from "@graphql-codegen/cli";
const graphqlDir = pathJoin(__dirname, "graphql");
const inGraphqlDir = (...pathParts: string[]) =>
pathJoin(graphqlDir, ...pathParts);
const GENERATED_FILES_HEADER = `
/**
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* DO NOT EDIT THIS FILE MANUALLY!
*
* This file is automatically generated
* by running \`yarn graphql:schema:gen\`
*
* Any edits done to this file will be
* overwritten on subsequent runs!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
`.trim();
export default {
overwrite: true,
schema: inGraphqlDir("schema.graphql"),
documents: [
"./graphql/documents/**/*.graphql",
"./pages/calendar/**/*.vue",
"./pages/profile/me/reservations/**/*.vue",
"./pages/admin/season/*.vue",
"./pages/admin/season/[season]/applications/approval.vue",
"./pages/participants.vue",
"./pages/gate-guardian/**/*.vue",
"./pages/admin/users/scanners.vue",
"./pages/profile/me/company/scan-user-qr.vue",
"./pages/profile/me/company/scans/**/*.vue",
"./store/**/*.ts",
"./pages/admin/season/[season]/reservations/scanned.vue",
"./pages/profile/me/company/signup.vue",
"./pages/admin/season/[season]/applications/[company]/edit.vue",
"./pages/admin/season/[season]/ratings/**/*.vue",
"./pages/company/[uid]/rate/**/*.vue",
"./components/page/admin/season/_season_/ratings/**/*.vue",
"./pages/live-vote/**/*.vue",
"./pages/admin/season/[season]/live-vote/**/*.vue",
],
generates: {
[inGraphqlDir("schema.ts")]: {
plugins: [
{
add: {
content: "/* eslint-disable */",
},
},
{
add: {
content: GENERATED_FILES_HEADER,
},
},
"typescript",
"typescript-operations",
"typescript-resolvers",
"typescript-document-nodes",
],
},
[inGraphqlDir("client/")]: {
preset: "client",
plugins: [
{
add: {
content: "/* eslint-disable */",
},
},
{
add: {
content: GENERATED_FILES_HEADER,
},
},
],
},
},
config: {
typesPrefix: "I",
declarationKind: "type",
skipTypename: true,
useTypeImports: true,
strictScalars: true,
scalars: {
DateTimeISO: "string | Date",
Upload: "unknown",
},
dedupeFragments: true,
extractAllFieldsToTypes: true,
// immutableTypes: true,
},
} satisfies CodegenConfig;