-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcodegen.ts
More file actions
43 lines (42 loc) · 1.28 KB
/
codegen.ts
File metadata and controls
43 lines (42 loc) · 1.28 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
import { CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = {
overwrite: true,
schema: "./graphql.ts",
documents: [
"app/**/*.{ts,tsx,gql,graphql}",
"components/**/*.{ts,tsx,gql,graphql}",
"!app/api/toplogger_scrape/queries.ts",
"!app/api/toplogger_scrape/fragments.ts",
],
// Don't exit with non-zero status when there are no documents
ignoreNoDocuments: true,
generates: {
"./graphql.generated.ts": {
plugins: [
"typescript",
"typescript-operations",
"typescript-resolvers",
"typed-document-node",
],
config: {
useTypeImports: true,
typesPrefix: "GQ",
arrayInputCoercion: false,
avoidOptionals: { field: false, inputValue: false },
defaultScalarType: "unknown",
// Apollo Client always includes `__typename` fields
nonOptionalTypename: true,
// Apollo Client doesn't add the `__typename` field to root types so
// don't generate a type for the `__typename` for root operation types.
skipTypeNameForRoot: true,
strictScalars: true,
scalars: {
Date: "Date",
JSON: "unknown",
JSONObject: "Record<string, unknown>",
},
},
},
},
};
export default config;