Skip to content

Commit

Permalink
check nullable value for go1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
asamusev committed Dec 5, 2018
1 parent d586bb6 commit b32ebe1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
7 changes: 2 additions & 5 deletions codegen/templates/args.gotpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@
{{- range $directive := $arg.Directives }}
func(ctx context.Context, n graphql.Resolver) (res interface{}, err error) {
{{- range $dArg := $directive.Args }}
{{- if $dArg.IsPtr }}
{{- $argValue := $dArg.Value | dump -}}
{{- if not (eq $argValue "nil") }}
{{ $dArg.GoVarName }} := {{ $argValue }}
{{- end }}
{{- if and $dArg.IsPtr ( notNil "Value" $dArg ) }}
{{ $dArg.GoVarName }} := {{ $dArg.Value | dump }}
{{- end }}
{{- end }}
return e.directives.{{$directive.Name|ucFirst}}({{$directive.ResolveArgs "tmp" "n" }})
Expand Down
Loading

0 comments on commit b32ebe1

Please sign in to comment.