forked from saleor/saleor-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodegen-staging.ts
More file actions
55 lines (53 loc) · 1.46 KB
/
codegen-staging.ts
File metadata and controls
55 lines (53 loc) · 1.46 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
import { CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = {
schema: "./schema-staging.graphql",
ignoreNoDocuments: true,
documents: [
"./src/**/queries.staging.ts",
"./src/**/mutations.staging.ts",
"./src/**/fragments/*.staging.ts",
"./src/searches/*.staging.ts",
],
generates: {
"./src/graphql/fragmentTypesStaging.generated.ts": {
plugins: ["fragment-matcher"],
config: {
minify: false,
apolloClientVersion: 3,
},
},
"./src/graphql/typePoliciesStaging.generated.ts": {
plugins: ["typescript-apollo-client-helpers"],
},
"./src/graphql/typesStaging.generated.ts": {
plugins: ["typescript", "typescript-operations"],
config: {
nonOptionalTypename: true,
avoidOptionals: {
field: true,
inputValue: false,
object: false,
defaultValue: false,
},
namingConvention: {
enumValues: "change-case-all#upperCase",
},
onlyOperationTypes: true,
typeSuffix: "Staging",
},
},
"./src/graphql/hooksStaging.generated.ts": {
plugins: ["typescript-react-apollo"],
config: {
withHooks: true,
apolloReactHooksImportFrom: "@dashboard/hooks/graphql",
documentVariableSuffix: "Staging",
},
preset: "import-types",
presetConfig: {
typesPath: "./typesStaging.generated",
},
},
},
};
export default config;