aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/99designs/gqlgen/codegen/type.gotpl
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-05-15 18:20:54 +0200
committerGitHub <noreply@github.com>2019-05-15 18:20:54 +0200
commit22f435bd2a8fc35bde96eafb50b3f78650a5983b (patch)
tree629b72f3d95ac7b7806fb83096a3b89e14f745ef /vendor/github.com/99designs/gqlgen/codegen/type.gotpl
parent97476ff5fadaf0a457d0f0133db58415b6075940 (diff)
parent8bab279114f06f10e22435b0caf9002201831555 (diff)
downloadgit-bug-22f435bd2a8fc35bde96eafb50b3f78650a5983b.tar.gz
Merge pull request #134 from A-Hilaly/gqlgen
Upgrade gqlgen version to v0.9.0
Diffstat (limited to 'vendor/github.com/99designs/gqlgen/codegen/type.gotpl')
-rw-r--r--vendor/github.com/99designs/gqlgen/codegen/type.gotpl17
1 files changed, 8 insertions, 9 deletions
diff --git a/vendor/github.com/99designs/gqlgen/codegen/type.gotpl b/vendor/github.com/99designs/gqlgen/codegen/type.gotpl
index f727baac..cb2782c3 100644
--- a/vendor/github.com/99designs/gqlgen/codegen/type.gotpl
+++ b/vendor/github.com/99designs/gqlgen/codegen/type.gotpl
@@ -56,15 +56,6 @@
{{- end }}
return graphql.Null
}
- {{- else if $type.HasIsZero }}
- if v.IsZero() {
- {{- if $type.GQL.NonNull }}
- if !ec.HasError(graphql.GetResolverContext(ctx)) {
- ec.Errorf(ctx, "must not be null")
- }
- {{- end }}
- return graphql.Null
- }
{{- end }}
{{- if $type.IsSlice }}
@@ -119,6 +110,14 @@
{{- else if $type.Marshaler }}
{{- if $type.IsPtr }}
return ec.{{ $type.Elem.MarshalFunc }}(ctx, sel, *v)
+ {{- else if $type.GQL.NonNull }}
+ res := {{ $type.Marshaler | call }}({{- if $type.CastType }}{{ $type.CastType | ref }}(v){{else}}v{{- end }})
+ if res == graphql.Null {
+ if !ec.HasError(graphql.GetResolverContext(ctx)) {
+ ec.Errorf(ctx, "must not be null")
+ }
+ }
+ return res
{{- else }}
return {{ $type.Marshaler | call }}({{- if $type.CastType }}{{ $type.CastType | ref }}(v){{else}}v{{- end }})
{{- end }}