-
Notifications
You must be signed in to change notification settings - Fork 0
/
graphql.config.ts
44 lines (42 loc) · 1.08 KB
/
graphql.config.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
import type { IGraphQLConfig } from "graphql-config";
const config: IGraphQLConfig = {
schema: "https://api.crm.refine.dev/graphql",
extensions: {
codegen: {
hooks: {
afterOneFileWrite: ["eslint --fix", "prettier --write"],
},
generates: {
"src/graphql/schema.types.ts": {
plugins: ["typescript"],
config: {
skipTypename: true,
enumsAsTypes: true,
scalars: {
DateTime: {
input: "string",
output: "string",
format: "date-time",
},
},
},
},
"src/graphql/types.ts": {
preset: "import-types",
documents: ["src/**/*.{ts,tsx}"],
plugins: ["typescript-operations"],
config: {
skipTypename: true,
enumsAsTypes: true,
preResolveTypes: false,
useTypeImports: true,
},
presetConfig: {
typesPath: "./schema.types",
},
},
},
},
},
};
export default config;