Add support for mapping all nullable types as pointers (#198)
This implements the approach suggested in https://github.com/Khan/genqlient/issues/178#issuecomment-1077559343. See the added documentation for the full behavior.
This commit is contained in:
+1
-1
@@ -256,7 +256,7 @@ func (g *generator) convertType(
|
||||
oe := true
|
||||
options.Omitempty = &oe
|
||||
}
|
||||
} else if options.GetPointer() {
|
||||
} else if options.GetPointer() || (!typ.NonNull && g.Config.Optional == "pointer") {
|
||||
// Whatever we get, wrap it in a pointer. (Because of the way the
|
||||
// options work, recursing here isn't as connvenient.)
|
||||
// Note this does []*T or [][]*T, not e.g. *[][]T. See #16.
|
||||
|
||||
Reference in New Issue
Block a user