mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 18:23:08 +03:00
31 lines
759 B
Plaintext
31 lines
759 B
Plaintext
{{- if . }}args := map[string]interface{}{} {{end}}
|
|
{{- range $i, $arg := . }}
|
|
var arg{{$i}} {{$arg.Signature }}
|
|
if tmp, ok := field.Args[{{$arg.GQLName|quote}}]; ok {
|
|
var err error
|
|
{{$arg.Unmarshal (print "arg" $i) "tmp" }}
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
{{- if $arg.Object.Stream }}
|
|
return nil
|
|
{{- else }}
|
|
return graphql.Null
|
|
{{- end }}
|
|
}
|
|
} {{ if $arg.Default }} else {
|
|
var tmp interface{} = {{ $arg.Default | dump }}
|
|
var err error
|
|
{{$arg.Unmarshal (print "arg" $i) "tmp" }}
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
{{- if $arg.Object.Stream }}
|
|
return nil
|
|
{{- else }}
|
|
return graphql.Null
|
|
{{- end }}
|
|
}
|
|
}
|
|
{{end }}
|
|
args[{{$arg.GQLName|quote}}] = arg{{$i}}
|
|
{{- end -}}
|