forked from argos-ci/argos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodegen.ts
More file actions
132 lines (129 loc) · 5.99 KB
/
Copy pathcodegen.ts
File metadata and controls
132 lines (129 loc) · 5.99 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
import type { CodegenConfig } from "@graphql-codegen/cli";
const frontendConfig = {
dedupeFragments: true,
enumType: "native",
nonOptionalTypename: true,
skipTypeNameForRoot: true,
scalars: {
Date: "string",
DateTime: "string",
JSONObject: "any",
Time: "string",
Timestamp: "number",
},
};
const config: CodegenConfig = {
schema: {
"apps/backend/src/graphql/definitions/*.ts": {
noRequire: true,
},
},
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",
scalars: {
DateTime: "Date",
Date: "Date",
Timestamp: "Number",
},
mappers: {
AccountAvatar: "../../database/models/index.js#AccountAvatar",
AccountSubscription: "../../database/models/index.js#Subscription",
AutoInvite: "../../database/services/team-domain.js#AutoInvite",
AuditTrail: "../../database/models/index.js#AuditTrail",
AuthorizedApp: "../../database/models/index.js#OAuthGrant",
AutomationRule: "../../database/models/index.js#AutomationRule",
AutomationRun: "../../database/models/index.js#AutomationRun",
AutomationActionRun:
"../../database/models/index.js#AutomationActionRun",
Build: "../../database/models/index.js#Build",
BuildReview: "../../database/models/index.js#BuildReview",
Comment: "../../database/models/index.js#Comment",
CommentReactionGroup:
"../../comment/reactions.js#CommentReactionGroup",
Deployment: "../../database/models/index.js#Deployment",
DiscordWebhook: "../../database/models/index.js#DiscordWebhook",
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",
OriginInstallation:
"../../database/models/index.js#OriginInstallation",
OriginPullRequest: "../../database/models/index.js#OriginPullRequest",
OriginRepository: "../../database/models/index.js#OriginRepository",
GitlabUser: "../../database/models/index.js#GitlabUser",
GlApiNamespace: "../../gitlab/index.js#GlApiNamespace",
GlApiProject: "../../gitlab/index.js#GlApiProject",
GoogleUser: "../../database/models/index.js#GoogleUser",
Invoice: "../../database/models/index.js#StripeInvoice",
UpcomingInvoice: "../../stripe/upcoming-invoice.js#UpcomingInvoice",
Media: "../../database/models/index.js#Media",
MediaDiff: "../../database/models/index.js#MediaDiff",
MediaVersion: "../../database/models/index.js#MediaVersion",
// Not a model: a grouped row, so the resolvers receive what the query
// actually selected rather than a shape nothing produces.
MsTeamsWebhook: "../../database/models/index.js#MsTeamsWebhook",
OAuthClient: "../../database/models/index.js#OAuthClient",
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",
ScreenshotMetadataSDK:
"@argos/schemas/screenshot-metadata#ScreenshotMetadataSDK",
SlackInstallation: "../../database/models/index.js#SlackInstallation",
TeamStaffInfo: "../../database/models/index.js#Account",
TeamStaffPeriodUsage: "../../database/models/index.js#Account",
TeamStaffContact: "../../database/models/index.js#StaffTeamContact",
Project: "../../database/models/index.js#Project",
ProjectCustomDomain: "../../database/models/index.js#ProjectDomain",
Team: "../../database/models/index.js#Account",
TeamDomain: "../../database/models/index.js#TeamDomain",
TeamInvite: "../../database/models/index.js#TeamInvite",
TeamSamlConfig: "../../database/models/index.js#TeamSamlConfig",
TeamMember: "../../database/models/index.js#TeamUser",
TeamGithubMember:
"../../database/models/index.js#GithubAccountMember",
Test: "../../database/models/index.js#Test",
TestMetrics: "../../graphql/definitions/Test.js#TestMetrics",
TestChange:
"../../graphql/definitions/TestChange.js#TestChangeObject",
User: "../../database/models/index.js#Account",
UserAccessToken: "../../database/models/index.js#UserAccessToken",
UserPasskey: "../../database/models/index.js#UserPasskey",
UserSession: "../../database/models/index.js#UserSession",
},
},
},
"apps/frontend/src/gql/schema.ts": {
plugins: ["typescript"],
config: frontendConfig,
},
"apps/frontend/src/gql/": {
preset: "client",
plugins: [{ add: { content: 'export * from "./schema";' } }],
config: frontendConfig,
presetConfig: {
fragmentMasking: false,
},
},
"apps/frontend/src/gql-fragments.json": {
plugins: ["fragment-matcher"],
},
},
};
export default config;