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.gotpl48
1 files changed, 0 insertions, 48 deletions
diff --git a/vendor/github.com/99designs/gqlgen/codegen/input.gotpl b/vendor/github.com/99designs/gqlgen/codegen/input.gotpl
deleted file mode 100644
index bdf3622c..00000000
--- a/vendor/github.com/99designs/gqlgen/codegen/input.gotpl
+++ /dev/null
@@ -1,48 +0,0 @@
-{{- range $input := .Inputs }}
- {{- if not .HasUnmarshal }}
- func (ec *executionContext) unmarshalInput{{ .Name }}(ctx context.Context, obj interface{}) ({{.Type | ref}}, error) {
- var it {{.Type | ref}}
- var asMap = obj.(map[string]interface{})
- {{ range $field := .Fields}}
- {{- if $field.Default}}
- if _, present := asMap[{{$field.Name|quote}}] ; !present {
- asMap[{{$field.Name|quote}}] = {{ $field.Default | dump }}
- }
- {{- end}}
- {{- end }}
-
- for k, v := range asMap {
- switch k {
- {{- range $field := .Fields }}
- case {{$field.Name|quote}}:
- var err error
- {{- if $field.ImplDirectives }}
- directive0 := func(ctx context.Context) (interface{}, error) { return ec.{{ $field.TypeReference.UnmarshalFunc }}(ctx, v) }
- {{ template "implDirectives" $field }}
- tmp, err := directive{{$field.ImplDirectives|len}}(ctx)
- if err != nil {
- return it, err
- }
- 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)
- }
- {{- else }}
- it.{{$field.GoFieldName}}, err = ec.{{ $field.TypeReference.UnmarshalFunc }}(ctx, v)
- if err != nil {
- return it, err
- }
- {{- end }}
- {{- end }}
- }
- }
-
- return it, nil
- }
- {{- end }}
-{{ end }}