-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodegen.ts
40 lines (38 loc) · 964 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
import type { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
overwrite: true,
schema: "https://api-eu-central-1-shared-euc1-02.hygraph.com/v2/clg6idcnc0tde01t3cvzvgg5l/master",
documents: "./src/**/*.graphql",
generates: {
"src/types.ts": {
plugins: [
"typescript",
"typescript-operations",
"fragment-matcher",
"named-operations-object",
],
config: {
apolloClientVersion: 3,
useExplicitTyping: true,
scalars: {
JSON: "string",
},
},
},
"./graphql.schema.json": {
plugins: ["introspection"],
},
"src/": {
preset: "near-operation-file",
presetConfig: {
extension: ".generated.tsx",
baseTypesPath: "types.ts",
},
plugins: ["typescript-operations", "typescript-react-apollo"],
config: {
withHooks: true,
},
},
},
};
export default config;