-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathgqlgen.yml
75 lines (68 loc) · 2.69 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
# Where are all the schema files located? globs are supported eg src/**/*.graphqls
schema:
- schema/*.gql
# Where should the generated server code go?
exec:
filename: internal/graph/generated/generated.go
package: generated
# Where should any generated models go?
model:
filename: internal/graph/model/generated.go
package: model
# gqlgen by defaut generates getter methods for interfaces and types that
# implement it.
omit_getters: true
# The following three stanzas configure resolver and model code to use structs
# instead of struct pointers for all required fields. This enforces schema
# constraints at compile time, and makes for a better experience in editor
# tooling.
# Use []Thing instead of []*Thing.
omit_slice_element_pointers: true
# Use type Thing struct { FieldA OtherThing } instead of { FieldA *OtherThing }.
struct_fields_always_pointers: false
# Make generated resolvers return Thing instead of *Thing.
# Use type Resolver interface { Resolve(...) (ValueA, error) } instead of
# { Resolve(...) (*ValueA, error) }
resolvers_always_return_pointers: false
# 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/upbound/xgql/internal/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:
ID:
model:
- github.com/upbound/xgql/internal/graph/model.ReferenceID
StringMap:
model:
- github.com/upbound/xgql/internal/graph/model.StringMap
JSON:
model:
- github.com/upbound/xgql/internal/graph/model.JSON
Int:
model:
- github.com/99designs/gqlgen/graphql.Int
- github.com/99designs/gqlgen/graphql.Int64
- github.com/99designs/gqlgen/graphql.Int32
# Below we define additional fields to be added to the generated models.
# These fields are not part of the GraphQL schema, but are used to resolve
# fields that are part of the schema.
ProviderRevisionStatus:
extraFields:
# Used to resolve ProviderRevisionStatus.objects field.
ObjectRefs:
type: "[]github.com/crossplane/crossplane-runtime/apis/common/v1.TypedReference"
ConfigurationRevisionStatus:
extraFields:
# Used to resolve ConfigurationRevisionStatus.objects field.
ObjectRefs:
type: "[]github.com/crossplane/crossplane-runtime/apis/common/v1.TypedReference"
Event:
extraFields:
# Used to resolve Event.involvedObject field.
InvolvedObjectRef:
type: "k8s.io/api/core/v1.ObjectReference"