-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgqlgen.yaml
115 lines (98 loc) · 3.94 KB
/
gqlgen.yaml
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
# Where are all the schema files located? globs are supported eg src/**/*.graphqls
schema:
- internal/graph/schema/*.graphqls
# Where should the generated server code go?
exec:
filename: internal/graph/gengql/generated.go
package: gengql
# Where should any generated models go?
model:
filename: internal/graph/model/donotuse/models_gen.go
package: donotuse
# Where should the resolver implementations go?
resolver:
layout: follow-schema
dir: internal/graph
package: graph
omit_template_comment: true
# Omit Query / Mutation models
omit_root_models: 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/99designs/gqlgen/graphql/introspection" # Without this line in the beginning, a `prelude.resolver.go` is generated
- "github.com/nais/api/internal/activitylog"
- "github.com/nais/api/internal/auth/authz"
- "github.com/nais/api/internal/cost"
- "github.com/nais/api/internal/deployment"
- "github.com/nais/api/internal/environment"
- "github.com/nais/api/internal/feature"
- "github.com/nais/api/internal/github/repository"
- "github.com/nais/api/internal/graph/model"
- "github.com/nais/api/internal/persistence"
- "github.com/nais/api/internal/persistence/bigquery"
- "github.com/nais/api/internal/persistence/bucket"
- "github.com/nais/api/internal/persistence/kafkatopic"
- "github.com/nais/api/internal/persistence/opensearch"
- "github.com/nais/api/internal/persistence/redis"
- "github.com/nais/api/internal/persistence/sqlinstance"
- "github.com/nais/api/internal/persistence/valkey"
- "github.com/nais/api/internal/reconciler"
- "github.com/nais/api/internal/search"
- "github.com/nais/api/internal/serviceaccount"
- "github.com/nais/api/internal/status"
- "github.com/nais/api/internal/team"
- "github.com/nais/api/internal/unleash"
- "github.com/nais/api/internal/user"
- "github.com/nais/api/internal/usersync"
- "github.com/nais/api/internal/utilization"
- "github.com/nais/api/internal/vulnerability"
- "github.com/nais/api/internal/workload"
- "github.com/nais/api/internal/workload/application"
- "github.com/nais/api/internal/workload/job"
- "github.com/nais/api/internal/workload/logging"
- "github.com/nais/api/internal/workload/netpol"
- "github.com/nais/api/internal/workload/podlog"
- "github.com/nais/api/internal/workload/secret"
# Don't generate Get<FieldName> functions for fields included in the GraphQL interfaces
omit_getters: true
# Optional: turn on to not generate any file notice comments in generated files
omit_gqlgen_file_notice: true
# Setting this to false will generate type instances for required struct fields, and type pointers for optional fields
struct_fields_always_pointers: true
# Because we're using gofumpt, and in general run our code often enough, we can disable building and running go mod tidy during gqlgen generate
# This will speed up the generation process
skip_mod_tidy: true
skip_validation: true
# 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/nais/api/internal/graph/ident.Ident
UUID:
model:
- github.com/99designs/gqlgen/graphql.UUID
Int:
model:
- github.com/99designs/gqlgen/graphql.Int
- github.com/99designs/gqlgen/graphql.Int64
- github.com/99designs/gqlgen/graphql.Int32
Date:
model:
- github.com/nais/api/internal/graph/scalar.Date
Time:
model:
- github.com/nais/api/internal/graph/scalar.Time
Slug:
model:
- github.com/nais/api/internal/slug.Slug
Cursor:
model:
- github.com/nais/api/internal/graph/pagination.Cursor
PageInfo:
model:
- github.com/nais/api/internal/graph/pagination.PageInfo