From 1d71fffcb6c6c63a779f7adc559ea52204d5e029 Mon Sep 17 00:00:00 2001 From: Ben Kraft Date: Sun, 23 Oct 2022 21:20:10 -0700 Subject: [PATCH] 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). --- docs/genqlient.yaml | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/docs/genqlient.yaml b/docs/genqlient.yaml index 11fb187..3ffa2e3 100644 --- a/docs/genqlient.yaml +++ b/docs/genqlient.yaml @@ -97,21 +97,19 @@ use_struct_references: boolean # Defaults to false. use_extensions: boolean -# Customize how optional fields are handled. -optional: - # Customize how models are generated for optional fields. This can currently - # be set to one of the following values: - # - value (default): optional fields are generated as values, the same as - # non-optional fields. E.g. fields with GraphQL types `String` or `String!` - # will both map to the Go type `string`. When values are absent in - # responses the zero value will be used. - # - pointer: optional fields are generated as pointers. E.g. fields with - # GraphQL type `String` will map to the Go type `*string`. When values are - # absent in responses `nil` will be used. Optional list fields do not use - # pointers-to-slices, so the GraphQL type `[String]` will map to the Go - # type `[]*string`, not `*[]*string`; GraphQL null and empty list simply - # map to Go nil- and empty-slice. - output: value +# Customize how models are generated for optional fields. This can currently +# be set to one of the following values: +# - value (default): optional fields are generated as values, the same as +# non-optional fields. E.g. fields with GraphQL types `String` or `String!` +# will both map to the Go type `string`. When values are absent in +# responses the zero value will be used. +# - pointer: optional fields are generated as pointers. E.g. fields with +# GraphQL type `String` will map to the Go type `*string`. When values are +# absent in responses `nil` will be used. Optional list fields do not use +# pointers-to-slices, so the GraphQL type `[String]` will map to the Go +# type `[]*string`, not `*[]*string`; GraphQL null and empty list simply +# map to Go nil- and empty-slice. +optional: value # A map from GraphQL type name to Go fully-qualified type name to override # the Go type genqlient will use for this GraphQL type.