Skip to content

Commit 1d71fff

Browse files
Fix documentation for optional: value (#229)
A couple people noticed the documentation didn't match the actual option syntax we settled on. Now it does. Fixes #226, replaces #222 (closed due to CLA issues).
1 parent 85e2e8d commit 1d71fff

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

docs/genqlient.yaml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,19 @@ use_struct_references: boolean
9797
# Defaults to false.
9898
use_extensions: boolean
9999

100-
# Customize how optional fields are handled.
101-
optional:
102-
# Customize how models are generated for optional fields. This can currently
103-
# be set to one of the following values:
104-
# - value (default): optional fields are generated as values, the same as
105-
# non-optional fields. E.g. fields with GraphQL types `String` or `String!`
106-
# will both map to the Go type `string`. When values are absent in
107-
# responses the zero value will be used.
108-
# - pointer: optional fields are generated as pointers. E.g. fields with
109-
# GraphQL type `String` will map to the Go type `*string`. When values are
110-
# absent in responses `nil` will be used. Optional list fields do not use
111-
# pointers-to-slices, so the GraphQL type `[String]` will map to the Go
112-
# type `[]*string`, not `*[]*string`; GraphQL null and empty list simply
113-
# map to Go nil- and empty-slice.
114-
output: value
100+
# Customize how models are generated for optional fields. This can currently
101+
# be set to one of the following values:
102+
# - value (default): optional fields are generated as values, the same as
103+
# non-optional fields. E.g. fields with GraphQL types `String` or `String!`
104+
# will both map to the Go type `string`. When values are absent in
105+
# responses the zero value will be used.
106+
# - pointer: optional fields are generated as pointers. E.g. fields with
107+
# GraphQL type `String` will map to the Go type `*string`. When values are
108+
# absent in responses `nil` will be used. Optional list fields do not use
109+
# pointers-to-slices, so the GraphQL type `[String]` will map to the Go
110+
# type `[]*string`, not `*[]*string`; GraphQL null and empty list simply
111+
# map to Go nil- and empty-slice.
112+
optional: value
115113

116114
# A map from GraphQL type name to Go fully-qualified type name to override
117115
# the Go type genqlient will use for this GraphQL type.

0 commit comments

Comments
 (0)