-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathgqlgen.schema.json
More file actions
385 lines (385 loc) · 13.4 KB
/
Copy pathgqlgen.schema.json
File metadata and controls
385 lines (385 loc) · 13.4 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
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
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "gqlgen Configuration",
"description": "Configuration file for gqlgen code generation",
"type": "object",
"properties": {
"schema": {
"description": "Where are all the schema files located? globs are supported",
"type": "array",
"items": {
"type": "string"
}
},
"exec": {
"description": "Where should the generated server code go?",
"type": "object",
"properties": {
"filename": {
"type": "string",
"description": "Path to the generated file (required for single-file layout)"
},
"package": {
"type": "string",
"description": "The go package name"
},
"layout": {
"type": "string",
"enum": ["single-file", "follow-schema"],
"default": "single-file"
},
"dir": {
"type": "string",
"description": "Directory for generated files (required for follow-schema layout)"
},
"filename_template": {
"type": "string",
"default": "{name}.generated.go",
"description": "Template for filenames (required for follow-schema layout)"
},
"worker_limit": {
"type": "integer",
"description": "Maximum number of goroutines in concurrency to use per child resolvers",
"default": 1000
}
}
},
"federation": {
"description": "Federation configuration",
"type": "object",
"properties": {
"filename": { "type": "string" },
"package": { "type": "string" },
"version": { "type": "integer" },
"options": {
"type": "object",
"properties": {
"explicit_requires": {
"type": "boolean",
"description": "Generate a function in the execution context to populate fields using the @requires directive into the entity. Cannot be used together with computed_requires.",
"default": false
},
"computed_requires": {
"type": "boolean",
"description": "Generate resolver functions to compute values for fields using the @requires directive. Requires federation version 2 and call_argument_directives_with_null to be true. Cannot be used together with explicit_requires.",
"default": false
},
"entity_resolver_multi": {
"type": "boolean",
"description": "Default engine for entityResolver generation. Can be overridden per entity with @entityResolver(multi: Boolean) directive.",
"default": false
}
}
},
"model_template": { "type": "string" }
}
},
"model": {
"description": "Where should any generated models go?",
"type": "object",
"properties": {
"filename": { "type": "string" },
"package": { "type": "string" },
"model_template": { "type": "string" },
"version": { "type": "integer" },
"options": {
"type": "object",
"additionalProperties": { "type": "boolean" }
}
}
},
"resolver": {
"description": "Where should the resolver implementations go?",
"type": "object",
"properties": {
"layout": {
"type": "string",
"enum": ["single-file", "follow-schema"],
"default": "follow-schema"
},
"package": { "type": "string" },
"dir": { "type": "string" },
"filename": { "type": "string" },
"filename_template": {
"type": "string",
"default": "{name}.resolvers.go"
},
"omit_template_comment": { "type": "boolean" },
"resolver_template": { "type": "string" },
"preserve_resolver": { "type": "boolean" },
"batch": {
"description": "Enable batch resolver generation for all fields as if they had @goField(batch: true). Individual fields can opt out with @goField(batch: false).",
"oneOf": [
{ "type": "boolean" },
{
"type": "object",
"properties": {
"enabled": { "type": "boolean", "default": false }
}
}
]
},
"type": {
"type": "string",
"description": "The name of the resolver struct type",
"default": "Resolver"
}
}
},
"autobind": {
"description": "gqlgen will search for any type names in the schema in these go packages",
"type": "array",
"items": { "type": "string" }
},
"autobind_getter_haser": {
"description": "Enable getter/haser methods for autobind",
"type": "boolean",
"default": false
},
"models": {
"description": "Type mapping between the GraphQL and go type systems",
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"model": {
"type": "array",
"items": { "type": "string" }
},
"forceGenerate": {
"type": "boolean",
"description": "Force generation of this type even if it is mapped to a model"
},
"fields": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "Go type for this field"
},
"resolver": { "type": "boolean" },
"fieldName": { "type": "string" },
"omittable": {
"type": "boolean",
"description": "Wrap this field with Omittable"
},
"autoBindGetterHaser": {
"type": "boolean",
"description": "Enable getter/haser auto-binding for this field"
},
"batch": {
"type": "boolean",
"description": "Enable batch resolver generation for this field to reduce N+1 queries"
},
"forceGenerate": {
"type": "boolean",
"description": "Force generate this field in the model even when OmitResolverFields is enabled"
}
}
}
},
"enum_values": {
"type": "object",
"description": "Custom enum value mappings",
"additionalProperties": {
"type": "object"
}
},
"extraFields": {
"type": "object",
"description": "Additional named fields to add to the generated model",
"additionalProperties": {
"type": "object",
"properties": {
"type": { "type": "string", "description": "Go type of the extra field" },
"overrideTags": { "type": "string", "description": "Override the Go struct tag" },
"description": { "type": "string", "description": "Go doc-comment for the field" }
}
}
},
"embedExtraFields": {
"type": "array",
"description": "Embeddable extra fields to add to the generated model",
"items": {
"type": "object",
"properties": {
"type": { "type": "string", "description": "Go type of the extra field" },
"overrideTags": { "type": "string", "description": "Override the Go struct tag" },
"description": { "type": "string", "description": "Go doc-comment for the field" }
}
}
}
}
}
},
"struct_tag": {
"description": "Tag to use for model fields (e.g. json)",
"type": "string",
"default": "json"
},
"embedded_structs_prefix": {
"description": "Prefix for embedded structs",
"type": "string",
"default": "Base"
},
"directives": {
"description": "Custom directive configuration",
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"skip_runtime": {
"type": "boolean",
"description": "Skip runtime directive hook generation"
},
"implementation": {
"type": "string",
"description": "Static implementation function for the directive"
}
}
}
},
"local_prefix": {
"description": "Local package prefix for import sorting",
"type": "string"
},
"omit_slice_element_pointers": {
"description": "Turn on to use []Thing instead of []*Thing",
"type": "boolean",
"default": false
},
"omit_getters": {
"description": "Turn on to omit getter methods on models",
"type": "boolean",
"default": false
},
"omit_interface_checks": {
"description": "Turn on to omit Is<Name>() methods to interface and unions",
"type": "boolean",
"default": true
},
"omit_complexity": {
"description": "Turn on to skip generation of ComplexityRoot struct content and Complexity function",
"type": "boolean",
"default": false
},
"omit_gqlgen_file_notice": {
"description": "Turn on to not generate any file notice comments in generated files",
"type": "boolean",
"default": false
},
"omit_gqlgen_version_in_file_notice": {
"description": "Turn on to exclude the gqlgen version in the generated file notice",
"type": "boolean",
"default": false
},
"omit_root_models": {
"description": "Turn on to exclude root models such as Query and Mutation from the generated models file",
"type": "boolean",
"default": false
},
"omit_resolver_fields": {
"description": "Turn on to exclude resolver fields from the generated models file",
"type": "boolean",
"default": false
},
"omit_panic_handler": {
"description": "Turn on to omit panic handler in the generated server",
"type": "boolean",
"default": false
},
"omit_enum_json_marshalers": {
"description": "Turn on to omit JSON marshaler/unmarshaler generation for enums",
"type": "boolean",
"default": false
},
"struct_fields_always_pointers": {
"description": "Turn off to make struct-type struct fields not use pointers",
"type": "boolean",
"default": true
},
"resolvers_always_return_pointers": {
"description": "Turn off to make resolvers return values instead of pointers for structs",
"type": "boolean",
"default": true
},
"return_pointers_in_unmarshalinput": {
"description": "Turn on to return pointers instead of values in unmarshalInput",
"type": "boolean",
"default": false
},
"nullable_input_omittable": {
"description": "Wrap nullable input fields with Omittable",
"type": "boolean",
"default": true
},
"enable_model_json_omitempty_tag": {
"description": "Enable adding omitempty to the json tag of generated model fields",
"type": "boolean",
"default": false
},
"enable_model_json_omitzero_tag": {
"description": "Enable adding omitzero to the json tag of generated model fields",
"type": "boolean",
"default": false
},
"skip_validation": {
"description": "Set to speed up generation time by not performing a final validation pass",
"type": "boolean",
"default": false
},
"skip_mod_tidy": {
"description": "Set to skip running 'go mod tidy' when generating server code",
"type": "boolean",
"default": false
},
"fast_validation": {
"description": "Use -gcflags=\"-N -l\" during validation to disable compiler optimizations for faster cold cache builds",
"type": "boolean",
"default": false
},
"skip_import_grouping": {
"description": "Use go/format.Source instead of imports.Process for formatting (faster but no import grouping)",
"type": "boolean",
"default": false
},
"use_buffer_pooling": {
"description": "Reuse byte buffers via sync.Pool during code formatting to reduce GC pressure",
"type": "boolean",
"default": false
},
"call_argument_directives_with_null": {
"description": "Argument directives decorating a field with a null value will still be called",
"type": "boolean",
"default": true
},
"use_function_syntax_for_execution_context": {
"description": "Use function syntax for execution context instead of receiver methods",
"type": "boolean",
"default": false
},
"subscription_context_field": {
"description": "Enable subscription context propagation for every subscription field. When enabled, subscription resolvers return (<-chan graphql.Event[T], error) instead of (<-chan T, error), matching the behavior of @subscriptionContext without annotating each field.",
"type": "boolean",
"default": false
},
"go_build_tags": {
"description": "Set build tags that will be used to load packages",
"type": "array",
"items": { "type": "string" }
},
"go_initialisms": {
"description": "Set to modify the initialisms regarded for Go names",
"type": "object",
"properties": {
"replace_defaults": { "type": "boolean" },
"initialisms": {
"type": "array",
"items": { "type": "string" }
}
}
}
}
}