aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/99designs/gqlgen/codegen/input.gotpl
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/99designs/gqlgen/codegen/input.gotpl')
-rw-r--r--vendor/github.com/99designs/gqlgen/codegen/input.gotpl4
1 files changed, 4 insertions, 0 deletions
diff --git a/vendor/github.com/99designs/gqlgen/codegen/input.gotpl b/vendor/github.com/99designs/gqlgen/codegen/input.gotpl
index b51d53a2..bdf3622c 100644
--- a/vendor/github.com/99designs/gqlgen/codegen/input.gotpl
+++ b/vendor/github.com/99designs/gqlgen/codegen/input.gotpl
@@ -25,6 +25,10 @@
}
if data, ok := tmp.({{ $field.TypeReference.GO | ref }}) ; ok {
it.{{$field.GoFieldName}} = data
+ {{- if $field.TypeReference.IsNilable }}
+ } else if tmp == nil {
+ it.{{$field.GoFieldName}} = nil
+ {{- end }}
} else {
return it, fmt.Errorf(`unexpected type %T from directive, should be {{ $field.TypeReference.GO }}`, tmp)
}