add option to force using a pointer

This commit is contained in:
Ben Kraft
2021-04-12 16:01:21 -07:00
parent 74411faf52
commit e597cac74c
14 changed files with 351 additions and 65 deletions
+4 -2
View File
@@ -24,11 +24,13 @@ func {{.Name}}(
{{- if .Args -}}
variables := map[string]interface{}{
{{range .Args -}}
"{{.GraphQLName}}": {{if .Omitempty}}nil{{else}}{{.GoName}}{{end}},
{{if not .Options.GetOmitempty -}}
"{{.GraphQLName}}": {{.GoName}},
{{end -}}
{{end}}
}
{{range .Args -}}
{{if .Omitempty -}}
{{if .Options.GetOmitempty -}}
{{/* zero_{{.GoType}} would be a better name, but {{.GoType}} would require
munging since it might be, say, `time.Time`. */}}
var zero_{{.GoName}} {{.GoType}}