-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodegen.ts
More file actions
51 lines (50 loc) · 1.45 KB
/
codegen.ts
File metadata and controls
51 lines (50 loc) · 1.45 KB
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
import type { CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = {
schema: "./data/schema.graphql",
documents: "./graphql/**/*.graphql",
config: {
avoidOptionals:{
field: true,
inputValue: false,
object: false
},
scalars: {
// UUID: "string",
// Username: "string",
// Url: "string",
// Tag: "string",
Datetime: "string",
BigInt: "string",
JSON: "{ [key: string]: any }",
},
immutableTypes: true,
enumsAsTypes: true,
// namingConvention: "change-case#pascalCase",
// noGraphQLTag: false,
dedupeFragments: true,
// skipTypename: true,
},
generates: {
"./utils/graphql.ts": {
plugins: [
{ add: { content: ["/* WARNING: This file is automatically generated. Do not edit. */"] } },
{ add: { content: ["/* eslint-disable @typescript-eslint/no-explicit-any, import/no-duplicates */"] } },
{ add: { content: ["/* tslint:disable */"] } },
// { add: { content: ["/* eslint:disable */"] } },
// { add: { content: ["// @ts-nocheck"] } },
"typescript",
"typescript-operations",
// "typescript-resolvers",
"typescript-urql-graphcache",
"typescript-vue-urql",
],
},
"./utils/introspection.ts": {
plugins: ["urql-introspection"],
},
},
hooks: {
afterAllFileWrite: ["npx eslint --fix "],
},
};
export default config;