-
Notifications
You must be signed in to change notification settings - Fork 35
/
codegen.ts
59 lines (57 loc) · 2.49 KB
/
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
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 = {
schema: "apps/backend/src/graphql/definitions/*.ts",
documents: ["apps/frontend/src/**/*.tsx", "apps/frontend/src/**/*.ts"],
ignoreNoDocuments: true, // for better experience with the watcher
generates: {
"apps/backend/src/graphql/__generated__/schema.gql": {
plugins: ["schema-ast"],
},
"apps/backend/src/graphql/__generated__/resolver-types.ts": {
plugins: ["typescript", "typescript-resolvers"],
config: {
useIndexSignature: true,
contextType: "../context.js#Context",
useTypeImports: true,
typesPrefix: "I",
mappers: {
AccountAvatar: "../../database/models/index.js#AccountAvatar",
AccountSubscription: "../../database/models/index.js#Subscription",
Build: "../../database/models/index.js#Build",
GhApiInstallation: "../../github/index.js#GhApiInstallation",
GhApiRepository: "../../github/index.js#GhApiRepository",
GithubAccount: "../../database/models/index.js#GithubAccount",
GithubInstallation:
"../../database/models/index.js#GithubInstallation",
GithubPullRequest: "../../database/models/index.js#GithubPullRequest",
GithubRepository: "../../database/models/index.js#GithubRepository",
GitlabProject: "../../database/models/index.js#GitlabProject",
GlApiNamespace: "../../gitlab/index.js#GlApiNamespace",
GlApiProject: "../../gitlab/index.js#GlApiProject",
Plan: "../../database/models/index.js#Plan",
ProjectContributor: "../../database/models/index.js#ProjectUser",
Screenshot: "../../database/models/index.js#Screenshot",
ScreenshotBucket: "../../database/models/index.js#ScreenshotBucket",
ScreenshotDiff: "../../database/models/index.js#ScreenshotDiff",
Project: "../../database/models/index.js#Project",
Team: "../../database/models/index.js#Account",
TeamMember: "../../database/models/index.js#TeamUser",
TeamGithubMember:
"../../database/models/index.js#GithubAccountMember",
User: "../../database/models/index.js#Account",
},
},
},
"apps/frontend/src/gql/": {
preset: "client",
plugins: [],
config: {
dedupeFragments: true,
},
},
"apps/frontend/src/gql-fragments.json": {
plugins: ["fragment-matcher"],
},
},
};
export default config;