-
Notifications
You must be signed in to change notification settings - Fork 16
/
gqlgen.yml
445 lines (348 loc) · 11.1 KB
/
gqlgen.yml
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
# Copyright 2024 Andres Morey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Where are all the schema files located? globs are supported eg src/**/*.graphqls
schema:
- graph/*.graphqls
# Where should the generated server code go?
exec:
filename: graph/generated.go
package: graph
# Uncomment to enable federation
# federation:
# filename: graph/federation.go
# package: graph
# Where should any generated models go?
model:
filename: graph/model/models_gen.go
package: model
# Where should the resolver implementations go?
resolver:
layout: follow-schema
dir: graph
package: graph
filename_template: "{name}.resolvers.go"
# Optional: turn on to not generate template comments above resolvers
# omit_template_comment: false
# Optional: turn on use ` + "`" + `gqlgen:"fieldName"` + "`" + ` tags in your models
# struct_tag: json
# Optional: turn on to use []Thing instead of []*Thing
omit_slice_element_pointers: true
# Optional: turn on to omit Is<Name>() methods to interface and unions
omit_interface_checks : true
# Optional: turn on to skip generation of ComplexityRoot struct content and Complexity function
# omit_complexity: false
# Optional: turn on to not generate any file notice comments in generated files
# omit_gqlgen_file_notice: false
# Optional: turn on to exclude the gqlgen version in the generated file notice. No effect if `omit_gqlgen_file_notice` is true.
# omit_gqlgen_version_in_file_notice: false
# Optional: turn off to make struct-type struct fields not use pointers
# e.g. type Thing struct { FieldA OtherThing } instead of { FieldA *OtherThing }
struct_fields_always_pointers: false
# Optional: turn off to make resolvers return values instead of pointers for structs
resolvers_always_return_pointers: false
# Optional: turn on to return pointers instead of values in unmarshalInput
# return_pointers_in_unmarshalinput: false
# Optional: wrap nullable input fields with Omittable
# nullable_input_omittable: true
# Optional: set to speed up generation time by not performing a final validation pass.
# skip_validation: true
# Optional: set to skip running `go mod tidy` when generating server code
# skip_mod_tidy: true
# gqlgen will search for any type names in the schema in these go packages
# if they match it will use them, otherwise it will generate them.
autobind:
# - "github.com/kubetail-org/kubetail/modules/server/graph/model"
# This section declares type mapping between the GraphQL and go type systems
#
# The first line in each type will be used as defaults for resolver arguments and
# modelgen, the others will be allowed when binding to fields. Configure them to
# your liking
models:
# --- Interfaces ---
List:
model: github.com/kubetail-org/kubetail/modules/server/graph/model.List
Object:
model: github.com/kubetail-org/kubetail/modules/server/graph/model.Object
# --- AppsV1 ---
AppsV1DaemonSet:
model: k8s.io/api/apps/v1.DaemonSet
fields:
id:
fieldName: UID
metadata:
fieldName: ObjectMeta
AppsV1DaemonSetCondition:
model: k8s.io/api/apps/v1.DaemonSetCondition
AppsV1DaemonSetConditionType:
model: k8s.io/api/apps/v1.DaemonSetConditionType
AppsV1DaemonSetList:
model: k8s.io/api/apps/v1.DaemonSetList
fields:
metadata:
fieldName: ListMeta
AppsV1DaemonSetSpec:
model: k8s.io/api/apps/v1.DaemonSetSpec
AppsV1DaemonSetStatus:
model: k8s.io/api/apps/v1.DaemonSetStatus
AppsV1DaemonSetsWatchEvent:
model: k8s.io/apimachinery/pkg/watch.Event
fields:
object:
resolver: true
AppsV1Deployment:
model: k8s.io/api/apps/v1.Deployment
fields:
id:
fieldName: UID
metadata:
fieldName: ObjectMeta
AppsV1DeploymentList:
model: k8s.io/api/apps/v1.DeploymentList
fields:
metadata:
fieldName: ListMeta
AppsV1DeploymentSpec:
model: k8s.io/api/apps/v1.DeploymentSpec
AppsV1DeploymentStatus:
model: k8s.io/api/apps/v1.DeploymentStatus
AppsV1DeploymentsWatchEvent:
model: k8s.io/apimachinery/pkg/watch.Event
fields:
object:
resolver: true
AppsV1ReplicaSet:
model: k8s.io/api/apps/v1.ReplicaSet
fields:
id:
fieldName: UID
metadata:
fieldName: ObjectMeta
AppsV1ReplicaSetList:
model: k8s.io/api/apps/v1.ReplicaSetList
fields:
metadata:
fieldName: ListMeta
AppsV1ReplicaSetSpec:
model: k8s.io/api/apps/v1.ReplicaSetSpec
AppsV1ReplicaSetStatus:
model: k8s.io/api/apps/v1.ReplicaSetStatus
AppsV1ReplicaSetsWatchEvent:
model: k8s.io/apimachinery/pkg/watch.Event
fields:
object:
resolver: true
AppsV1StatefulSet:
model: k8s.io/api/apps/v1.StatefulSet
fields:
id:
fieldName: UID
metadata:
fieldName: ObjectMeta
AppsV1StatefulSetList:
model: k8s.io/api/apps/v1.StatefulSetList
fields:
metadata:
fieldName: ListMeta
AppsV1StatefulSetSpec:
model: k8s.io/api/apps/v1.StatefulSetSpec
AppsV1StatefulSetsWatchEvent:
model: k8s.io/apimachinery/pkg/watch.Event
fields:
object:
resolver: true
# --- BatchV1 ---
BatchV1CronJob:
model: k8s.io/api/batch/v1.CronJob
fields:
id:
fieldName: UID
metadata:
fieldName: ObjectMeta
BatchV1CronJobList:
model: k8s.io/api/batch/v1.CronJobList
fields:
metadata:
fieldName: ListMeta
BatchV1CronJobSpec:
model: k8s.io/api/batch/v1.CronJobSpec
BatchV1CronJobStatus:
model: k8s.io/api/batch/v1.CronJobStatus
BatchV1CronJobsWatchEvent:
model: k8s.io/apimachinery/pkg/watch.Event
fields:
object:
resolver: true
BatchV1Job:
model: k8s.io/api/batch/v1.Job
fields:
id:
fieldName: UID
metadata:
fieldName: ObjectMeta
BatchV1JobCondition:
model: k8s.io/api/batch/v1.JobCondition
BatchV1JobConditionType:
model: k8s.io/api/batch/v1.JobConditionType
BatchV1JobList:
model: k8s.io/api/batch/v1.JobList
fields:
metadata:
fieldName: ListMeta
BatchV1JobSpec:
model: k8s.io/api/batch/v1.JobSpec
BatchV1JobStatus:
model: k8s.io/api/batch/v1.JobStatus
BatchV1JobTemplateSpec:
model: k8s.io/api/batch/v1.JobTemplateSpec
fields:
metadata:
fieldName: ObjectMeta
BatchV1JobsWatchEvent:
model: k8s.io/apimachinery/pkg/watch.Event
fields:
object:
resolver: true
# --- CoreV1 ---
CoreV1ConditionStatus:
model: k8s.io/api/core/v1.ConditionStatus
CoreV1Container:
model: k8s.io/api/core/v1.Container
CoreV1ContainerState:
model: k8s.io/api/core/v1.ContainerState
CoreV1ContainerStateWaiting:
model: k8s.io/api/core/v1.ContainerStateWaiting
CoreV1ContainerStateRunning:
model: k8s.io/api/core/v1.ContainerStateRunning
CoreV1ContainerStateTerminated:
model: k8s.io/api/core/v1.ContainerStateTerminated
CoreV1ContainerStatus:
model: k8s.io/api/core/v1.ContainerStatus
CoreV1Namespace:
model: k8s.io/api/core/v1.Namespace
fields:
id:
fieldName: UID
metadata:
fieldName: ObjectMeta
CoreV1NamespaceList:
model: k8s.io/api/core/v1.NamespaceList
fields:
metadata:
fieldName: ListMeta
CoreV1NamespacesWatchEvent:
model: k8s.io/apimachinery/pkg/watch.Event
fields:
object:
resolver: true
CoreV1Node:
model: k8s.io/api/core/v1.Node
fields:
id:
fieldName: UID
metadata:
fieldName: ObjectMeta
CoreV1NodeList:
model: k8s.io/api/core/v1.NodeList
fields:
metadata:
fieldName: ListMeta
CoreV1NodesWatchEvent:
model: k8s.io/apimachinery/pkg/watch.Event
fields:
object:
resolver: true
CoreV1ObjectReference:
model: k8s.io/api/core/v1.ObjectReference
CoreV1Pod:
model: k8s.io/api/core/v1.Pod
fields:
id:
fieldName: UID
metadata:
fieldName: ObjectMeta
CoreV1PodList:
model: k8s.io/api/core/v1.PodList
fields:
metadata:
fieldName: ListMeta
CoreV1PodLogOptions:
model: k8s.io/api/core/v1.PodLogOptions
CoreV1PodPhase:
model: k8s.io/api/core/v1.PodPhase
CoreV1PodSpec:
model: k8s.io/api/core/v1.PodSpec
CoreV1PodStatus:
model: k8s.io/api/core/v1.PodStatus
CoreV1PodsWatchEvent:
model: k8s.io/apimachinery/pkg/watch.Event
fields:
object:
resolver: true
# --- LogMetadata ---
LogMetadata:
model: github.com/kubetail-org/kubetail/modules/common/agentpb.LogMetadata
LogMetadataFileInfo:
model: github.com/kubetail-org/kubetail/modules/common/agentpb.LogMetadataFileInfo
LogMetadataList:
model: github.com/kubetail-org/kubetail/modules/common/agentpb.LogMetadataList
LogMetadataSpec:
model: github.com/kubetail-org/kubetail/modules/common/agentpb.LogMetadataSpec
LogMetadataWatchEvent:
model: github.com/kubetail-org/kubetail/modules/common/agentpb.LogMetadataWatchEvent
# --- MetaV1 ---
MetaV1GetOptions:
model: k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions
MetaV1LabelSelector:
model: k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector
MetaV1LabelSelectorRequirement:
model: k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement
MetaV1LabelSelectorOperator:
model: k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorOperator
MetaV1ListMeta:
model: k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta
MetaV1ListOptions:
model: k8s.io/apimachinery/pkg/apis/meta/v1.ListOptions
MetaV1ObjectMeta:
model: k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta
MetaV1OwnerReference:
model: k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference
MetaV1ResourceVersionMatch:
model: k8s.io/apimachinery/pkg/apis/meta/v1.ResourceVersionMatch
# --- Watch ---
WatchEventType:
model: k8s.io/apimachinery/pkg/watch.EventType
# --- custom scalars ---
Int64:
model: github.com/kubetail-org/kubetail/modules/server/graph/model.Int64
MetaV1Time:
model:
- github.com/kubetail-org/kubetail/modules/server/graph/model.MetaV1Time
StringMap:
model: github.com/kubetail-org/kubetail/modules/server/graph/model.StringMap
TimestampPBTimestamp:
model:
- github.com/kubetail-org/kubetail/modules/server/graph/model.TimestampPBTimestamp
# --- gqlgen ---
ID:
model:
- github.com/99designs/gqlgen/graphql.ID
- github.com/99designs/gqlgen/graphql.Int
- github.com/99designs/gqlgen/graphql.Int64
- github.com/99designs/gqlgen/graphql.Int32
- k8s.io/apimachinery/pkg/types.UID
Int:
model:
- github.com/99designs/gqlgen/graphql.Int
- github.com/99designs/gqlgen/graphql.Int64
- github.com/99designs/gqlgen/graphql.Int32