-
Notifications
You must be signed in to change notification settings - Fork 0
/
codegen.ts
41 lines (39 loc) · 991 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 = {
documents: ["scripts/update-ui-kits.js"],
generates: {
"github.generated.ts": {
config: {
avoidOptionals: true,
scalars: {
URI: "string",
},
},
plugins: ["typescript"],
},
"scripts/": {
config: {
avoidOptionals: true,
},
plugins: ["typescript-operations"],
preset: "near-operation-file",
presetConfig: {
baseTypesPath: "../github.generated.ts",
extension: ".generated.ts",
},
},
},
hooks: {
afterAllFileWrite: ["yarn prettier --write", "yarn run eslint --fix"],
},
ignoreNoDocuments: true, // for better experience with the watcher
schema: {
"https://github.com/gitapi/graphql": {
headers: {
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`,
"User-Agent": "Awesome-Octocat-App",
},
},
},
};
export default config;