-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodegen.ts
More file actions
31 lines (28 loc) · 1012 Bytes
/
Copy pathcodegen.ts
File metadata and controls
31 lines (28 loc) · 1012 Bytes
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
import { CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = {
overwrite: true,
schema: "https://api.digitransit.fi/routing/v2/finland/gtfs/v1/?digitransit-subscription-key=bbc7a56df1674c59822889b1bc84e7ad",
documents: ["./app/**/*.{ts,tsx}"],
ignoreNoDocuments: true,
generates: {
"./app/lib/__generated__/graphql.ts": {
plugins: ["typescript-operations"],
config: {
generateOperationTypes: false,
},
},
"./app/": {
preset: "near-operation-file",
plugins: ["typescript-operations", "typed-document-node"],
config: {
importSchemaTypesFrom: "./app/lib/__generated__/graphql.ts",
// 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,
},
},
},
};
export default config;