forked from saleor/apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodegen.ts
More file actions
59 lines (57 loc) 路 1.48 KB
/
Copy pathcodegen.ts
File metadata and controls
59 lines (57 loc) 路 1.48 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
52
53
54
55
56
57
58
59
import { type CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = {
generates: {
"generated/graphql.ts": {
schema: "graphql/schema.graphql",
documents: ["graphql/**/*.graphql"],
plugins: [
{
add: {
content:
"type JSONValue = string | number | boolean | null | { [key: string]: JSONValue } | JSONValue[];",
},
},
{
typescript: {
enumsAsTypes: true,
},
},
"typescript-operations",
{
"typescript-urql": {
documentVariablePrefix: "Untyped",
fragmentVariablePrefix: "Untyped",
withHooks: false,
},
},
"typed-document-node",
],
config: {
dedupeFragments: true,
defaultScalarType: "unknown",
immutableTypes: true,
strictScalars: true,
skipTypename: true,
scalars: {
_Any: "unknown",
Date: "string",
DateTime: "string",
Decimal: "number",
Minute: "number",
GenericScalar: "JSONValue",
JSON: "JSONValue",
JSONString: "string",
Metadata: "Record<string, string>",
PositiveDecimal: "number",
Upload: "unknown",
UUID: "string",
WeightScalar: "number",
Day: "string",
Hour: "number",
PositiveInt: "number",
},
},
},
},
};
export default config;