From dd162f04051c034bfae7c8fb3732975dec449586 Mon Sep 17 00:00:00 2001 From: asamusev Date: Tue, 25 Jun 2019 07:09:47 +0300 Subject: [PATCH] define implDirectives template --- codegen/args.gotpl | 22 +- codegen/directives.gotpl | 13 ++ codegen/input.gotpl | 22 +- codegen/testserver/generated.go | 242 ++++++++++----------- example/chat/generated.go | 32 +-- example/config/generated.go | 20 +- example/dataloader/generated.go | 20 +- example/fileupload/generated.go | 32 +-- example/scalars/generated.go | 24 +- example/selection/generated.go | 12 +- example/starwars/generated/exec.go | 72 +++--- example/todo/generated.go | 38 ++-- example/type-system-extension/generated.go | 24 +- integration/generated.go | 32 +-- 14 files changed, 297 insertions(+), 308 deletions(-) diff --git a/codegen/args.gotpl b/codegen/args.gotpl index 4c7212182c..e7d30ef146 100644 --- a/codegen/args.gotpl +++ b/codegen/args.gotpl @@ -1,26 +1,14 @@ {{ range $name, $args := .Args }} -func (ec *executionContext) {{ $name }}(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) {{ $name }}(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} {{- range $i, $arg := . }} var arg{{$i}} {{ $arg.TypeReference.GO | ref}} - if tmp, ok := rawArgs[{{$arg.Name|quote}}]; ok { + if tmp, ok := in[{{$arg.Name|quote}}]; ok { {{- if $arg.Directives }} - getArg0 := func(ctx context.Context) (interface{}, error) { return ec.{{ $arg.TypeReference.UnmarshalFunc }}(ctx, tmp) } - - {{- range $i, $directive := $arg.Directives }} - getArg{{add $i 1}} := func(ctx context.Context) (res interface{}, err error) { - {{- range $dArg := $directive.Args }} - {{- if and $dArg.TypeReference.IsPtr ( notNil "Value" $dArg ) }} - {{ $dArg.VarName }} := {{ $dArg.Value | dump }} - {{- end }} - {{- end }} - n := getArg{{$i}} - return ec.directives.{{$directive.Name|ucFirst}}({{$directive.ResolveArgs "tmp" "n" }}) - } - {{- end }} - - tmp, err = getArg{{$arg.Directives|len}}(ctx) + directive0 := func(ctx context.Context) (interface{}, error) { return ec.{{ $arg.TypeReference.UnmarshalFunc }}(ctx, tmp) } + {{ template "implDirectives" $arg }} + tmp, err = directive{{$arg.Directives|len}}(ctx) if err != nil { return nil, err } diff --git a/codegen/directives.gotpl b/codegen/directives.gotpl index 1db2177a8e..9d8863a754 100644 --- a/codegen/directives.gotpl +++ b/codegen/directives.gotpl @@ -1,3 +1,16 @@ +{{ define "implDirectives" }} + {{- range $i, $directive := .Directives -}} + directive{{add $i 1}} := func(ctx context.Context) (interface{}, error) { + {{- range $arg := $directive.Args }} + {{- if and $arg.TypeReference.IsPtr ( notNil "Value" $arg ) }} + {{ $arg.VarName }} := {{ $arg.Value | dump }} + {{- end }} + {{- end }} + n := directive{{$i}} + return ec.directives.{{$directive.Name|ucFirst}}({{$directive.ResolveArgs "in" "n" }}) + } + {{- end }} +{{ end }} {{define "queryDirectives"}} for _, d := range obj.Directives { diff --git a/codegen/input.gotpl b/codegen/input.gotpl index c8ac7ad3a5..348037cc05 100644 --- a/codegen/input.gotpl +++ b/codegen/input.gotpl @@ -1,8 +1,8 @@ {{- range $input := .Inputs }} {{- if not .HasUnmarshal }} - func (ec *executionContext) unmarshalInput{{ .Name }}(ctx context.Context, v interface{}) ({{.Type | ref}}, error) { + func (ec *executionContext) unmarshalInput{{ .Name }}(ctx context.Context, in interface{}) ({{.Type | ref}}, error) { var it {{.Type | ref}} - var asMap = v.(map[string]interface{}) + var asMap = in.(map[string]interface{}) {{ range $field := .Fields}} {{- if $field.Default}} if _, present := asMap[{{$field.Name|quote}}] ; !present { @@ -17,21 +17,9 @@ case {{$field.Name|quote}}: var err error {{- if $field.Directives }} - getField0 := func(ctx context.Context) (interface{}, error) { return ec.{{ $field.TypeReference.UnmarshalFunc }}(ctx, v) } - - {{- range $i, $directive := $field.Directives }} - getField{{add $i 1}} := func(ctx context.Context) (res interface{}, err error) { - {{- range $dArg := $directive.Args }} - {{- if and $dArg.TypeReference.IsPtr ( notNil "Value" $dArg ) }} - {{ $dArg.VarName }} := {{ $dArg.Value | dump }} - {{- end }} - {{- end }} - n := getField{{$i}} - return ec.directives.{{$directive.Name|ucFirst}}({{$directive.ResolveArgs "it" "n" }}) - } - {{- end }} - - tmp, err := getField{{$field.Directives|len}}(ctx) + directive0 := func(ctx context.Context) (interface{}, error) { return ec.{{ $field.TypeReference.UnmarshalFunc }}(ctx, v) } + {{ template "implDirectives" $field }} + tmp, err := directive{{$field.Directives|len}}(ctx) if err != nil { return it, err } diff --git a/codegen/testserver/generated.go b/codegen/testserver/generated.go index 05f4db8055..0404a17ec5 100644 --- a/codegen/testserver/generated.go +++ b/codegen/testserver/generated.go @@ -1705,11 +1705,11 @@ scalar WrappedScalar // region ***************************** args.gotpl ***************************** -func (ec *executionContext) dir_length_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) dir_length_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 int - if tmp, ok := rawArgs["min"]; ok { + if tmp, ok := in["min"]; ok { arg0, err = ec.unmarshalNInt2int(ctx, tmp) if err != nil { return nil, err @@ -1717,7 +1717,7 @@ func (ec *executionContext) dir_length_args(ctx context.Context, rawArgs map[str } args["min"] = arg0 var arg1 *int - if tmp, ok := rawArgs["max"]; ok { + if tmp, ok := in["max"]; ok { arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) if err != nil { return nil, err @@ -1727,11 +1727,11 @@ func (ec *executionContext) dir_length_args(ctx context.Context, rawArgs map[str return args, nil } -func (ec *executionContext) dir_range_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) dir_range_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *int - if tmp, ok := rawArgs["min"]; ok { + if tmp, ok := in["min"]; ok { arg0, err = ec.unmarshalOInt2ᚖint(ctx, tmp) if err != nil { return nil, err @@ -1739,7 +1739,7 @@ func (ec *executionContext) dir_range_args(ctx context.Context, rawArgs map[stri } args["min"] = arg0 var arg1 *int - if tmp, ok := rawArgs["max"]; ok { + if tmp, ok := in["max"]; ok { arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) if err != nil { return nil, err @@ -1749,11 +1749,11 @@ func (ec *executionContext) dir_range_args(ctx context.Context, rawArgs map[stri return args, nil } -func (ec *executionContext) field_Panics_argUnmarshal_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Panics_argUnmarshal_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 []MarshalPanic - if tmp, ok := rawArgs["u"]; ok { + if tmp, ok := in["u"]; ok { arg0, err = ec.unmarshalNMarshalPanic2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐMarshalPanic(ctx, tmp) if err != nil { return nil, err @@ -1763,11 +1763,11 @@ func (ec *executionContext) field_Panics_argUnmarshal_args(ctx context.Context, return args, nil } -func (ec *executionContext) field_Panics_fieldFuncMarshal_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Panics_fieldFuncMarshal_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 []MarshalPanic - if tmp, ok := rawArgs["u"]; ok { + if tmp, ok := in["u"]; ok { arg0, err = ec.unmarshalNMarshalPanic2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐMarshalPanic(ctx, tmp) if err != nil { return nil, err @@ -1777,11 +1777,11 @@ func (ec *executionContext) field_Panics_fieldFuncMarshal_args(ctx context.Conte return args, nil } -func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query___type_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["name"]; ok { + if tmp, ok := in["name"]; ok { arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -1791,11 +1791,11 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs return args, nil } -func (ec *executionContext) field_Query_defaultScalar_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_defaultScalar_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["arg"]; ok { + if tmp, ok := in["arg"]; ok { arg0, err = ec.unmarshalNDefaultScalarImplementation2string(ctx, tmp) if err != nil { return nil, err @@ -1805,19 +1805,19 @@ func (ec *executionContext) field_Query_defaultScalar_args(ctx context.Context, return args, nil } -func (ec *executionContext) field_Query_directiveArg_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_directiveArg_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["arg"]; ok { - getArg0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalNString2string(ctx, tmp) } - getArg1 := func(ctx context.Context) (res interface{}, err error) { + if tmp, ok := in["arg"]; ok { + directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalNString2string(ctx, tmp) } + directive1 := func(ctx context.Context) (interface{}, error) { max := 255 - n := getArg0 - return ec.directives.Length(ctx, tmp, n, 1, &max) + n := directive0 + return ec.directives.Length(ctx, in, n, 1, &max) } - tmp, err = getArg1(ctx) + tmp, err = directive1(ctx) if err != nil { return nil, err } @@ -1831,11 +1831,11 @@ func (ec *executionContext) field_Query_directiveArg_args(ctx context.Context, r return args, nil } -func (ec *executionContext) field_Query_directiveInputNullable_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_directiveInputNullable_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *InputDirectives - if tmp, ok := rawArgs["arg"]; ok { + if tmp, ok := in["arg"]; ok { arg0, err = ec.unmarshalOInputDirectives2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInputDirectives(ctx, tmp) if err != nil { return nil, err @@ -1845,20 +1845,20 @@ func (ec *executionContext) field_Query_directiveInputNullable_args(ctx context. return args, nil } -func (ec *executionContext) field_Query_directiveInputType_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_directiveInputType_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 InnerInput - if tmp, ok := rawArgs["arg"]; ok { - getArg0 := func(ctx context.Context) (interface{}, error) { + if tmp, ok := in["arg"]; ok { + directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalNInnerInput2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInnerInput(ctx, tmp) } - getArg1 := func(ctx context.Context) (res interface{}, err error) { - n := getArg0 - return ec.directives.Custom(ctx, tmp, n) + directive1 := func(ctx context.Context) (interface{}, error) { + n := directive0 + return ec.directives.Custom(ctx, in, n) } - tmp, err = getArg1(ctx) + tmp, err = directive1(ctx) if err != nil { return nil, err } @@ -1872,11 +1872,11 @@ func (ec *executionContext) field_Query_directiveInputType_args(ctx context.Cont return args, nil } -func (ec *executionContext) field_Query_directiveInput_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_directiveInput_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 InputDirectives - if tmp, ok := rawArgs["arg"]; ok { + if tmp, ok := in["arg"]; ok { arg0, err = ec.unmarshalNInputDirectives2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInputDirectives(ctx, tmp) if err != nil { return nil, err @@ -1886,19 +1886,19 @@ func (ec *executionContext) field_Query_directiveInput_args(ctx context.Context, return args, nil } -func (ec *executionContext) field_Query_directiveNullableArg_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_directiveNullableArg_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *int - if tmp, ok := rawArgs["arg"]; ok { - getArg0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOInt2ᚖint(ctx, tmp) } - getArg1 := func(ctx context.Context) (res interface{}, err error) { + if tmp, ok := in["arg"]; ok { + directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOInt2ᚖint(ctx, tmp) } + directive1 := func(ctx context.Context) (interface{}, error) { min := 0 - n := getArg0 - return ec.directives.Range(ctx, tmp, n, &min, nil) + n := directive0 + return ec.directives.Range(ctx, in, n, &min, nil) } - tmp, err = getArg1(ctx) + tmp, err = directive1(ctx) if err != nil { return nil, err } @@ -1910,15 +1910,15 @@ func (ec *executionContext) field_Query_directiveNullableArg_args(ctx context.Co } args["arg"] = arg0 var arg1 *int - if tmp, ok := rawArgs["arg2"]; ok { - getArg0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOInt2ᚖint(ctx, tmp) } - getArg1 := func(ctx context.Context) (res interface{}, err error) { + if tmp, ok := in["arg2"]; ok { + directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOInt2ᚖint(ctx, tmp) } + directive1 := func(ctx context.Context) (interface{}, error) { min := 0 - n := getArg0 - return ec.directives.Range(ctx, tmp, n, &min, nil) + n := directive0 + return ec.directives.Range(ctx, in, n, &min, nil) } - tmp, err = getArg1(ctx) + tmp, err = directive1(ctx) if err != nil { return nil, err } @@ -1932,11 +1932,11 @@ func (ec *executionContext) field_Query_directiveNullableArg_args(ctx context.Co return args, nil } -func (ec *executionContext) field_Query_fallback_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_fallback_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 FallbackToStringEncoding - if tmp, ok := rawArgs["arg"]; ok { + if tmp, ok := in["arg"]; ok { arg0, err = ec.unmarshalNFallbackToStringEncoding2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐFallbackToStringEncoding(ctx, tmp) if err != nil { return nil, err @@ -1946,11 +1946,11 @@ func (ec *executionContext) field_Query_fallback_args(ctx context.Context, rawAr return args, nil } -func (ec *executionContext) field_Query_inputSlice_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_inputSlice_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 []string - if tmp, ok := rawArgs["arg"]; ok { + if tmp, ok := in["arg"]; ok { arg0, err = ec.unmarshalNString2ᚕstring(ctx, tmp) if err != nil { return nil, err @@ -1960,11 +1960,11 @@ func (ec *executionContext) field_Query_inputSlice_args(ctx context.Context, raw return args, nil } -func (ec *executionContext) field_Query_mapInput_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_mapInput_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 map[string]interface{} - if tmp, ok := rawArgs["input"]; ok { + if tmp, ok := in["input"]; ok { arg0, err = ec.unmarshalOChanges2map(ctx, tmp) if err != nil { return nil, err @@ -1974,11 +1974,11 @@ func (ec *executionContext) field_Query_mapInput_args(ctx context.Context, rawAr return args, nil } -func (ec *executionContext) field_Query_mapStringInterface_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_mapStringInterface_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 map[string]interface{} - if tmp, ok := rawArgs["in"]; ok { + if tmp, ok := in["in"]; ok { arg0, err = ec.unmarshalOMapStringInterfaceInput2map(ctx, tmp) if err != nil { return nil, err @@ -1988,11 +1988,11 @@ func (ec *executionContext) field_Query_mapStringInterface_args(ctx context.Cont return args, nil } -func (ec *executionContext) field_Query_nestedInputs_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_nestedInputs_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 [][]*OuterInput - if tmp, ok := rawArgs["input"]; ok { + if tmp, ok := in["input"]; ok { arg0, err = ec.unmarshalOOuterInput2ᚕᚕᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐOuterInput(ctx, tmp) if err != nil { return nil, err @@ -2002,11 +2002,11 @@ func (ec *executionContext) field_Query_nestedInputs_args(ctx context.Context, r return args, nil } -func (ec *executionContext) field_Query_nullableArg_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_nullableArg_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *int - if tmp, ok := rawArgs["arg"]; ok { + if tmp, ok := in["arg"]; ok { arg0, err = ec.unmarshalOInt2ᚖint(ctx, tmp) if err != nil { return nil, err @@ -2016,11 +2016,11 @@ func (ec *executionContext) field_Query_nullableArg_args(ctx context.Context, ra return args, nil } -func (ec *executionContext) field_Query_recursive_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_recursive_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *RecursiveInputSlice - if tmp, ok := rawArgs["input"]; ok { + if tmp, ok := in["input"]; ok { arg0, err = ec.unmarshalORecursiveInputSlice2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐRecursiveInputSlice(ctx, tmp) if err != nil { return nil, err @@ -2030,11 +2030,11 @@ func (ec *executionContext) field_Query_recursive_args(ctx context.Context, rawA return args, nil } -func (ec *executionContext) field_Query_user_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_user_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 int - if tmp, ok := rawArgs["id"]; ok { + if tmp, ok := in["id"]; ok { arg0, err = ec.unmarshalNInt2int(ctx, tmp) if err != nil { return nil, err @@ -2044,11 +2044,11 @@ func (ec *executionContext) field_Query_user_args(ctx context.Context, rawArgs m return args, nil } -func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["break"]; ok { + if tmp, ok := in["break"]; ok { arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2056,7 +2056,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["break"] = arg0 var arg1 string - if tmp, ok := rawArgs["default"]; ok { + if tmp, ok := in["default"]; ok { arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2064,7 +2064,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["default"] = arg1 var arg2 string - if tmp, ok := rawArgs["func"]; ok { + if tmp, ok := in["func"]; ok { arg2, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2072,7 +2072,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["func"] = arg2 var arg3 string - if tmp, ok := rawArgs["interface"]; ok { + if tmp, ok := in["interface"]; ok { arg3, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2080,7 +2080,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["interface"] = arg3 var arg4 string - if tmp, ok := rawArgs["select"]; ok { + if tmp, ok := in["select"]; ok { arg4, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2088,7 +2088,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["select"] = arg4 var arg5 string - if tmp, ok := rawArgs["case"]; ok { + if tmp, ok := in["case"]; ok { arg5, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2096,7 +2096,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["case"] = arg5 var arg6 string - if tmp, ok := rawArgs["defer"]; ok { + if tmp, ok := in["defer"]; ok { arg6, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2104,7 +2104,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["defer"] = arg6 var arg7 string - if tmp, ok := rawArgs["go"]; ok { + if tmp, ok := in["go"]; ok { arg7, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2112,7 +2112,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["go"] = arg7 var arg8 string - if tmp, ok := rawArgs["map"]; ok { + if tmp, ok := in["map"]; ok { arg8, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2120,7 +2120,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["map"] = arg8 var arg9 string - if tmp, ok := rawArgs["struct"]; ok { + if tmp, ok := in["struct"]; ok { arg9, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2128,7 +2128,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["struct"] = arg9 var arg10 string - if tmp, ok := rawArgs["chan"]; ok { + if tmp, ok := in["chan"]; ok { arg10, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2136,7 +2136,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["chan"] = arg10 var arg11 string - if tmp, ok := rawArgs["else"]; ok { + if tmp, ok := in["else"]; ok { arg11, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2144,7 +2144,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["else"] = arg11 var arg12 string - if tmp, ok := rawArgs["goto"]; ok { + if tmp, ok := in["goto"]; ok { arg12, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2152,7 +2152,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["goto"] = arg12 var arg13 string - if tmp, ok := rawArgs["package"]; ok { + if tmp, ok := in["package"]; ok { arg13, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2160,7 +2160,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["package"] = arg13 var arg14 string - if tmp, ok := rawArgs["switch"]; ok { + if tmp, ok := in["switch"]; ok { arg14, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2168,7 +2168,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["switch"] = arg14 var arg15 string - if tmp, ok := rawArgs["const"]; ok { + if tmp, ok := in["const"]; ok { arg15, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2176,7 +2176,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["const"] = arg15 var arg16 string - if tmp, ok := rawArgs["fallthrough"]; ok { + if tmp, ok := in["fallthrough"]; ok { arg16, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2184,7 +2184,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["fallthrough"] = arg16 var arg17 string - if tmp, ok := rawArgs["if"]; ok { + if tmp, ok := in["if"]; ok { arg17, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2192,7 +2192,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["if"] = arg17 var arg18 string - if tmp, ok := rawArgs["range"]; ok { + if tmp, ok := in["range"]; ok { arg18, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2200,7 +2200,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["range"] = arg18 var arg19 string - if tmp, ok := rawArgs["type"]; ok { + if tmp, ok := in["type"]; ok { arg19, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2208,7 +2208,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["type"] = arg19 var arg20 string - if tmp, ok := rawArgs["continue"]; ok { + if tmp, ok := in["continue"]; ok { arg20, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2216,7 +2216,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["continue"] = arg20 var arg21 string - if tmp, ok := rawArgs["for"]; ok { + if tmp, ok := in["for"]; ok { arg21, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2224,7 +2224,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["for"] = arg21 var arg22 string - if tmp, ok := rawArgs["import"]; ok { + if tmp, ok := in["import"]; ok { arg22, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2232,7 +2232,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["import"] = arg22 var arg23 string - if tmp, ok := rawArgs["return"]; ok { + if tmp, ok := in["return"]; ok { arg23, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2240,7 +2240,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["return"] = arg23 var arg24 string - if tmp, ok := rawArgs["var"]; ok { + if tmp, ok := in["var"]; ok { arg24, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2248,7 +2248,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, } args["var"] = arg24 var arg25 string - if tmp, ok := rawArgs["_"]; ok { + if tmp, ok := in["_"]; ok { arg25, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2258,11 +2258,11 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, return args, nil } -func (ec *executionContext) field_ValidType_validInputKeywords_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_ValidType_validInputKeywords_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *ValidInput - if tmp, ok := rawArgs["input"]; ok { + if tmp, ok := in["input"]; ok { arg0, err = ec.unmarshalOValidInput2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐValidInput(ctx, tmp) if err != nil { return nil, err @@ -2272,11 +2272,11 @@ func (ec *executionContext) field_ValidType_validInputKeywords_args(ctx context. return args, nil } -func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -2286,11 +2286,11 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra return args, nil } -func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_fields_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -6136,21 +6136,21 @@ func (ec *executionContext) _iIt_id(ctx context.Context, field graphql.Collected // region **************************** input.gotpl ***************************** -func (ec *executionContext) unmarshalInputInnerDirectives(ctx context.Context, v interface{}) (InnerDirectives, error) { +func (ec *executionContext) unmarshalInputInnerDirectives(ctx context.Context, in interface{}) (InnerDirectives, error) { var it InnerDirectives - var asMap = v.(map[string]interface{}) + var asMap = in.(map[string]interface{}) for k, v := range asMap { switch k { case "message": var err error - getField0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalNString2string(ctx, v) } - getField1 := func(ctx context.Context) (res interface{}, err error) { - n := getField0 - return ec.directives.Length(ctx, it, n, 1, nil) + directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalNString2string(ctx, v) } + directive1 := func(ctx context.Context) (interface{}, error) { + n := directive0 + return ec.directives.Length(ctx, in, n, 1, nil) } - tmp, err := getField1(ctx) + tmp, err := directive1(ctx) if err != nil { return it, err } @@ -6165,9 +6165,9 @@ func (ec *executionContext) unmarshalInputInnerDirectives(ctx context.Context, v return it, nil } -func (ec *executionContext) unmarshalInputInnerInput(ctx context.Context, v interface{}) (InnerInput, error) { +func (ec *executionContext) unmarshalInputInnerInput(ctx context.Context, in interface{}) (InnerInput, error) { var it InnerInput - var asMap = v.(map[string]interface{}) + var asMap = in.(map[string]interface{}) for k, v := range asMap { switch k { @@ -6183,22 +6183,22 @@ func (ec *executionContext) unmarshalInputInnerInput(ctx context.Context, v inte return it, nil } -func (ec *executionContext) unmarshalInputInputDirectives(ctx context.Context, v interface{}) (InputDirectives, error) { +func (ec *executionContext) unmarshalInputInputDirectives(ctx context.Context, in interface{}) (InputDirectives, error) { var it InputDirectives - var asMap = v.(map[string]interface{}) + var asMap = in.(map[string]interface{}) for k, v := range asMap { switch k { case "text": var err error - getField0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalNString2string(ctx, v) } - getField1 := func(ctx context.Context) (res interface{}, err error) { + directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalNString2string(ctx, v) } + directive1 := func(ctx context.Context) (interface{}, error) { max := 7 - n := getField0 - return ec.directives.Length(ctx, it, n, 0, &max) + n := directive0 + return ec.directives.Length(ctx, in, n, 0, &max) } - tmp, err := getField1(ctx) + tmp, err := directive1(ctx) if err != nil { return it, err } @@ -6221,16 +6221,16 @@ func (ec *executionContext) unmarshalInputInputDirectives(ctx context.Context, v } case "thirdParty": var err error - getField0 := func(ctx context.Context) (interface{}, error) { + directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOThirdParty2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐThirdParty(ctx, v) } - getField1 := func(ctx context.Context) (res interface{}, err error) { + directive1 := func(ctx context.Context) (interface{}, error) { max := 7 - n := getField0 - return ec.directives.Length(ctx, it, n, 0, &max) + n := directive0 + return ec.directives.Length(ctx, in, n, 0, &max) } - tmp, err := getField1(ctx) + tmp, err := directive1(ctx) if err != nil { return it, err } @@ -6245,9 +6245,9 @@ func (ec *executionContext) unmarshalInputInputDirectives(ctx context.Context, v return it, nil } -func (ec *executionContext) unmarshalInputOuterInput(ctx context.Context, v interface{}) (OuterInput, error) { +func (ec *executionContext) unmarshalInputOuterInput(ctx context.Context, in interface{}) (OuterInput, error) { var it OuterInput - var asMap = v.(map[string]interface{}) + var asMap = in.(map[string]interface{}) for k, v := range asMap { switch k { @@ -6263,9 +6263,9 @@ func (ec *executionContext) unmarshalInputOuterInput(ctx context.Context, v inte return it, nil } -func (ec *executionContext) unmarshalInputRecursiveInputSlice(ctx context.Context, v interface{}) (RecursiveInputSlice, error) { +func (ec *executionContext) unmarshalInputRecursiveInputSlice(ctx context.Context, in interface{}) (RecursiveInputSlice, error) { var it RecursiveInputSlice - var asMap = v.(map[string]interface{}) + var asMap = in.(map[string]interface{}) for k, v := range asMap { switch k { @@ -6281,9 +6281,9 @@ func (ec *executionContext) unmarshalInputRecursiveInputSlice(ctx context.Contex return it, nil } -func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, v interface{}) (ValidInput, error) { +func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, in interface{}) (ValidInput, error) { var it ValidInput - var asMap = v.(map[string]interface{}) + var asMap = in.(map[string]interface{}) for k, v := range asMap { switch k { diff --git a/example/chat/generated.go b/example/chat/generated.go index 9ac1ae7528..30968d8c71 100644 --- a/example/chat/generated.go +++ b/example/chat/generated.go @@ -333,11 +333,11 @@ directive @user(username: String!) on SUBSCRIPTION // region ***************************** args.gotpl ***************************** -func (ec *executionContext) dir_user_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) dir_user_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["username"]; ok { + if tmp, ok := in["username"]; ok { arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -347,11 +347,11 @@ func (ec *executionContext) dir_user_args(ctx context.Context, rawArgs map[strin return args, nil } -func (ec *executionContext) field_Mutation_post_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_post_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["text"]; ok { + if tmp, ok := in["text"]; ok { arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -359,7 +359,7 @@ func (ec *executionContext) field_Mutation_post_args(ctx context.Context, rawArg } args["text"] = arg0 var arg1 string - if tmp, ok := rawArgs["username"]; ok { + if tmp, ok := in["username"]; ok { arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -367,7 +367,7 @@ func (ec *executionContext) field_Mutation_post_args(ctx context.Context, rawArg } args["username"] = arg1 var arg2 string - if tmp, ok := rawArgs["roomName"]; ok { + if tmp, ok := in["roomName"]; ok { arg2, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -377,11 +377,11 @@ func (ec *executionContext) field_Mutation_post_args(ctx context.Context, rawArg return args, nil } -func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query___type_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["name"]; ok { + if tmp, ok := in["name"]; ok { arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -391,11 +391,11 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs return args, nil } -func (ec *executionContext) field_Query_room_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_room_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["name"]; ok { + if tmp, ok := in["name"]; ok { arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -405,11 +405,11 @@ func (ec *executionContext) field_Query_room_args(ctx context.Context, rawArgs m return args, nil } -func (ec *executionContext) field_Subscription_messageAdded_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Subscription_messageAdded_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["roomName"]; ok { + if tmp, ok := in["roomName"]; ok { arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -419,11 +419,11 @@ func (ec *executionContext) field_Subscription_messageAdded_args(ctx context.Con return args, nil } -func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -433,11 +433,11 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra return args, nil } -func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_fields_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err diff --git a/example/config/generated.go b/example/config/generated.go index da6797bc36..32975caa38 100644 --- a/example/config/generated.go +++ b/example/config/generated.go @@ -268,11 +268,11 @@ input NewTodo { // region ***************************** args.gotpl ***************************** -func (ec *executionContext) field_Mutation_createTodo_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_createTodo_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 NewTodo - if tmp, ok := rawArgs["input"]; ok { + if tmp, ok := in["input"]; ok { arg0, err = ec.unmarshalNNewTodo2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋconfigᚐNewTodo(ctx, tmp) if err != nil { return nil, err @@ -282,11 +282,11 @@ func (ec *executionContext) field_Mutation_createTodo_args(ctx context.Context, return args, nil } -func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query___type_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["name"]; ok { + if tmp, ok := in["name"]; ok { arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -296,11 +296,11 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs return args, nil } -func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -310,11 +310,11 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra return args, nil } -func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_fields_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -1468,9 +1468,9 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co // region **************************** input.gotpl ***************************** -func (ec *executionContext) unmarshalInputNewTodo(ctx context.Context, v interface{}) (NewTodo, error) { +func (ec *executionContext) unmarshalInputNewTodo(ctx context.Context, in interface{}) (NewTodo, error) { var it NewTodo - var asMap = v.(map[string]interface{}) + var asMap = in.(map[string]interface{}) for k, v := range asMap { switch k { diff --git a/example/dataloader/generated.go b/example/dataloader/generated.go index 6ac5e7da1d..63eea24f16 100644 --- a/example/dataloader/generated.go +++ b/example/dataloader/generated.go @@ -321,11 +321,11 @@ scalar Time // region ***************************** args.gotpl ***************************** -func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query___type_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["name"]; ok { + if tmp, ok := in["name"]; ok { arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -335,11 +335,11 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs return args, nil } -func (ec *executionContext) field_Query_torture1d_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_torture1d_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 []int - if tmp, ok := rawArgs["customerIds"]; ok { + if tmp, ok := in["customerIds"]; ok { arg0, err = ec.unmarshalOInt2ᚕint(ctx, tmp) if err != nil { return nil, err @@ -349,11 +349,11 @@ func (ec *executionContext) field_Query_torture1d_args(ctx context.Context, rawA return args, nil } -func (ec *executionContext) field_Query_torture2d_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_torture2d_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 [][]int - if tmp, ok := rawArgs["customerIds"]; ok { + if tmp, ok := in["customerIds"]; ok { arg0, err = ec.unmarshalOInt2ᚕᚕint(ctx, tmp) if err != nil { return nil, err @@ -363,11 +363,11 @@ func (ec *executionContext) field_Query_torture2d_args(ctx context.Context, rawA return args, nil } -func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -377,11 +377,11 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra return args, nil } -func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_fields_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err diff --git a/example/fileupload/generated.go b/example/fileupload/generated.go index a9c7607197..9d0bb34fe9 100644 --- a/example/fileupload/generated.go +++ b/example/fileupload/generated.go @@ -275,11 +275,11 @@ type Mutation { // region ***************************** args.gotpl ***************************** -func (ec *executionContext) field_Mutation_multipleUploadWithPayload_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_multipleUploadWithPayload_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 []*model.UploadFile - if tmp, ok := rawArgs["req"]; ok { + if tmp, ok := in["req"]; ok { arg0, err = ec.unmarshalNUploadFile2ᚕᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋfileuploadᚋmodelᚐUploadFile(ctx, tmp) if err != nil { return nil, err @@ -289,11 +289,11 @@ func (ec *executionContext) field_Mutation_multipleUploadWithPayload_args(ctx co return args, nil } -func (ec *executionContext) field_Mutation_multipleUpload_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_multipleUpload_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 []*graphql.Upload - if tmp, ok := rawArgs["files"]; ok { + if tmp, ok := in["files"]; ok { arg0, err = ec.unmarshalNUpload2ᚕᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) if err != nil { return nil, err @@ -303,11 +303,11 @@ func (ec *executionContext) field_Mutation_multipleUpload_args(ctx context.Conte return args, nil } -func (ec *executionContext) field_Mutation_singleUploadWithPayload_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_singleUploadWithPayload_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 model.UploadFile - if tmp, ok := rawArgs["req"]; ok { + if tmp, ok := in["req"]; ok { arg0, err = ec.unmarshalNUploadFile2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋfileuploadᚋmodelᚐUploadFile(ctx, tmp) if err != nil { return nil, err @@ -317,11 +317,11 @@ func (ec *executionContext) field_Mutation_singleUploadWithPayload_args(ctx cont return args, nil } -func (ec *executionContext) field_Mutation_singleUpload_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_singleUpload_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 graphql.Upload - if tmp, ok := rawArgs["file"]; ok { + if tmp, ok := in["file"]; ok { arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) if err != nil { return nil, err @@ -331,11 +331,11 @@ func (ec *executionContext) field_Mutation_singleUpload_args(ctx context.Context return args, nil } -func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query___type_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["name"]; ok { + if tmp, ok := in["name"]; ok { arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -345,11 +345,11 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs return args, nil } -func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -359,11 +359,11 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra return args, nil } -func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_fields_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -1511,9 +1511,9 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co // region **************************** input.gotpl ***************************** -func (ec *executionContext) unmarshalInputUploadFile(ctx context.Context, v interface{}) (model.UploadFile, error) { +func (ec *executionContext) unmarshalInputUploadFile(ctx context.Context, in interface{}) (model.UploadFile, error) { var it model.UploadFile - var asMap = v.(map[string]interface{}) + var asMap = in.(map[string]interface{}) for k, v := range asMap { switch k { diff --git a/example/scalars/generated.go b/example/scalars/generated.go index a5bd881901..f487ea2820 100644 --- a/example/scalars/generated.go +++ b/example/scalars/generated.go @@ -292,11 +292,11 @@ scalar Banned // region ***************************** args.gotpl ***************************** -func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query___type_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["name"]; ok { + if tmp, ok := in["name"]; ok { arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -306,11 +306,11 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs return args, nil } -func (ec *executionContext) field_Query_search_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_search_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *model.SearchArgs - if tmp, ok := rawArgs["input"]; ok { + if tmp, ok := in["input"]; ok { arg0, err = ec.unmarshalOSearchArgs2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐSearchArgs(ctx, tmp) if err != nil { return nil, err @@ -320,11 +320,11 @@ func (ec *executionContext) field_Query_search_args(ctx context.Context, rawArgs return args, nil } -func (ec *executionContext) field_Query_user_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_user_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 external.ObjectID - if tmp, ok := rawArgs["id"]; ok { + if tmp, ok := in["id"]; ok { arg0, err = ec.unmarshalNID2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋexternalᚐObjectID(ctx, tmp) if err != nil { return nil, err @@ -334,11 +334,11 @@ func (ec *executionContext) field_Query_user_args(ctx context.Context, rawArgs m return args, nil } -func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -348,11 +348,11 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra return args, nil } -func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_fields_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -1579,9 +1579,9 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co // region **************************** input.gotpl ***************************** -func (ec *executionContext) unmarshalInputSearchArgs(ctx context.Context, v interface{}) (model.SearchArgs, error) { +func (ec *executionContext) unmarshalInputSearchArgs(ctx context.Context, in interface{}) (model.SearchArgs, error) { var it model.SearchArgs - var asMap = v.(map[string]interface{}) + var asMap = in.(map[string]interface{}) for k, v := range asMap { switch k { diff --git a/example/selection/generated.go b/example/selection/generated.go index 9aa5781b15..8a8d777570 100644 --- a/example/selection/generated.go +++ b/example/selection/generated.go @@ -238,11 +238,11 @@ scalar Time // region ***************************** args.gotpl ***************************** -func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query___type_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["name"]; ok { + if tmp, ok := in["name"]; ok { arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -252,11 +252,11 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs return args, nil } -func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -266,11 +266,11 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra return args, nil } -func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_fields_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err diff --git a/example/starwars/generated/exec.go b/example/starwars/generated/exec.go index ff3f2add34..c26611204f 100644 --- a/example/starwars/generated/exec.go +++ b/example/starwars/generated/exec.go @@ -701,11 +701,11 @@ scalar Time // region ***************************** args.gotpl ***************************** -func (ec *executionContext) field_Droid_friendsConnection_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Droid_friendsConnection_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *int - if tmp, ok := rawArgs["first"]; ok { + if tmp, ok := in["first"]; ok { arg0, err = ec.unmarshalOInt2ᚖint(ctx, tmp) if err != nil { return nil, err @@ -713,7 +713,7 @@ func (ec *executionContext) field_Droid_friendsConnection_args(ctx context.Conte } args["first"] = arg0 var arg1 *string - if tmp, ok := rawArgs["after"]; ok { + if tmp, ok := in["after"]; ok { arg1, err = ec.unmarshalOID2ᚖstring(ctx, tmp) if err != nil { return nil, err @@ -723,11 +723,11 @@ func (ec *executionContext) field_Droid_friendsConnection_args(ctx context.Conte return args, nil } -func (ec *executionContext) field_Human_friendsConnection_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Human_friendsConnection_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *int - if tmp, ok := rawArgs["first"]; ok { + if tmp, ok := in["first"]; ok { arg0, err = ec.unmarshalOInt2ᚖint(ctx, tmp) if err != nil { return nil, err @@ -735,7 +735,7 @@ func (ec *executionContext) field_Human_friendsConnection_args(ctx context.Conte } args["first"] = arg0 var arg1 *string - if tmp, ok := rawArgs["after"]; ok { + if tmp, ok := in["after"]; ok { arg1, err = ec.unmarshalOID2ᚖstring(ctx, tmp) if err != nil { return nil, err @@ -745,11 +745,11 @@ func (ec *executionContext) field_Human_friendsConnection_args(ctx context.Conte return args, nil } -func (ec *executionContext) field_Human_height_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Human_height_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 models.LengthUnit - if tmp, ok := rawArgs["unit"]; ok { + if tmp, ok := in["unit"]; ok { arg0, err = ec.unmarshalOLengthUnit2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐLengthUnit(ctx, tmp) if err != nil { return nil, err @@ -759,11 +759,11 @@ func (ec *executionContext) field_Human_height_args(ctx context.Context, rawArgs return args, nil } -func (ec *executionContext) field_Mutation_createReview_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_createReview_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 models.Episode - if tmp, ok := rawArgs["episode"]; ok { + if tmp, ok := in["episode"]; ok { arg0, err = ec.unmarshalNEpisode2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx, tmp) if err != nil { return nil, err @@ -771,7 +771,7 @@ func (ec *executionContext) field_Mutation_createReview_args(ctx context.Context } args["episode"] = arg0 var arg1 models.Review - if tmp, ok := rawArgs["review"]; ok { + if tmp, ok := in["review"]; ok { arg1, err = ec.unmarshalNReviewInput2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐReview(ctx, tmp) if err != nil { return nil, err @@ -781,11 +781,11 @@ func (ec *executionContext) field_Mutation_createReview_args(ctx context.Context return args, nil } -func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query___type_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["name"]; ok { + if tmp, ok := in["name"]; ok { arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -795,11 +795,11 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs return args, nil } -func (ec *executionContext) field_Query_character_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_character_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["id"]; ok { + if tmp, ok := in["id"]; ok { arg0, err = ec.unmarshalNID2string(ctx, tmp) if err != nil { return nil, err @@ -809,11 +809,11 @@ func (ec *executionContext) field_Query_character_args(ctx context.Context, rawA return args, nil } -func (ec *executionContext) field_Query_droid_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_droid_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["id"]; ok { + if tmp, ok := in["id"]; ok { arg0, err = ec.unmarshalNID2string(ctx, tmp) if err != nil { return nil, err @@ -823,11 +823,11 @@ func (ec *executionContext) field_Query_droid_args(ctx context.Context, rawArgs return args, nil } -func (ec *executionContext) field_Query_hero_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_hero_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *models.Episode - if tmp, ok := rawArgs["episode"]; ok { + if tmp, ok := in["episode"]; ok { arg0, err = ec.unmarshalOEpisode2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx, tmp) if err != nil { return nil, err @@ -837,11 +837,11 @@ func (ec *executionContext) field_Query_hero_args(ctx context.Context, rawArgs m return args, nil } -func (ec *executionContext) field_Query_human_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_human_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["id"]; ok { + if tmp, ok := in["id"]; ok { arg0, err = ec.unmarshalNID2string(ctx, tmp) if err != nil { return nil, err @@ -851,11 +851,11 @@ func (ec *executionContext) field_Query_human_args(ctx context.Context, rawArgs return args, nil } -func (ec *executionContext) field_Query_reviews_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_reviews_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 models.Episode - if tmp, ok := rawArgs["episode"]; ok { + if tmp, ok := in["episode"]; ok { arg0, err = ec.unmarshalNEpisode2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx, tmp) if err != nil { return nil, err @@ -863,7 +863,7 @@ func (ec *executionContext) field_Query_reviews_args(ctx context.Context, rawArg } args["episode"] = arg0 var arg1 *time.Time - if tmp, ok := rawArgs["since"]; ok { + if tmp, ok := in["since"]; ok { arg1, err = ec.unmarshalOTime2ᚖtimeᚐTime(ctx, tmp) if err != nil { return nil, err @@ -873,11 +873,11 @@ func (ec *executionContext) field_Query_reviews_args(ctx context.Context, rawArg return args, nil } -func (ec *executionContext) field_Query_search_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_search_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["text"]; ok { + if tmp, ok := in["text"]; ok { arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -887,11 +887,11 @@ func (ec *executionContext) field_Query_search_args(ctx context.Context, rawArgs return args, nil } -func (ec *executionContext) field_Query_starship_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_starship_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["id"]; ok { + if tmp, ok := in["id"]; ok { arg0, err = ec.unmarshalNID2string(ctx, tmp) if err != nil { return nil, err @@ -901,11 +901,11 @@ func (ec *executionContext) field_Query_starship_args(ctx context.Context, rawAr return args, nil } -func (ec *executionContext) field_Starship_length_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Starship_length_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *models.LengthUnit - if tmp, ok := rawArgs["unit"]; ok { + if tmp, ok := in["unit"]; ok { arg0, err = ec.unmarshalOLengthUnit2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐLengthUnit(ctx, tmp) if err != nil { return nil, err @@ -915,11 +915,11 @@ func (ec *executionContext) field_Starship_length_args(ctx context.Context, rawA return args, nil } -func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -929,11 +929,11 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra return args, nil } -func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_fields_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -2899,9 +2899,9 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co // region **************************** input.gotpl ***************************** -func (ec *executionContext) unmarshalInputReviewInput(ctx context.Context, v interface{}) (models.Review, error) { +func (ec *executionContext) unmarshalInputReviewInput(ctx context.Context, in interface{}) (models.Review, error) { var it models.Review - var asMap = v.(map[string]interface{}) + var asMap = in.(map[string]interface{}) for k, v := range asMap { switch k { diff --git a/example/todo/generated.go b/example/todo/generated.go index a5ec211b6b..9f4698f10b 100644 --- a/example/todo/generated.go +++ b/example/todo/generated.go @@ -318,11 +318,11 @@ enum Role { // region ***************************** args.gotpl ***************************** -func (ec *executionContext) dir_hasRole_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) dir_hasRole_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 Role - if tmp, ok := rawArgs["role"]; ok { + if tmp, ok := in["role"]; ok { arg0, err = ec.unmarshalNRole2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋtodoᚐRole(ctx, tmp) if err != nil { return nil, err @@ -332,11 +332,11 @@ func (ec *executionContext) dir_hasRole_args(ctx context.Context, rawArgs map[st return args, nil } -func (ec *executionContext) dir_user_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) dir_user_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 int - if tmp, ok := rawArgs["id"]; ok { + if tmp, ok := in["id"]; ok { arg0, err = ec.unmarshalNID2int(ctx, tmp) if err != nil { return nil, err @@ -346,11 +346,11 @@ func (ec *executionContext) dir_user_args(ctx context.Context, rawArgs map[strin return args, nil } -func (ec *executionContext) field_MyMutation_createTodo_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_MyMutation_createTodo_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 TodoInput - if tmp, ok := rawArgs["todo"]; ok { + if tmp, ok := in["todo"]; ok { arg0, err = ec.unmarshalNTodoInput2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋtodoᚐTodoInput(ctx, tmp) if err != nil { return nil, err @@ -360,11 +360,11 @@ func (ec *executionContext) field_MyMutation_createTodo_args(ctx context.Context return args, nil } -func (ec *executionContext) field_MyMutation_updateTodo_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_MyMutation_updateTodo_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 int - if tmp, ok := rawArgs["id"]; ok { + if tmp, ok := in["id"]; ok { arg0, err = ec.unmarshalNID2int(ctx, tmp) if err != nil { return nil, err @@ -372,7 +372,7 @@ func (ec *executionContext) field_MyMutation_updateTodo_args(ctx context.Context } args["id"] = arg0 var arg1 map[string]interface{} - if tmp, ok := rawArgs["changes"]; ok { + if tmp, ok := in["changes"]; ok { arg1, err = ec.unmarshalNMap2map(ctx, tmp) if err != nil { return nil, err @@ -382,11 +382,11 @@ func (ec *executionContext) field_MyMutation_updateTodo_args(ctx context.Context return args, nil } -func (ec *executionContext) field_MyQuery___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_MyQuery___type_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["name"]; ok { + if tmp, ok := in["name"]; ok { arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -396,11 +396,11 @@ func (ec *executionContext) field_MyQuery___type_args(ctx context.Context, rawAr return args, nil } -func (ec *executionContext) field_MyQuery_todo_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_MyQuery_todo_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 int - if tmp, ok := rawArgs["id"]; ok { + if tmp, ok := in["id"]; ok { arg0, err = ec.unmarshalNID2int(ctx, tmp) if err != nil { return nil, err @@ -410,11 +410,11 @@ func (ec *executionContext) field_MyQuery_todo_args(ctx context.Context, rawArgs return args, nil } -func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -424,11 +424,11 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra return args, nil } -func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_fields_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -1620,9 +1620,9 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co // region **************************** input.gotpl ***************************** -func (ec *executionContext) unmarshalInputTodoInput(ctx context.Context, v interface{}) (TodoInput, error) { +func (ec *executionContext) unmarshalInputTodoInput(ctx context.Context, in interface{}) (TodoInput, error) { var it TodoInput - var asMap = v.(map[string]interface{}) + var asMap = in.(map[string]interface{}) for k, v := range asMap { switch k { diff --git a/example/type-system-extension/generated.go b/example/type-system-extension/generated.go index 42853d3dab..5b9576ad27 100644 --- a/example/type-system-extension/generated.go +++ b/example/type-system-extension/generated.go @@ -367,11 +367,11 @@ extend union Data @unionLogging // region ***************************** args.gotpl ***************************** -func (ec *executionContext) field_MyMutation_createTodo_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_MyMutation_createTodo_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 TodoInput - if tmp, ok := rawArgs["todo"]; ok { + if tmp, ok := in["todo"]; ok { arg0, err = ec.unmarshalNTodoInput2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋtypeᚑsystemᚑextensionᚐTodoInput(ctx, tmp) if err != nil { return nil, err @@ -381,11 +381,11 @@ func (ec *executionContext) field_MyMutation_createTodo_args(ctx context.Context return args, nil } -func (ec *executionContext) field_MyQuery___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_MyQuery___type_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["name"]; ok { + if tmp, ok := in["name"]; ok { arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -395,11 +395,11 @@ func (ec *executionContext) field_MyQuery___type_args(ctx context.Context, rawAr return args, nil } -func (ec *executionContext) field_MyQuery_todo_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_MyQuery_todo_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["id"]; ok { + if tmp, ok := in["id"]; ok { arg0, err = ec.unmarshalNID2string(ctx, tmp) if err != nil { return nil, err @@ -409,11 +409,11 @@ func (ec *executionContext) field_MyQuery_todo_args(ctx context.Context, rawArgs return args, nil } -func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -423,11 +423,11 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra return args, nil } -func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_fields_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -1531,9 +1531,9 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co // region **************************** input.gotpl ***************************** -func (ec *executionContext) unmarshalInputTodoInput(ctx context.Context, v interface{}) (TodoInput, error) { +func (ec *executionContext) unmarshalInputTodoInput(ctx context.Context, in interface{}) (TodoInput, error) { var it TodoInput - var asMap = v.(map[string]interface{}) + var asMap = in.(map[string]interface{}) for k, v := range asMap { switch k { diff --git a/integration/generated.go b/integration/generated.go index 69815c3182..64107e2ca3 100644 --- a/integration/generated.go +++ b/integration/generated.go @@ -342,11 +342,11 @@ enum ErrorType { // region ***************************** args.gotpl ***************************** -func (ec *executionContext) dir_magic_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) dir_magic_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *int - if tmp, ok := rawArgs["kind"]; ok { + if tmp, ok := in["kind"]; ok { arg0, err = ec.unmarshalOInt2ᚖint(ctx, tmp) if err != nil { return nil, err @@ -356,11 +356,11 @@ func (ec *executionContext) dir_magic_args(ctx context.Context, rawArgs map[stri return args, nil } -func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query___type_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["name"]; ok { + if tmp, ok := in["name"]; ok { arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -370,11 +370,11 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs return args, nil } -func (ec *executionContext) field_Query_complexity_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_complexity_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 int - if tmp, ok := rawArgs["value"]; ok { + if tmp, ok := in["value"]; ok { arg0, err = ec.unmarshalNInt2int(ctx, tmp) if err != nil { return nil, err @@ -384,11 +384,11 @@ func (ec *executionContext) field_Query_complexity_args(ctx context.Context, raw return args, nil } -func (ec *executionContext) field_Query_date_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_date_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 models.DateFilter - if tmp, ok := rawArgs["filter"]; ok { + if tmp, ok := in["filter"]; ok { arg0, err = ec.unmarshalNDateFilter2githubᚗcomᚋ99designsᚋgqlgenᚋintegrationᚋmodelsᚑgoᚐDateFilter(ctx, tmp) if err != nil { return nil, err @@ -398,11 +398,11 @@ func (ec *executionContext) field_Query_date_args(ctx context.Context, rawArgs m return args, nil } -func (ec *executionContext) field_Query_error_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_error_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *models.ErrorType - if tmp, ok := rawArgs["type"]; ok { + if tmp, ok := in["type"]; ok { arg0, err = ec.unmarshalOErrorType2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋintegrationᚋmodelsᚑgoᚐErrorType(ctx, tmp) if err != nil { return nil, err @@ -412,11 +412,11 @@ func (ec *executionContext) field_Query_error_args(ctx context.Context, rawArgs return args, nil } -func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -426,11 +426,11 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra return args, nil } -func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field___Type_fields_args(ctx context.Context, in map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { + if tmp, ok := in["includeDeprecated"]; ok { arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -1667,9 +1667,9 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co // region **************************** input.gotpl ***************************** -func (ec *executionContext) unmarshalInputDateFilter(ctx context.Context, v interface{}) (models.DateFilter, error) { +func (ec *executionContext) unmarshalInputDateFilter(ctx context.Context, in interface{}) (models.DateFilter, error) { var it models.DateFilter - var asMap = v.(map[string]interface{}) + var asMap = in.(map[string]interface{}) if _, present := asMap["timezone"]; !present { asMap["timezone"] = "UTC"