-
Notifications
You must be signed in to change notification settings - Fork 6
/
codegen.ts
39 lines (37 loc) · 874 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
import type { CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = {
overwrite: true,
documents: "./graphql/**/*/*.graphql",
schema: [
{
"https://api.findlabs.io/hasura/v1/graphql": {
headers: {
"Authorization": `Bearer ${process.env.FLOWDIVER_API_KEY}`,
},
},
},
],
generates: {
"./generated/": {
preset: "client",
},
'./graphql.schema.json': {
plugins: ['introspection'],
},
// generate types.ts
"graphql/types.ts": { plugins: ["typescript"] },
// generate operations.ts
"graphql/operations.ts": {
preset: "import-types",
plugins: ["typescript-operations", "typescript-urql"],
presetConfig: {
typesPath: "./types",
},
config: {
withHooks: false,
},
},
},
hooks: { afterAllFileWrite: ["prettier --write"] },
};
export default config;