From 1d4bb7ceb0cef79d68df0bacc913b01e40e6ddd6 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Wed, 5 Feb 2020 22:03:19 +0100 Subject: migrate to go modules --- .../99designs/gqlgen/codegen/input.gotpl | 48 ---------------------- 1 file changed, 48 deletions(-) delete mode 100644 vendor/github.com/99designs/gqlgen/codegen/input.gotpl (limited to 'vendor/github.com/99designs/gqlgen/codegen/input.gotpl') 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 }} -- cgit