From a7b1525707b47e4aa5d58bd65205f0ead96d7920 Mon Sep 17 00:00:00 2001 From: Luke Cawood Date: Mon, 24 Aug 2020 11:19:33 +1000 Subject: [PATCH] Always wrap user errors This is an alternative to #1305 that leans into error wrapping instead of away from it. Requires use of go 1.13 error unwrapping. On measure I think I prefer this approach, even though it's a bigger BC break: - There's less mutex juggling - It has never felt right to me that we make the user deal with path when overriding the error presenter - The default error presenter is now incredibly simple Questions: - Are we comfortable with supporting 1.13 and up? - Should we change the signature of `ErrorPresenterFunc` to `func(ctx context.Context, err *gqlerror.Error) *gqlerror.Error`? - It always is now, and breaking BC will force users to address the requirement for `errors.As` --- .github/workflows/integration.yml | 8 +- .github/workflows/test.yml | 2 +- codegen/args.gotpl | 6 +- codegen/field.gotpl | 2 +- codegen/input.gotpl | 7 +- codegen/testserver/directive_test.go | 14 +- codegen/testserver/generated.go | 414 +++++++++--------- codegen/testserver/panics_test.go | 6 +- codegen/type.gotpl | 16 +- example/chat/generated.go | 42 +- example/config/generated.go | 42 +- example/dataloader/generated.go | 44 +- .../accounts/graph/generated/generated.go | 40 +- .../products/graph/generated/generated.go | 44 +- .../reviews/graph/generated/generated.go | 42 +- example/fileupload/generated.go | 56 +-- example/scalars/generated.go | 68 +-- example/selection/generated.go | 32 +- example/starwars/generated/exec.go | 102 ++--- example/todo/generated.go | 52 +-- example/type-system-extension/generated.go | 46 +- go.mod | 2 +- go.sum | 2 + graphql/context_field_input.go | 85 ---- graphql/context_operation.go | 10 +- graphql/context_path.go | 77 ++++ ...eld_input_test.go => context_path_test.go} | 4 +- graphql/context_response.go | 11 +- graphql/error.go | 27 +- graphql/executor/executor.go | 2 +- integration/generated.go | 58 +-- integration/server/server.go | 12 +- 32 files changed, 684 insertions(+), 691 deletions(-) delete mode 100644 graphql/context_field_input.go create mode 100644 graphql/context_path.go rename graphql/{context_field_input_test.go => context_path_test.go} (61%) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 444a93386d8..fb49e32c516 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -5,20 +5,20 @@ jobs: integration: runs-on: ubuntu-latest timeout-minutes: 3 - container: alpine:3.10 + container: golang:1.13-alpine steps: - uses: actions/checkout@v1 - - run: apk add --no-cache --no-progress nodejs npm go musl-dev git bash + - run: apk add --no-cache --no-progress nodejs npm musl-dev git bash - run: go mod download - run: cd integration ; npm install - run: .github/workflows/check-integration federation: runs-on: ubuntu-latest - container: alpine:3.10 + container: golang:1.13-alpine steps: - uses: actions/checkout@v1 - - run: apk add --no-cache --no-progress nodejs npm go musl-dev git bash + - run: apk add --no-cache --no-progress nodejs npm musl-dev git bash - run: go mod download - run: cd example/federation ; npm install - run: .github/workflows/check-federation diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d7c6fccf28c..1df7ffaf751 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ jobs: test: strategy: matrix: - go: [1.12, 1.14] + go: [1.13, 1.14] os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} diff --git a/codegen/args.gotpl b/codegen/args.gotpl index b25d444b501..7b541ae1f2e 100644 --- a/codegen/args.gotpl +++ b/codegen/args.gotpl @@ -5,13 +5,13 @@ func (ec *executionContext) {{ $name }}(ctx context.Context, rawArgs map[string] {{- range $i, $arg := . }} var arg{{$i}} {{ $arg.TypeReference.GO | ref}} if tmp, ok := rawArgs[{{$arg.Name|quote}}]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField({{$arg.Name|quote}})) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField({{$arg.Name|quote}})) {{- if $arg.ImplDirectives }} directive0 := func(ctx context.Context) (interface{}, error) { return ec.{{ $arg.TypeReference.UnmarshalFunc }}(ctx, tmp) } {{ template "implDirectives" $arg }} tmp, err = directive{{$arg.ImplDirectives|len}}(ctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if data, ok := tmp.({{ $arg.TypeReference.GO | ref }}) ; ok { arg{{$i}} = data @@ -20,7 +20,7 @@ func (ec *executionContext) {{ $name }}(ctx context.Context, rawArgs map[string] arg{{$i}} = nil {{- end }} } else { - return nil, fmt.Errorf(`unexpected type %T from directive, should be {{ $arg.TypeReference.GO }}`, tmp) + return nil, graphql.ErrorOnPath(ctx, fmt.Errorf(`unexpected type %T from directive, should be {{ $arg.TypeReference.GO }}`, tmp)) } {{- else }} arg{{$i}}, err = ec.{{ $arg.TypeReference.UnmarshalFunc }}(ctx, tmp) diff --git a/codegen/field.gotpl b/codegen/field.gotpl index 993625b7419..7ad6f931da3 100644 --- a/codegen/field.gotpl +++ b/codegen/field.gotpl @@ -81,7 +81,7 @@ func (ec *executionContext) _{{$object.Name}}_{{$field.Name}}(ctx context.Contex {{ template "implDirectives" . }} tmp, err := directive{{.ImplDirectives|len}}(rctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if tmp == nil { return nil, nil diff --git a/codegen/input.gotpl b/codegen/input.gotpl index 56f9347c422..e8a5b50492b 100644 --- a/codegen/input.gotpl +++ b/codegen/input.gotpl @@ -17,13 +17,13 @@ case {{$field.Name|quote}}: var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField({{$field.Name|quote}})) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField({{$field.Name|quote}})) {{- 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 + return it, graphql.ErrorOnPath(ctx, err) } if data, ok := tmp.({{ $field.TypeReference.GO | ref }}) ; ok { it.{{$field.GoFieldName}} = data @@ -32,7 +32,8 @@ it.{{$field.GoFieldName}} = nil {{- end }} } else { - return it, fmt.Errorf(`unexpected type %T from directive, should be {{ $field.TypeReference.GO }}`, tmp) + err := fmt.Errorf(`unexpected type %T from directive, should be {{ $field.TypeReference.GO }}`, tmp) + return it, graphql.ErrorOnPath(ctx, err) } {{- else }} it.{{$field.GoFieldName}}, err = ec.{{ $field.TypeReference.UnmarshalFunc }}(ctx, v) diff --git a/codegen/testserver/directive_test.go b/codegen/testserver/directive_test.go index 22fc1db2604..32015005104 100644 --- a/codegen/testserver/directive_test.go +++ b/codegen/testserver/directive_test.go @@ -200,7 +200,7 @@ func TestDirectives(t *testing.T) { err := c.Post(`query { directiveArg(arg: "") }`, &resp) - require.EqualError(t, err, `[{"message":"invalid length","path":["directiveArg"]}]`) + require.EqualError(t, err, `[{"message":"invalid length","path":["directiveArg","arg"]}]`) require.Nil(t, resp.DirectiveArg) }) t.Run("when function errors on nullable arg directives", func(t *testing.T) { @@ -210,7 +210,7 @@ func TestDirectives(t *testing.T) { err := c.Post(`query { directiveNullableArg(arg: -100) }`, &resp) - require.EqualError(t, err, `[{"message":"too small","path":["directiveNullableArg"]}]`) + require.EqualError(t, err, `[{"message":"too small","path":["directiveNullableArg","arg"]}]`) require.Nil(t, resp.DirectiveNullableArg) }) t.Run("when function success on nullable arg directives", func(t *testing.T) { @@ -317,7 +317,7 @@ func TestDirectives(t *testing.T) { err := c.Post(`query { directiveInputNullable(arg: {text:"invalid text",inner:{message:"123"}}) }`, &resp) - require.EqualError(t, err, `[{"message":"not valid","path":["directiveInputNullable","arg"]}]`) + require.EqualError(t, err, `[{"message":"not valid","path":["directiveInputNullable","arg","text"]}]`) require.Nil(t, resp.DirectiveInputNullable) }) t.Run("when function errors on inner directives", func(t *testing.T) { @@ -327,7 +327,7 @@ func TestDirectives(t *testing.T) { err := c.Post(`query { directiveInputNullable(arg: {text:"2",inner:{message:""}}) }`, &resp) - require.EqualError(t, err, `[{"message":"not valid","path":["directiveInputNullable","arg","inner"]}]`) + require.EqualError(t, err, `[{"message":"not valid","path":["directiveInputNullable","arg","inner","message"]}]`) require.Nil(t, resp.DirectiveInputNullable) }) t.Run("when function errors on nullable inner directives", func(t *testing.T) { @@ -337,7 +337,7 @@ func TestDirectives(t *testing.T) { err := c.Post(`query { directiveInputNullable(arg: {text:"success",inner:{message:"1"},innerNullable:{message:""}}) }`, &resp) - require.EqualError(t, err, `[{"message":"not valid","path":["directiveInputNullable","arg","innerNullable"]}]`) + require.EqualError(t, err, `[{"message":"not valid","path":["directiveInputNullable","arg","innerNullable","message"]}]`) require.Nil(t, resp.DirectiveInputNullable) }) t.Run("when function success", func(t *testing.T) { @@ -413,7 +413,7 @@ func TestDirectives(t *testing.T) { err := c.WebsocketOnce(`subscription { directiveArg(arg: "") }`, &resp) - require.EqualError(t, err, `[{"message":"invalid length","path":["directiveArg"]}]`) + require.EqualError(t, err, `[{"message":"invalid length","path":["directiveArg","arg"]}]`) require.Nil(t, resp.DirectiveArg) }) t.Run("when function errors on nullable arg directives", func(t *testing.T) { @@ -423,7 +423,7 @@ func TestDirectives(t *testing.T) { err := c.WebsocketOnce(`subscription { directiveNullableArg(arg: -100) }`, &resp) - require.EqualError(t, err, `[{"message":"too small","path":["directiveNullableArg"]}]`) + require.EqualError(t, err, `[{"message":"too small","path":["directiveNullableArg","arg"]}]`) require.Nil(t, resp.DirectiveNullableArg) }) t.Run("when function success on nullable arg directives", func(t *testing.T) { diff --git a/codegen/testserver/generated.go b/codegen/testserver/generated.go index 4d1d0443d95..aa749812437 100644 --- a/codegen/testserver/generated.go +++ b/codegen/testserver/generated.go @@ -2350,7 +2350,7 @@ func (ec *executionContext) dir_length_args(ctx context.Context, rawArgs map[str args := map[string]interface{}{} var arg0 int if tmp, ok := rawArgs["min"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("min")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("min")) arg0, err = ec.unmarshalNInt2int(ctx, tmp) if err != nil { return nil, err @@ -2359,7 +2359,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 { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("max")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("max")) arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) if err != nil { return nil, err @@ -2368,7 +2368,7 @@ func (ec *executionContext) dir_length_args(ctx context.Context, rawArgs map[str args["max"] = arg1 var arg2 *string if tmp, ok := rawArgs["message"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("message")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("message")) arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) if err != nil { return nil, err @@ -2383,7 +2383,7 @@ func (ec *executionContext) dir_logged_args(ctx context.Context, rawArgs map[str args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("id")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) arg0, err = ec.unmarshalNUUID2string(ctx, tmp) if err != nil { return nil, err @@ -2398,7 +2398,7 @@ func (ec *executionContext) dir_order1_args(ctx context.Context, rawArgs map[str args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["location"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("location")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("location")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2413,7 +2413,7 @@ func (ec *executionContext) dir_order2_args(ctx context.Context, rawArgs map[str args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["location"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("location")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("location")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2428,7 +2428,7 @@ func (ec *executionContext) dir_range_args(ctx context.Context, rawArgs map[stri args := map[string]interface{}{} var arg0 *int if tmp, ok := rawArgs["min"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("min")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("min")) arg0, err = ec.unmarshalOInt2ᚖint(ctx, tmp) if err != nil { return nil, err @@ -2437,7 +2437,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 { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("max")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("max")) arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) if err != nil { return nil, err @@ -2452,7 +2452,7 @@ func (ec *executionContext) field_Mutation_updateSomething_args(ctx context.Cont args := map[string]interface{}{} var arg0 SpecialInput if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("input")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) arg0, err = ec.unmarshalNSpecialInput2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐSpecialInput(ctx, tmp) if err != nil { return nil, err @@ -2467,7 +2467,7 @@ func (ec *executionContext) field_Panics_argUnmarshal_args(ctx context.Context, args := map[string]interface{}{} var arg0 []MarshalPanic if tmp, ok := rawArgs["u"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("u")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("u")) arg0, err = ec.unmarshalNMarshalPanic2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐMarshalPanicᚄ(ctx, tmp) if err != nil { return nil, err @@ -2482,7 +2482,7 @@ func (ec *executionContext) field_Panics_fieldFuncMarshal_args(ctx context.Conte args := map[string]interface{}{} var arg0 []MarshalPanic if tmp, ok := rawArgs["u"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("u")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("u")) arg0, err = ec.unmarshalNMarshalPanic2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐMarshalPanicᚄ(ctx, tmp) if err != nil { return nil, err @@ -2497,7 +2497,7 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("name")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2512,7 +2512,7 @@ func (ec *executionContext) field_Query_defaultScalar_args(ctx context.Context, args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["arg"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("arg")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("arg")) arg0, err = ec.unmarshalNDefaultScalarImplementation2string(ctx, tmp) if err != nil { return nil, err @@ -2527,7 +2527,7 @@ func (ec *executionContext) field_Query_directiveArg_args(ctx context.Context, r args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["arg"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("arg")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("arg")) directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalNString2string(ctx, tmp) } directive1 := func(ctx context.Context) (interface{}, error) { min, err := ec.unmarshalNInt2int(ctx, 1) @@ -2550,12 +2550,12 @@ func (ec *executionContext) field_Query_directiveArg_args(ctx context.Context, r tmp, err = directive1(ctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if data, ok := tmp.(string); ok { arg0 = data } else { - return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) + return nil, graphql.ErrorOnPath(ctx, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp)) } } args["arg"] = arg0 @@ -2567,7 +2567,7 @@ func (ec *executionContext) field_Query_directiveFieldDef_args(ctx context.Conte args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["ret"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("ret")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ret")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -2582,7 +2582,7 @@ func (ec *executionContext) field_Query_directiveInputNullable_args(ctx context. args := map[string]interface{}{} var arg0 *InputDirectives if tmp, ok := rawArgs["arg"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("arg")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("arg")) arg0, err = ec.unmarshalOInputDirectives2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInputDirectives(ctx, tmp) if err != nil { return nil, err @@ -2597,7 +2597,7 @@ func (ec *executionContext) field_Query_directiveInputType_args(ctx context.Cont args := map[string]interface{}{} var arg0 InnerInput if tmp, ok := rawArgs["arg"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("arg")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("arg")) directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalNInnerInput2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInnerInput(ctx, tmp) } @@ -2610,12 +2610,12 @@ func (ec *executionContext) field_Query_directiveInputType_args(ctx context.Cont tmp, err = directive1(ctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if data, ok := tmp.(InnerInput); ok { arg0 = data } else { - return nil, fmt.Errorf(`unexpected type %T from directive, should be github.com/99designs/gqlgen/codegen/testserver.InnerInput`, tmp) + return nil, graphql.ErrorOnPath(ctx, fmt.Errorf(`unexpected type %T from directive, should be github.com/99designs/gqlgen/codegen/testserver.InnerInput`, tmp)) } } args["arg"] = arg0 @@ -2627,7 +2627,7 @@ func (ec *executionContext) field_Query_directiveInput_args(ctx context.Context, args := map[string]interface{}{} var arg0 InputDirectives if tmp, ok := rawArgs["arg"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("arg")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("arg")) arg0, err = ec.unmarshalNInputDirectives2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInputDirectives(ctx, tmp) if err != nil { return nil, err @@ -2642,7 +2642,7 @@ func (ec *executionContext) field_Query_directiveNullableArg_args(ctx context.Co args := map[string]interface{}{} var arg0 *int if tmp, ok := rawArgs["arg"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("arg")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("arg")) directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOInt2ᚖint(ctx, tmp) } directive1 := func(ctx context.Context) (interface{}, error) { min, err := ec.unmarshalOInt2ᚖint(ctx, 0) @@ -2657,20 +2657,20 @@ func (ec *executionContext) field_Query_directiveNullableArg_args(ctx context.Co tmp, err = directive1(ctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if data, ok := tmp.(*int); ok { arg0 = data } else if tmp == nil { arg0 = nil } else { - return nil, fmt.Errorf(`unexpected type %T from directive, should be *int`, tmp) + return nil, graphql.ErrorOnPath(ctx, fmt.Errorf(`unexpected type %T from directive, should be *int`, tmp)) } } args["arg"] = arg0 var arg1 *int if tmp, ok := rawArgs["arg2"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("arg2")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("arg2")) directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOInt2ᚖint(ctx, tmp) } directive1 := func(ctx context.Context) (interface{}, error) { min, err := ec.unmarshalOInt2ᚖint(ctx, 0) @@ -2685,20 +2685,20 @@ func (ec *executionContext) field_Query_directiveNullableArg_args(ctx context.Co tmp, err = directive1(ctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if data, ok := tmp.(*int); ok { arg1 = data } else if tmp == nil { arg1 = nil } else { - return nil, fmt.Errorf(`unexpected type %T from directive, should be *int`, tmp) + return nil, graphql.ErrorOnPath(ctx, fmt.Errorf(`unexpected type %T from directive, should be *int`, tmp)) } } args["arg2"] = arg1 var arg2 *string if tmp, ok := rawArgs["arg3"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("arg3")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("arg3")) directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOString2ᚖstring(ctx, tmp) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.ToNull == nil { @@ -2709,14 +2709,14 @@ func (ec *executionContext) field_Query_directiveNullableArg_args(ctx context.Co tmp, err = directive1(ctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if data, ok := tmp.(*string); ok { arg2 = data } else if tmp == nil { arg2 = nil } else { - return nil, fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return nil, graphql.ErrorOnPath(ctx, fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp)) } } args["arg3"] = arg2 @@ -2728,7 +2728,7 @@ func (ec *executionContext) field_Query_enumInInput_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 *InputWithEnumValue if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("input")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) arg0, err = ec.unmarshalOInputWithEnumValue2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInputWithEnumValue(ctx, tmp) if err != nil { return nil, err @@ -2743,7 +2743,7 @@ func (ec *executionContext) field_Query_fallback_args(ctx context.Context, rawAr args := map[string]interface{}{} var arg0 FallbackToStringEncoding if tmp, ok := rawArgs["arg"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("arg")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("arg")) arg0, err = ec.unmarshalNFallbackToStringEncoding2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐFallbackToStringEncoding(ctx, tmp) if err != nil { return nil, err @@ -2758,7 +2758,7 @@ func (ec *executionContext) field_Query_inputNullableSlice_args(ctx context.Cont args := map[string]interface{}{} var arg0 []string if tmp, ok := rawArgs["arg"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("arg")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("arg")) arg0, err = ec.unmarshalOString2ᚕstringᚄ(ctx, tmp) if err != nil { return nil, err @@ -2773,7 +2773,7 @@ func (ec *executionContext) field_Query_inputSlice_args(ctx context.Context, raw args := map[string]interface{}{} var arg0 []string if tmp, ok := rawArgs["arg"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("arg")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("arg")) arg0, err = ec.unmarshalNString2ᚕstringᚄ(ctx, tmp) if err != nil { return nil, err @@ -2788,7 +2788,7 @@ func (ec *executionContext) field_Query_mapInput_args(ctx context.Context, rawAr args := map[string]interface{}{} var arg0 map[string]interface{} if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("input")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) arg0, err = ec.unmarshalOChanges2map(ctx, tmp) if err != nil { return nil, err @@ -2803,7 +2803,7 @@ func (ec *executionContext) field_Query_mapNestedStringInterface_args(ctx contex args := map[string]interface{}{} var arg0 *NestedMapInput if tmp, ok := rawArgs["in"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("in")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) arg0, err = ec.unmarshalONestedMapInput2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐNestedMapInput(ctx, tmp) if err != nil { return nil, err @@ -2818,7 +2818,7 @@ func (ec *executionContext) field_Query_mapStringInterface_args(ctx context.Cont args := map[string]interface{}{} var arg0 map[string]interface{} if tmp, ok := rawArgs["in"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("in")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) arg0, err = ec.unmarshalOMapStringInterfaceInput2map(ctx, tmp) if err != nil { return nil, err @@ -2833,7 +2833,7 @@ func (ec *executionContext) field_Query_nestedInputs_args(ctx context.Context, r args := map[string]interface{}{} var arg0 [][]*OuterInput if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("input")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) arg0, err = ec.unmarshalOOuterInput2ᚕᚕᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐOuterInput(ctx, tmp) if err != nil { return nil, err @@ -2848,7 +2848,7 @@ func (ec *executionContext) field_Query_nullableArg_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 *int if tmp, ok := rawArgs["arg"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("arg")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("arg")) arg0, err = ec.unmarshalOInt2ᚖint(ctx, tmp) if err != nil { return nil, err @@ -2863,7 +2863,7 @@ func (ec *executionContext) field_Query_recursive_args(ctx context.Context, rawA args := map[string]interface{}{} var arg0 *RecursiveInputSlice if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("input")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) arg0, err = ec.unmarshalORecursiveInputSlice2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐRecursiveInputSlice(ctx, tmp) if err != nil { return nil, err @@ -2878,7 +2878,7 @@ func (ec *executionContext) field_Query_user_args(ctx context.Context, rawArgs m args := map[string]interface{}{} var arg0 int if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("id")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) arg0, err = ec.unmarshalNInt2int(ctx, tmp) if err != nil { return nil, err @@ -2893,7 +2893,7 @@ func (ec *executionContext) field_Subscription_directiveArg_args(ctx context.Con args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["arg"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("arg")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("arg")) directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalNString2string(ctx, tmp) } directive1 := func(ctx context.Context) (interface{}, error) { min, err := ec.unmarshalNInt2int(ctx, 1) @@ -2916,12 +2916,12 @@ func (ec *executionContext) field_Subscription_directiveArg_args(ctx context.Con tmp, err = directive1(ctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if data, ok := tmp.(string); ok { arg0 = data } else { - return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) + return nil, graphql.ErrorOnPath(ctx, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp)) } } args["arg"] = arg0 @@ -2933,7 +2933,7 @@ func (ec *executionContext) field_Subscription_directiveNullableArg_args(ctx con args := map[string]interface{}{} var arg0 *int if tmp, ok := rawArgs["arg"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("arg")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("arg")) directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOInt2ᚖint(ctx, tmp) } directive1 := func(ctx context.Context) (interface{}, error) { min, err := ec.unmarshalOInt2ᚖint(ctx, 0) @@ -2948,20 +2948,20 @@ func (ec *executionContext) field_Subscription_directiveNullableArg_args(ctx con tmp, err = directive1(ctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if data, ok := tmp.(*int); ok { arg0 = data } else if tmp == nil { arg0 = nil } else { - return nil, fmt.Errorf(`unexpected type %T from directive, should be *int`, tmp) + return nil, graphql.ErrorOnPath(ctx, fmt.Errorf(`unexpected type %T from directive, should be *int`, tmp)) } } args["arg"] = arg0 var arg1 *int if tmp, ok := rawArgs["arg2"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("arg2")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("arg2")) directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOInt2ᚖint(ctx, tmp) } directive1 := func(ctx context.Context) (interface{}, error) { min, err := ec.unmarshalOInt2ᚖint(ctx, 0) @@ -2976,20 +2976,20 @@ func (ec *executionContext) field_Subscription_directiveNullableArg_args(ctx con tmp, err = directive1(ctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if data, ok := tmp.(*int); ok { arg1 = data } else if tmp == nil { arg1 = nil } else { - return nil, fmt.Errorf(`unexpected type %T from directive, should be *int`, tmp) + return nil, graphql.ErrorOnPath(ctx, fmt.Errorf(`unexpected type %T from directive, should be *int`, tmp)) } } args["arg2"] = arg1 var arg2 *string if tmp, ok := rawArgs["arg3"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("arg3")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("arg3")) directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOString2ᚖstring(ctx, tmp) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.ToNull == nil { @@ -3000,14 +3000,14 @@ func (ec *executionContext) field_Subscription_directiveNullableArg_args(ctx con tmp, err = directive1(ctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if data, ok := tmp.(*string); ok { arg2 = data } else if tmp == nil { arg2 = nil } else { - return nil, fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return nil, graphql.ErrorOnPath(ctx, fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp)) } } args["arg3"] = arg2 @@ -3019,7 +3019,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["break"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("break")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("break")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3028,7 +3028,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["break"] = arg0 var arg1 string if tmp, ok := rawArgs["default"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("default")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("default")) arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3037,7 +3037,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["default"] = arg1 var arg2 string if tmp, ok := rawArgs["func"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("func")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("func")) arg2, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3046,7 +3046,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["func"] = arg2 var arg3 string if tmp, ok := rawArgs["interface"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("interface")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("interface")) arg3, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3055,7 +3055,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["interface"] = arg3 var arg4 string if tmp, ok := rawArgs["select"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("select")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("select")) arg4, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3064,7 +3064,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["select"] = arg4 var arg5 string if tmp, ok := rawArgs["case"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("case")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("case")) arg5, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3073,7 +3073,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["case"] = arg5 var arg6 string if tmp, ok := rawArgs["defer"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("defer")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("defer")) arg6, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3082,7 +3082,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["defer"] = arg6 var arg7 string if tmp, ok := rawArgs["go"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("go")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("go")) arg7, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3091,7 +3091,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["go"] = arg7 var arg8 string if tmp, ok := rawArgs["map"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("map")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("map")) arg8, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3100,7 +3100,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["map"] = arg8 var arg9 string if tmp, ok := rawArgs["struct"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("struct")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("struct")) arg9, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3109,7 +3109,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["struct"] = arg9 var arg10 string if tmp, ok := rawArgs["chan"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("chan")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("chan")) arg10, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3118,7 +3118,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["chan"] = arg10 var arg11 string if tmp, ok := rawArgs["else"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("else")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("else")) arg11, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3127,7 +3127,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["else"] = arg11 var arg12 string if tmp, ok := rawArgs["goto"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("goto")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("goto")) arg12, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3136,7 +3136,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["goto"] = arg12 var arg13 string if tmp, ok := rawArgs["package"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("package")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("package")) arg13, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3145,7 +3145,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["package"] = arg13 var arg14 string if tmp, ok := rawArgs["switch"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("switch")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("switch")) arg14, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3154,7 +3154,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["switch"] = arg14 var arg15 string if tmp, ok := rawArgs["const"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("const")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("const")) arg15, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3163,7 +3163,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["const"] = arg15 var arg16 string if tmp, ok := rawArgs["fallthrough"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("fallthrough")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fallthrough")) arg16, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3172,7 +3172,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["fallthrough"] = arg16 var arg17 string if tmp, ok := rawArgs["if"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("if")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("if")) arg17, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3181,7 +3181,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["if"] = arg17 var arg18 string if tmp, ok := rawArgs["range"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("range")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("range")) arg18, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3190,7 +3190,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["range"] = arg18 var arg19 string if tmp, ok := rawArgs["type"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("type")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) arg19, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3199,7 +3199,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["type"] = arg19 var arg20 string if tmp, ok := rawArgs["continue"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("continue")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("continue")) arg20, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3208,7 +3208,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["continue"] = arg20 var arg21 string if tmp, ok := rawArgs["for"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("for")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("for")) arg21, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3217,7 +3217,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["for"] = arg21 var arg22 string if tmp, ok := rawArgs["import"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("import")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("import")) arg22, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3226,7 +3226,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["import"] = arg22 var arg23 string if tmp, ok := rawArgs["return"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("return")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("return")) arg23, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3235,7 +3235,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["return"] = arg23 var arg24 string if tmp, ok := rawArgs["var"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("var")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("var")) arg24, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3244,7 +3244,7 @@ func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, args["var"] = arg24 var arg25 string if tmp, ok := rawArgs["_"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("_")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_")) arg25, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3259,7 +3259,7 @@ func (ec *executionContext) field_ValidType_validInputKeywords_args(ctx context. args := map[string]interface{}{} var arg0 *ValidInput if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("input")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) arg0, err = ec.unmarshalOValidInput2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐValidInput(ctx, tmp) if err != nil { return nil, err @@ -3274,7 +3274,7 @@ func (ec *executionContext) field_WrappedMap_get_args(ctx context.Context, rawAr args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["key"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("key")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -3289,7 +3289,7 @@ func (ec *executionContext) field_WrappedSlice_get_args(ctx context.Context, raw args := map[string]interface{}{} var arg0 int if tmp, ok := rawArgs["idx"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("idx")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idx")) arg0, err = ec.unmarshalNInt2int(ctx, tmp) if err != nil { return nil, err @@ -3304,7 +3304,7 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -3319,7 +3319,7 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -5069,7 +5069,7 @@ func (ec *executionContext) _ObjectDirectives_text(ctx context.Context, field gr tmp, err := directive1(rctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if tmp == nil { return nil, nil @@ -5120,7 +5120,7 @@ func (ec *executionContext) _ObjectDirectives_nullableText(ctx context.Context, tmp, err := directive1(rctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if tmp == nil { return nil, nil @@ -5199,7 +5199,7 @@ func (ec *executionContext) _ObjectDirectivesWithCustomGoModel_nullableText(ctx tmp, err := directive1(rctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if tmp == nil { return nil, nil @@ -6378,7 +6378,7 @@ func (ec *executionContext) _Query_directiveObject(ctx context.Context, field gr tmp, err := directive3(rctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if tmp == nil { return nil, nil @@ -6469,7 +6469,7 @@ func (ec *executionContext) _Query_directiveFieldDef(ctx context.Context, field tmp, err := directive1(rctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if tmp == nil { return nil, nil @@ -6554,7 +6554,7 @@ func (ec *executionContext) _Query_directiveDouble(ctx context.Context, field gr tmp, err := directive2(rctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if tmp == nil { return nil, nil @@ -6602,7 +6602,7 @@ func (ec *executionContext) _Query_directiveUnimplemented(ctx context.Context, f tmp, err := directive1(rctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if tmp == nil { return nil, nil @@ -6800,7 +6800,7 @@ func (ec *executionContext) _Query_noShape(ctx context.Context, field graphql.Co tmp, err := directive1(rctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if tmp == nil { return nil, nil @@ -6879,7 +6879,7 @@ func (ec *executionContext) _Query_noShapeTypedNil(ctx context.Context, field gr tmp, err := directive1(rctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if tmp == nil { return nil, nil @@ -6927,7 +6927,7 @@ func (ec *executionContext) _Query_animal(ctx context.Context, field graphql.Col tmp, err := directive1(rctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if tmp == nil { return nil, nil @@ -8036,7 +8036,7 @@ func (ec *executionContext) _Subscription_directiveDouble(ctx context.Context, f tmp, err := directive2(rctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if tmp == nil { return nil, nil @@ -8094,7 +8094,7 @@ func (ec *executionContext) _Subscription_directiveUnimplemented(ctx context.Con tmp, err := directive1(rctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if tmp == nil { return nil, nil @@ -9647,7 +9647,7 @@ func (ec *executionContext) unmarshalInputInnerDirectives(ctx context.Context, o case "message": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("message")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("message")) directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalNString2string(ctx, v) } directive1 := func(ctx context.Context) (interface{}, error) { min, err := ec.unmarshalNInt2int(ctx, 1) @@ -9666,12 +9666,13 @@ func (ec *executionContext) unmarshalInputInnerDirectives(ctx context.Context, o tmp, err := directive1(ctx) if err != nil { - return it, err + return it, graphql.ErrorOnPath(ctx, err) } if data, ok := tmp.(string); ok { it.Message = data } else { - return it, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) + err := fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) } } } @@ -9688,7 +9689,7 @@ func (ec *executionContext) unmarshalInputInnerInput(ctx context.Context, obj in case "id": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("id")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) it.ID, err = ec.unmarshalNInt2int(ctx, v) if err != nil { return it, err @@ -9708,7 +9709,7 @@ func (ec *executionContext) unmarshalInputInputDirectives(ctx context.Context, o case "text": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("text")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalNString2string(ctx, v) } directive1 := func(ctx context.Context) (interface{}, error) { min, err := ec.unmarshalNInt2int(ctx, 0) @@ -9731,17 +9732,18 @@ func (ec *executionContext) unmarshalInputInputDirectives(ctx context.Context, o tmp, err := directive1(ctx) if err != nil { - return it, err + return it, graphql.ErrorOnPath(ctx, err) } if data, ok := tmp.(string); ok { it.Text = data } else { - return it, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) + err := fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) } case "nullableText": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("nullableText")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nullableText")) directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.ToNull == nil { @@ -9752,19 +9754,20 @@ func (ec *executionContext) unmarshalInputInputDirectives(ctx context.Context, o tmp, err := directive1(ctx) if err != nil { - return it, err + return it, graphql.ErrorOnPath(ctx, err) } if data, ok := tmp.(*string); ok { it.NullableText = data } else if tmp == nil { it.NullableText = nil } else { - return it, fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) } case "inner": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("inner")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("inner")) it.Inner, err = ec.unmarshalNInnerDirectives2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInnerDirectives(ctx, v) if err != nil { return it, err @@ -9772,7 +9775,7 @@ func (ec *executionContext) unmarshalInputInputDirectives(ctx context.Context, o case "innerNullable": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("innerNullable")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("innerNullable")) it.InnerNullable, err = ec.unmarshalOInnerDirectives2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInnerDirectives(ctx, v) if err != nil { return it, err @@ -9780,7 +9783,7 @@ func (ec *executionContext) unmarshalInputInputDirectives(ctx context.Context, o case "thirdParty": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("thirdParty")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("thirdParty")) directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOThirdParty2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐThirdParty(ctx, v) } @@ -9801,14 +9804,15 @@ func (ec *executionContext) unmarshalInputInputDirectives(ctx context.Context, o tmp, err := directive1(ctx) if err != nil { - return it, err + return it, graphql.ErrorOnPath(ctx, err) } if data, ok := tmp.(*ThirdParty); ok { it.ThirdParty = data } else if tmp == nil { it.ThirdParty = nil } else { - return it, fmt.Errorf(`unexpected type %T from directive, should be *github.com/99designs/gqlgen/codegen/testserver.ThirdParty`, tmp) + err := fmt.Errorf(`unexpected type %T from directive, should be *github.com/99designs/gqlgen/codegen/testserver.ThirdParty`, tmp) + return it, graphql.ErrorOnPath(ctx, err) } } } @@ -9825,7 +9829,7 @@ func (ec *executionContext) unmarshalInputInputWithEnumValue(ctx context.Context case "enum": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("enum")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enum")) it.Enum, err = ec.unmarshalNEnumTest2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐEnumTest(ctx, v) if err != nil { return it, err @@ -9845,7 +9849,7 @@ func (ec *executionContext) unmarshalInputNestedInput(ctx context.Context, obj i case "field": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("field")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) it.Field, err = ec.unmarshalNEmail2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐEmail(ctx, v) if err != nil { return it, err @@ -9865,7 +9869,7 @@ func (ec *executionContext) unmarshalInputNestedMapInput(ctx context.Context, ob case "map": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("map")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("map")) it.Map, err = ec.unmarshalOMapStringInterfaceInput2map(ctx, v) if err != nil { return it, err @@ -9885,7 +9889,7 @@ func (ec *executionContext) unmarshalInputOuterInput(ctx context.Context, obj in case "inner": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("inner")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("inner")) it.Inner, err = ec.unmarshalNInnerInput2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInnerInput(ctx, v) if err != nil { return it, err @@ -9905,7 +9909,7 @@ func (ec *executionContext) unmarshalInputRecursiveInputSlice(ctx context.Contex case "self": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("self")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("self")) it.Self, err = ec.unmarshalORecursiveInputSlice2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐRecursiveInputSliceᚄ(ctx, v) if err != nil { return it, err @@ -9925,7 +9929,7 @@ func (ec *executionContext) unmarshalInputSpecialInput(ctx context.Context, obj case "nesting": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("nesting")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nesting")) it.Nesting, err = ec.unmarshalNNestedInput2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐNestedInput(ctx, v) if err != nil { return it, err @@ -9945,7 +9949,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "break": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("break")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("break")) it.Break, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -9953,7 +9957,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "default": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("default")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("default")) it.Default, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -9961,7 +9965,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "func": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("func")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("func")) it.Func, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -9969,7 +9973,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "interface": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("interface")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("interface")) it.Interface, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -9977,7 +9981,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "select": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("select")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("select")) it.Select, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -9985,7 +9989,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "case": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("case")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("case")) it.Case, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -9993,7 +9997,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "defer": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("defer")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("defer")) it.Defer, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -10001,7 +10005,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "go": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("go")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("go")) it.Go, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -10009,7 +10013,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "map": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("map")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("map")) it.Map, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -10017,7 +10021,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "struct": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("struct")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("struct")) it.Struct, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -10025,7 +10029,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "chan": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("chan")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("chan")) it.Chan, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -10033,7 +10037,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "else": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("else")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("else")) it.Else, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -10041,7 +10045,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "goto": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("goto")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("goto")) it.Goto, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -10049,7 +10053,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "package": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("package")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("package")) it.Package, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -10057,7 +10061,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "switch": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("switch")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("switch")) it.Switch, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -10065,7 +10069,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "const": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("const")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("const")) it.Const, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -10073,7 +10077,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "fallthrough": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("fallthrough")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fallthrough")) it.Fallthrough, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -10081,7 +10085,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "if": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("if")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("if")) it.If, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -10089,7 +10093,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "range": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("range")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("range")) it.Range, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -10097,7 +10101,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "type": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("type")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) it.Type, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -10105,7 +10109,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "continue": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("continue")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("continue")) it.Continue, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -10113,7 +10117,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "for": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("for")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("for")) it.For, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -10121,7 +10125,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "import": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("import")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("import")) it.Import, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -10129,7 +10133,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "return": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("return")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("return")) it.Return, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -10137,7 +10141,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "var": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("var")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("var")) it.Var, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -10145,7 +10149,7 @@ func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj in case "_": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("_")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_")) it.Underscore, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -12923,7 +12927,7 @@ func (ec *executionContext) _iIt(ctx context.Context, sel ast.SelectionSet, obj func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -12938,7 +12942,7 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se func (ec *executionContext) unmarshalNBytes2ᚕbyte(ctx context.Context, v interface{}) ([]byte, error) { res, err := UnmarshalBytes(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNBytes2ᚕbyte(ctx context.Context, sel ast.SelectionSet, v []byte) graphql.Marshaler { @@ -12969,7 +12973,7 @@ func (ec *executionContext) marshalNCheckIssue8962ᚖgithubᚗcomᚋ99designsᚋ func (ec *executionContext) unmarshalNDefaultScalarImplementation2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNDefaultScalarImplementation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -12985,7 +12989,7 @@ func (ec *executionContext) marshalNDefaultScalarImplementation2string(ctx conte func (ec *executionContext) unmarshalNEmail2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐEmail(ctx context.Context, v interface{}) (Email, error) { var res Email err := res.UnmarshalGQL(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNEmail2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐEmail(ctx context.Context, sel ast.SelectionSet, v Email) graphql.Marshaler { @@ -12995,7 +12999,7 @@ func (ec *executionContext) marshalNEmail2githubᚗcomᚋ99designsᚋgqlgenᚋco func (ec *executionContext) unmarshalNEnumTest2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐEnumTest(ctx context.Context, v interface{}) (EnumTest, error) { var res EnumTest err := res.UnmarshalGQL(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNEnumTest2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐEnumTest(ctx context.Context, sel ast.SelectionSet, v EnumTest) graphql.Marshaler { @@ -13019,7 +13023,7 @@ func (ec *executionContext) marshalNError2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalNFallbackToStringEncoding2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐFallbackToStringEncoding(ctx context.Context, v interface{}) (FallbackToStringEncoding, error) { tmp, err := graphql.UnmarshalString(v) res := FallbackToStringEncoding(tmp) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNFallbackToStringEncoding2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐFallbackToStringEncoding(ctx context.Context, sel ast.SelectionSet, v FallbackToStringEncoding) graphql.Marshaler { @@ -13034,7 +13038,7 @@ func (ec *executionContext) marshalNFallbackToStringEncoding2githubᚗcomᚋ99de func (ec *executionContext) unmarshalNID2int(ctx context.Context, v interface{}) (int, error) { res, err := graphql.UnmarshalIntID(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNID2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { @@ -13049,7 +13053,7 @@ func (ec *executionContext) marshalNID2int(ctx context.Context, sel ast.Selectio func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalID(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -13064,17 +13068,17 @@ func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.Selec func (ec *executionContext) unmarshalNInnerDirectives2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInnerDirectives(ctx context.Context, v interface{}) (*InnerDirectives, error) { res, err := ec.unmarshalInputInnerDirectives(ctx, v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) unmarshalNInnerInput2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInnerInput(ctx context.Context, v interface{}) (InnerInput, error) { res, err := ec.unmarshalInputInnerInput(ctx, v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) unmarshalNInnerInput2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInnerInput(ctx context.Context, v interface{}) (*InnerInput, error) { res, err := ec.unmarshalInputInnerInput(ctx, v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNInnerObject2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInnerObject(ctx context.Context, sel ast.SelectionSet, v *InnerObject) graphql.Marshaler { @@ -13089,12 +13093,12 @@ func (ec *executionContext) marshalNInnerObject2ᚖgithubᚗcomᚋ99designsᚋgq func (ec *executionContext) unmarshalNInputDirectives2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInputDirectives(ctx context.Context, v interface{}) (InputDirectives, error) { res, err := ec.unmarshalInputInputDirectives(ctx, v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { res, err := graphql.UnmarshalInt(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { @@ -13109,7 +13113,7 @@ func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.Selecti func (ec *executionContext) unmarshalNInt2int32(ctx context.Context, v interface{}) (int32, error) { res, err := graphql.UnmarshalInt32(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNInt2int32(ctx context.Context, sel ast.SelectionSet, v int32) graphql.Marshaler { @@ -13124,7 +13128,7 @@ func (ec *executionContext) marshalNInt2int32(ctx context.Context, sel ast.Selec func (ec *executionContext) unmarshalNInt2int64(ctx context.Context, v interface{}) (int64, error) { res, err := graphql.UnmarshalInt64(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNInt2int64(ctx context.Context, sel ast.SelectionSet, v int64) graphql.Marshaler { @@ -13160,7 +13164,7 @@ func (ec *executionContext) marshalNLoopB2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalNMarshalPanic2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐMarshalPanic(ctx context.Context, v interface{}) (MarshalPanic, error) { var res MarshalPanic err := res.UnmarshalGQL(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNMarshalPanic2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐMarshalPanic(ctx context.Context, sel ast.SelectionSet, v MarshalPanic) graphql.Marshaler { @@ -13179,10 +13183,10 @@ func (ec *executionContext) unmarshalNMarshalPanic2ᚕgithubᚗcomᚋ99designs var err error res := make([]MarshalPanic, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalNMarshalPanic2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐMarshalPanic(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -13199,7 +13203,7 @@ func (ec *executionContext) marshalNMarshalPanic2ᚕgithubᚗcomᚋ99designsᚋg func (ec *executionContext) unmarshalNNestedInput2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐNestedInput(ctx context.Context, v interface{}) (*NestedInput, error) { res, err := ec.unmarshalInputNestedInput(ctx, v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNNode2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐNode(ctx context.Context, sel ast.SelectionSet, v Node) graphql.Marshaler { @@ -13296,7 +13300,7 @@ func (ec *executionContext) marshalNPrimitiveString2ᚕgithubᚗcomᚋ99designs func (ec *executionContext) unmarshalNRecursiveInputSlice2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐRecursiveInputSlice(ctx context.Context, v interface{}) (RecursiveInputSlice, error) { res, err := ec.unmarshalInputRecursiveInputSlice(ctx, v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNShapeUnion2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐShapeUnion(ctx context.Context, sel ast.SelectionSet, v ShapeUnion) graphql.Marshaler { @@ -13311,12 +13315,12 @@ func (ec *executionContext) marshalNShapeUnion2githubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalNSpecialInput2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐSpecialInput(ctx context.Context, v interface{}) (SpecialInput, error) { res, err := ec.unmarshalInputSpecialInput(ctx, v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -13341,10 +13345,10 @@ func (ec *executionContext) unmarshalNString2ᚕstringᚄ(ctx context.Context, v var err error res := make([]string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -13371,10 +13375,10 @@ func (ec *executionContext) unmarshalNString2ᚕᚖstring(ctx context.Context, v var err error res := make([]*string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalOString2ᚖstring(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -13391,7 +13395,7 @@ func (ec *executionContext) marshalNString2ᚕᚖstring(ctx context.Context, sel func (ec *executionContext) unmarshalNString2ᚖstring(ctx context.Context, v interface{}) (*string, error) { res, err := graphql.UnmarshalString(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { @@ -13412,7 +13416,7 @@ func (ec *executionContext) marshalNString2ᚖstring(ctx context.Context, sel as func (ec *executionContext) unmarshalNTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { res, err := graphql.UnmarshalTime(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { @@ -13427,7 +13431,7 @@ func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel as func (ec *executionContext) unmarshalNUUID2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNUUID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -13504,7 +13508,7 @@ func (ec *executionContext) marshalNWrappedMap2githubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalNWrappedScalar2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋotherpkgᚐScalar(ctx context.Context, v interface{}) (otherpkg.Scalar, error) { tmp, err := graphql.UnmarshalString(v) res := otherpkg.Scalar(tmp) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNWrappedScalar2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋotherpkgᚐScalar(ctx context.Context, sel ast.SelectionSet, v otherpkg.Scalar) graphql.Marshaler { @@ -13584,7 +13588,7 @@ func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgq func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -13609,10 +13613,10 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte var err error res := make([]string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -13757,7 +13761,7 @@ func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -13793,7 +13797,7 @@ func (ec *executionContext) marshalOBackedByInterface2githubᚗcomᚋ99designs func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -13805,7 +13809,7 @@ func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v int return nil, nil } res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { @@ -13921,7 +13925,7 @@ func (ec *executionContext) unmarshalODefaultScalarImplementation2ᚖstring(ctx return nil, nil } res, err := graphql.UnmarshalString(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalODefaultScalarImplementation2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { @@ -13968,7 +13972,7 @@ func (ec *executionContext) marshalOErrors2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalOFloat2float64(ctx context.Context, v interface{}) (float64, error) { res, err := graphql.UnmarshalFloat(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { @@ -13980,7 +13984,7 @@ func (ec *executionContext) unmarshalOInnerDirectives2ᚖgithubᚗcomᚋ99design return nil, nil } res, err := ec.unmarshalInputInnerDirectives(ctx, v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) unmarshalOInputDirectives2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInputDirectives(ctx context.Context, v interface{}) (*InputDirectives, error) { @@ -13988,7 +13992,7 @@ func (ec *executionContext) unmarshalOInputDirectives2ᚖgithubᚗcomᚋ99design return nil, nil } res, err := ec.unmarshalInputInputDirectives(ctx, v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) unmarshalOInputWithEnumValue2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInputWithEnumValue(ctx context.Context, v interface{}) (*InputWithEnumValue, error) { @@ -13996,7 +14000,7 @@ func (ec *executionContext) unmarshalOInputWithEnumValue2ᚖgithubᚗcomᚋ99des return nil, nil } res, err := ec.unmarshalInputInputWithEnumValue(ctx, v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interface{}) (*int, error) { @@ -14004,7 +14008,7 @@ func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interfac return nil, nil } res, err := graphql.UnmarshalInt(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler { @@ -14054,7 +14058,7 @@ func (ec *executionContext) unmarshalONestedMapInput2ᚖgithubᚗcomᚋ99designs return nil, nil } res, err := ec.unmarshalInputNestedMapInput(ctx, v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOObjectDirectives2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐObjectDirectives(ctx context.Context, sel ast.SelectionSet, v *ObjectDirectives) graphql.Marshaler { @@ -14086,10 +14090,10 @@ func (ec *executionContext) unmarshalOOuterInput2ᚕᚕᚖgithubᚗcomᚋ99desig var err error res := make([][]*OuterInput, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalOOuterInput2ᚕᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐOuterInput(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -14110,10 +14114,10 @@ func (ec *executionContext) unmarshalOOuterInput2ᚕᚖgithubᚗcomᚋ99designs var err error res := make([]*OuterInput, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalOOuterInput2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐOuterInput(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -14124,7 +14128,7 @@ func (ec *executionContext) unmarshalOOuterInput2ᚖgithubᚗcomᚋ99designsᚋg return nil, nil } res, err := ec.unmarshalInputOuterInput(ctx, v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOOuterObject2ᚕᚕᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐOuterObject(ctx context.Context, sel ast.SelectionSet, v [][]*OuterObject) graphql.Marshaler { @@ -14243,10 +14247,10 @@ func (ec *executionContext) unmarshalORecursiveInputSlice2ᚕgithubᚗcomᚋ99de var err error res := make([]RecursiveInputSlice, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalNRecursiveInputSlice2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐRecursiveInputSlice(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -14257,7 +14261,7 @@ func (ec *executionContext) unmarshalORecursiveInputSlice2ᚖgithubᚗcomᚋ99de return nil, nil } res, err := ec.unmarshalInputRecursiveInputSlice(ctx, v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOShape2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐShape(ctx context.Context, sel ast.SelectionSet, v Shape) graphql.Marshaler { @@ -14316,7 +14320,7 @@ func (ec *executionContext) marshalOSlices2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -14338,10 +14342,10 @@ func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v var err error res := make([]string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -14374,10 +14378,10 @@ func (ec *executionContext) unmarshalOString2ᚕᚖstring(ctx context.Context, v var err error res := make([]*string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalOString2ᚖstring(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -14400,7 +14404,7 @@ func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v in return nil, nil } res, err := graphql.UnmarshalString(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { @@ -14422,7 +14426,7 @@ func (ec *executionContext) unmarshalOThirdParty2ᚖgithubᚗcomᚋ99designsᚋg return nil, nil } res, err := UnmarshalThirdParty(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOThirdParty2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐThirdParty(ctx context.Context, sel ast.SelectionSet, v *ThirdParty) graphql.Marshaler { @@ -14437,7 +14441,7 @@ func (ec *executionContext) unmarshalOTime2ᚖtimeᚐTime(ctx context.Context, v return nil, nil } res, err := graphql.UnmarshalTime(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOTime2ᚖtimeᚐTime(ctx context.Context, sel ast.SelectionSet, v *time.Time) graphql.Marshaler { @@ -14452,7 +14456,7 @@ func (ec *executionContext) unmarshalOValidInput2ᚖgithubᚗcomᚋ99designsᚋg return nil, nil } res, err := ec.unmarshalInputValidInput(ctx, v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOValidType2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐValidType(ctx context.Context, sel ast.SelectionSet, v *ValidType) graphql.Marshaler { @@ -14468,7 +14472,7 @@ func (ec *executionContext) unmarshalOWrappedScalar2ᚖgithubᚗcomᚋ99designs } tmp, err := graphql.UnmarshalString(v) res := otherpkg.Scalar(tmp) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOWrappedScalar2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋotherpkgᚐScalar(ctx context.Context, sel ast.SelectionSet, v *otherpkg.Scalar) graphql.Marshaler { diff --git a/codegen/testserver/panics_test.go b/codegen/testserver/panics_test.go index 68903391496..0e1cf838004 100644 --- a/codegen/testserver/panics_test.go +++ b/codegen/testserver/panics_test.go @@ -33,7 +33,7 @@ func TestPanics(t *testing.T) { srv.SetErrorPresenter(func(ctx context.Context, err error) *gqlerror.Error { return &gqlerror.Error{ Message: "presented: " + err.Error(), - Path: graphql.GetFieldContext(ctx).Path(), + Path: graphql.GetPath(ctx), } }) @@ -50,14 +50,14 @@ func TestPanics(t *testing.T) { var resp interface{} err := c.Post(`query { panics { argUnmarshal(u: ["aa", "bb"]) } }`, &resp) - require.EqualError(t, err, "[{\"message\":\"presented: panic: BOOM\",\"path\":[\"panics\",\"argUnmarshal\"]}]") + require.EqualError(t, err, "[{\"message\":\"presented: input: panics.argUnmarshal panic: BOOM\",\"path\":[\"panics\",\"argUnmarshal\"]}]") }) t.Run("panics in funcs unmarshal return errors", func(t *testing.T) { var resp interface{} err := c.Post(`query { panics { fieldFuncMarshal(u: ["aa", "bb"]) } }`, &resp) - require.EqualError(t, err, "[{\"message\":\"presented: panic: BOOM\",\"path\":[\"panics\",\"fieldFuncMarshal\"]}]") + require.EqualError(t, err, "[{\"message\":\"presented: input: panics.fieldFuncMarshal panic: BOOM\",\"path\":[\"panics\",\"fieldFuncMarshal\"]}]") }) t.Run("panics in funcs marshal return errors", func(t *testing.T) { diff --git a/codegen/type.gotpl b/codegen/type.gotpl index 2bd0c1943a1..bd5c8435113 100644 --- a/codegen/type.gotpl +++ b/codegen/type.gotpl @@ -16,10 +16,10 @@ var err error res := make([]{{$type.GO.Elem | ref}}, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.{{ $type.Elem.UnmarshalFunc }}(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -36,11 +36,11 @@ res, err := {{ $type.Unmarshaler | call }}(v) {{- end }} {{- if and $type.IsTargetNilable (not $type.IsNilable) }} - return *res, graphql.WrapErrorWithInputPath(ctx, err) + return *res, graphql.ErrorOnPath(ctx, err) {{- else if and (not $type.IsTargetNilable) $type.IsNilable }} - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) {{- else}} - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) {{- end }} {{- else if eq ($type.GO | ref) "map[string]interface{}" }} return v.(map[string]interface{}), nil @@ -51,13 +51,13 @@ var res {{ $type.GO | ref }} {{- end }} err := res.UnmarshalGQL(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) {{- else }} res, err := ec.unmarshalInput{{ $type.GQL.Name }}(ctx, v) {{- if $type.IsNilable }} - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) {{- else}} - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) {{- end }} {{- end }} {{- end }} diff --git a/example/chat/generated.go b/example/chat/generated.go index b5fd7e04150..5bb2e13a5ca 100644 --- a/example/chat/generated.go +++ b/example/chat/generated.go @@ -296,7 +296,7 @@ func (ec *executionContext) dir_user_args(ctx context.Context, rawArgs map[strin args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["username"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("username")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -311,7 +311,7 @@ func (ec *executionContext) field_Mutation_post_args(ctx context.Context, rawArg args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["text"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("text")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -320,7 +320,7 @@ func (ec *executionContext) field_Mutation_post_args(ctx context.Context, rawArg args["text"] = arg0 var arg1 string if tmp, ok := rawArgs["username"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("username")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username")) arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -329,7 +329,7 @@ func (ec *executionContext) field_Mutation_post_args(ctx context.Context, rawArg args["username"] = arg1 var arg2 string if tmp, ok := rawArgs["roomName"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("roomName")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roomName")) arg2, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -344,7 +344,7 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("name")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -359,7 +359,7 @@ func (ec *executionContext) field_Query_room_args(ctx context.Context, rawArgs m args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("name")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -374,7 +374,7 @@ func (ec *executionContext) field_Subscription_messageAdded_args(ctx context.Con args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["roomName"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("roomName")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roomName")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -389,7 +389,7 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -404,7 +404,7 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -2338,7 +2338,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2353,7 +2353,7 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalID(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2419,7 +2419,7 @@ func (ec *executionContext) marshalNMessage2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2434,7 +2434,7 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S func (ec *executionContext) unmarshalNTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { res, err := graphql.UnmarshalTime(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { @@ -2490,7 +2490,7 @@ func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgq func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2515,10 +2515,10 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte var err error res := make([]string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2663,7 +2663,7 @@ func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2678,7 +2678,7 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2690,7 +2690,7 @@ func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v int return nil, nil } res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { @@ -2709,7 +2709,7 @@ func (ec *executionContext) marshalOChatroom2ᚖgithubᚗcomᚋ99designsᚋgqlge func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2721,7 +2721,7 @@ func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v in return nil, nil } res, err := graphql.UnmarshalString(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { diff --git a/example/config/generated.go b/example/config/generated.go index eeb0a407417..25e1195a48f 100644 --- a/example/config/generated.go +++ b/example/config/generated.go @@ -264,7 +264,7 @@ func (ec *executionContext) field_Mutation_createTodo_args(ctx context.Context, args := map[string]interface{}{} var arg0 NewTodo if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("input")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) arg0, err = ec.unmarshalNNewTodo2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋconfigᚐNewTodo(ctx, tmp) if err != nil { return nil, err @@ -279,7 +279,7 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("name")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -294,7 +294,7 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -309,7 +309,7 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -1773,7 +1773,7 @@ func (ec *executionContext) unmarshalInputNewTodo(ctx context.Context, obj inter case "text": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("text")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) it.Text, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -1781,7 +1781,7 @@ func (ec *executionContext) unmarshalInputNewTodo(ctx context.Context, obj inter case "userId": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("userId")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userId")) it.UserID, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -2210,7 +2210,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2225,7 +2225,7 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalID(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2240,7 +2240,7 @@ func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.Selec func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { res, err := graphql.UnmarshalInt(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { @@ -2255,12 +2255,12 @@ func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.Selecti func (ec *executionContext) unmarshalNNewTodo2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋconfigᚐNewTodo(ctx context.Context, v interface{}) (NewTodo, error) { res, err := ec.unmarshalInputNewTodo(ctx, v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2377,7 +2377,7 @@ func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgq func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2402,10 +2402,10 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte var err error res := make([]string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2550,7 +2550,7 @@ func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2565,7 +2565,7 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2577,7 +2577,7 @@ func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v int return nil, nil } res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { @@ -2589,7 +2589,7 @@ func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2611,10 +2611,10 @@ func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v var err error res := make([]string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2637,7 +2637,7 @@ func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v in return nil, nil } res, err := graphql.UnmarshalString(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { diff --git a/example/dataloader/generated.go b/example/dataloader/generated.go index 8134878b664..7b1465aaacf 100644 --- a/example/dataloader/generated.go +++ b/example/dataloader/generated.go @@ -313,7 +313,7 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("name")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -328,7 +328,7 @@ func (ec *executionContext) field_Query_torture1d_args(ctx context.Context, rawA args := map[string]interface{}{} var arg0 []int if tmp, ok := rawArgs["customerIds"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("customerIds")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("customerIds")) arg0, err = ec.unmarshalOInt2ᚕintᚄ(ctx, tmp) if err != nil { return nil, err @@ -343,7 +343,7 @@ func (ec *executionContext) field_Query_torture2d_args(ctx context.Context, rawA args := map[string]interface{}{} var arg0 [][]int if tmp, ok := rawArgs["customerIds"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("customerIds")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("customerIds")) arg0, err = ec.unmarshalOInt2ᚕᚕint(ctx, tmp) if err != nil { return nil, err @@ -358,7 +358,7 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -373,7 +373,7 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -2505,7 +2505,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2530,7 +2530,7 @@ func (ec *executionContext) marshalNCustomer2ᚖgithubᚗcomᚋ99designsᚋgqlge func (ec *executionContext) unmarshalNFloat2float64(ctx context.Context, v interface{}) (float64, error) { res, err := graphql.UnmarshalFloat(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { @@ -2545,7 +2545,7 @@ func (ec *executionContext) marshalNFloat2float64(ctx context.Context, sel ast.S func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { res, err := graphql.UnmarshalInt(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { @@ -2580,7 +2580,7 @@ func (ec *executionContext) marshalNOrder2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2595,7 +2595,7 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S func (ec *executionContext) unmarshalNTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { res, err := graphql.UnmarshalTime(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { @@ -2651,7 +2651,7 @@ func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgq func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2676,10 +2676,10 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte var err error res := make([]string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2824,7 +2824,7 @@ func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2846,7 +2846,7 @@ func (ec *executionContext) marshalOAddress2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2858,7 +2858,7 @@ func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v int return nil, nil } res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { @@ -2963,10 +2963,10 @@ func (ec *executionContext) unmarshalOInt2ᚕintᚄ(ctx context.Context, v inter var err error res := make([]int, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalNInt2int(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2999,10 +2999,10 @@ func (ec *executionContext) unmarshalOInt2ᚕᚕint(ctx context.Context, v inter var err error res := make([][]int, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalOInt2ᚕintᚄ(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -3102,7 +3102,7 @@ func (ec *executionContext) marshalOOrder2ᚕᚖgithubᚗcomᚋ99designsᚋgqlge func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -3114,7 +3114,7 @@ func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v in return nil, nil } res, err := graphql.UnmarshalString(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { diff --git a/example/federation/accounts/graph/generated/generated.go b/example/federation/accounts/graph/generated/generated.go index 5be65e7e97f..c5754701feb 100644 --- a/example/federation/accounts/graph/generated/generated.go +++ b/example/federation/accounts/graph/generated/generated.go @@ -246,7 +246,7 @@ func (ec *executionContext) field_Entity_findUserByID_args(ctx context.Context, args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("id")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) arg0, err = ec.unmarshalNID2string(ctx, tmp) if err != nil { return nil, err @@ -261,7 +261,7 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("name")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -276,7 +276,7 @@ func (ec *executionContext) field_Query__entities_args(ctx context.Context, rawA args := map[string]interface{}{} var arg0 []map[string]interface{} if tmp, ok := rawArgs["representations"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("representations")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("representations")) arg0, err = ec.unmarshalN_Any2ᚕmapᚄ(ctx, tmp) if err != nil { return nil, err @@ -291,7 +291,7 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -306,7 +306,7 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -2130,7 +2130,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2145,7 +2145,7 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalID(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2160,7 +2160,7 @@ func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.Selec func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2189,7 +2189,7 @@ func (ec *executionContext) marshalNUser2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋ func (ec *executionContext) unmarshalN_Any2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { res, err := graphql.UnmarshalMap(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN_Any2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { @@ -2220,10 +2220,10 @@ func (ec *executionContext) unmarshalN_Any2ᚕmapᚄ(ctx context.Context, v inte var err error res := make([]map[string]interface{}, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalN_Any2map(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2277,7 +2277,7 @@ func (ec *executionContext) marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalN_FieldSet2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN_FieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2337,7 +2337,7 @@ func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgq func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2362,10 +2362,10 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte var err error res := make([]string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2510,7 +2510,7 @@ func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2525,7 +2525,7 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2537,7 +2537,7 @@ func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v int return nil, nil } res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { @@ -2549,7 +2549,7 @@ func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2561,7 +2561,7 @@ func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v in return nil, nil } res, err := graphql.UnmarshalString(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { diff --git a/example/federation/products/graph/generated/generated.go b/example/federation/products/graph/generated/generated.go index dd268c6b6fa..70435634962 100644 --- a/example/federation/products/graph/generated/generated.go +++ b/example/federation/products/graph/generated/generated.go @@ -260,7 +260,7 @@ func (ec *executionContext) field_Entity_findProductByUpc_args(ctx context.Conte args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["upc"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("upc")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("upc")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -275,7 +275,7 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("name")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -290,7 +290,7 @@ func (ec *executionContext) field_Query__entities_args(ctx context.Context, rawA args := map[string]interface{}{} var arg0 []map[string]interface{} if tmp, ok := rawArgs["representations"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("representations")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("representations")) arg0, err = ec.unmarshalN_Any2ᚕmapᚄ(ctx, tmp) if err != nil { return nil, err @@ -305,7 +305,7 @@ func (ec *executionContext) field_Query_topProducts_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 *int if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("first")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) arg0, err = ec.unmarshalOInt2ᚖint(ctx, tmp) if err != nil { return nil, err @@ -320,7 +320,7 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -335,7 +335,7 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -2205,7 +2205,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2220,7 +2220,7 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { res, err := graphql.UnmarshalInt(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { @@ -2249,7 +2249,7 @@ func (ec *executionContext) marshalNProduct2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2264,7 +2264,7 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S func (ec *executionContext) unmarshalN_Any2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { res, err := graphql.UnmarshalMap(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN_Any2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { @@ -2295,10 +2295,10 @@ func (ec *executionContext) unmarshalN_Any2ᚕmapᚄ(ctx context.Context, v inte var err error res := make([]map[string]interface{}, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalN_Any2map(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2352,7 +2352,7 @@ func (ec *executionContext) marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalN_FieldSet2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN_FieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2412,7 +2412,7 @@ func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgq func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2437,10 +2437,10 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte var err error res := make([]string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2585,7 +2585,7 @@ func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2600,7 +2600,7 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2612,7 +2612,7 @@ func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v int return nil, nil } res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { @@ -2627,7 +2627,7 @@ func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interfac return nil, nil } res, err := graphql.UnmarshalInt(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler { @@ -2686,7 +2686,7 @@ func (ec *executionContext) marshalOProduct2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2698,7 +2698,7 @@ func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v in return nil, nil } res, err := graphql.UnmarshalString(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { diff --git a/example/federation/reviews/graph/generated/generated.go b/example/federation/reviews/graph/generated/generated.go index 80bd200a98e..002d2d5dac9 100644 --- a/example/federation/reviews/graph/generated/generated.go +++ b/example/federation/reviews/graph/generated/generated.go @@ -310,7 +310,7 @@ func (ec *executionContext) field_Entity_findProductByUpc_args(ctx context.Conte args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["upc"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("upc")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("upc")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -325,7 +325,7 @@ func (ec *executionContext) field_Entity_findUserByID_args(ctx context.Context, args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("id")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) arg0, err = ec.unmarshalNID2string(ctx, tmp) if err != nil { return nil, err @@ -340,7 +340,7 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("name")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -355,7 +355,7 @@ func (ec *executionContext) field_Query__entities_args(ctx context.Context, rawA args := map[string]interface{}{} var arg0 []map[string]interface{} if tmp, ok := rawArgs["representations"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("representations")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("representations")) arg0, err = ec.unmarshalN_Any2ᚕmapᚄ(ctx, tmp) if err != nil { return nil, err @@ -370,7 +370,7 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -385,7 +385,7 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -2474,7 +2474,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2489,7 +2489,7 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalID(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2518,7 +2518,7 @@ func (ec *executionContext) marshalNProduct2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2547,7 +2547,7 @@ func (ec *executionContext) marshalNUser2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋ func (ec *executionContext) unmarshalN_Any2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { res, err := graphql.UnmarshalMap(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN_Any2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { @@ -2578,10 +2578,10 @@ func (ec *executionContext) unmarshalN_Any2ᚕmapᚄ(ctx context.Context, v inte var err error res := make([]map[string]interface{}, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalN_Any2map(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2635,7 +2635,7 @@ func (ec *executionContext) marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalN_FieldSet2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN_FieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2695,7 +2695,7 @@ func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgq func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2720,10 +2720,10 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte var err error res := make([]string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2868,7 +2868,7 @@ func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2883,7 +2883,7 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2895,7 +2895,7 @@ func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v int return nil, nil } res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { @@ -2954,7 +2954,7 @@ func (ec *executionContext) marshalOReview2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2966,7 +2966,7 @@ func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v in return nil, nil } res, err := graphql.UnmarshalString(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { diff --git a/example/fileupload/generated.go b/example/fileupload/generated.go index 54ab565a842..20aab6c69c4 100644 --- a/example/fileupload/generated.go +++ b/example/fileupload/generated.go @@ -277,7 +277,7 @@ func (ec *executionContext) field_Mutation_multipleUploadWithPayload_args(ctx co args := map[string]interface{}{} var arg0 []*model.UploadFile if tmp, ok := rawArgs["req"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("req")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("req")) arg0, err = ec.unmarshalNUploadFile2ᚕᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋfileuploadᚋmodelᚐUploadFileᚄ(ctx, tmp) if err != nil { return nil, err @@ -292,7 +292,7 @@ func (ec *executionContext) field_Mutation_multipleUpload_args(ctx context.Conte args := map[string]interface{}{} var arg0 []*graphql.Upload if tmp, ok := rawArgs["files"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("files")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("files")) arg0, err = ec.unmarshalNUpload2ᚕᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUploadᚄ(ctx, tmp) if err != nil { return nil, err @@ -307,7 +307,7 @@ func (ec *executionContext) field_Mutation_singleUploadWithPayload_args(ctx cont args := map[string]interface{}{} var arg0 model.UploadFile if tmp, ok := rawArgs["req"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("req")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("req")) arg0, err = ec.unmarshalNUploadFile2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋfileuploadᚋmodelᚐUploadFile(ctx, tmp) if err != nil { return nil, err @@ -322,7 +322,7 @@ func (ec *executionContext) field_Mutation_singleUpload_args(ctx context.Context args := map[string]interface{}{} var arg0 graphql.Upload if tmp, ok := rawArgs["file"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("file")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("file")) arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) if err != nil { return nil, err @@ -337,7 +337,7 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("name")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -352,7 +352,7 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -367,7 +367,7 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -1852,7 +1852,7 @@ func (ec *executionContext) unmarshalInputUploadFile(ctx context.Context, obj in case "id": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("id")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) it.ID, err = ec.unmarshalNInt2int(ctx, v) if err != nil { return it, err @@ -1860,7 +1860,7 @@ func (ec *executionContext) unmarshalInputUploadFile(ctx context.Context, obj in case "file": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("file")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("file")) it.File, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, v) if err != nil { return it, err @@ -2258,7 +2258,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2324,7 +2324,7 @@ func (ec *executionContext) marshalNFile2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋ func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { res, err := graphql.UnmarshalInt(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { @@ -2339,7 +2339,7 @@ func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.Selecti func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2354,7 +2354,7 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S func (ec *executionContext) unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx context.Context, v interface{}) (graphql.Upload, error) { res, err := graphql.UnmarshalUpload(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx context.Context, sel ast.SelectionSet, v graphql.Upload) graphql.Marshaler { @@ -2379,10 +2379,10 @@ func (ec *executionContext) unmarshalNUpload2ᚕᚖgithubᚗcomᚋ99designsᚋgq var err error res := make([]*graphql.Upload, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalNUpload2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2399,7 +2399,7 @@ func (ec *executionContext) marshalNUpload2ᚕᚖgithubᚗcomᚋ99designsᚋgqlg func (ec *executionContext) unmarshalNUpload2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx context.Context, v interface{}) (*graphql.Upload, error) { res, err := graphql.UnmarshalUpload(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNUpload2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx context.Context, sel ast.SelectionSet, v *graphql.Upload) graphql.Marshaler { @@ -2420,7 +2420,7 @@ func (ec *executionContext) marshalNUpload2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalNUploadFile2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋfileuploadᚋmodelᚐUploadFile(ctx context.Context, v interface{}) (model.UploadFile, error) { res, err := ec.unmarshalInputUploadFile(ctx, v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) unmarshalNUploadFile2ᚕᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋfileuploadᚋmodelᚐUploadFileᚄ(ctx context.Context, v interface{}) ([]*model.UploadFile, error) { @@ -2435,10 +2435,10 @@ func (ec *executionContext) unmarshalNUploadFile2ᚕᚖgithubᚗcomᚋ99designs var err error res := make([]*model.UploadFile, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalNUploadFile2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋfileuploadᚋmodelᚐUploadFile(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2446,7 +2446,7 @@ func (ec *executionContext) unmarshalNUploadFile2ᚕᚖgithubᚗcomᚋ99designs func (ec *executionContext) unmarshalNUploadFile2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋfileuploadᚋmodelᚐUploadFile(ctx context.Context, v interface{}) (*model.UploadFile, error) { res, err := ec.unmarshalInputUploadFile(ctx, v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { @@ -2492,7 +2492,7 @@ func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgq func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2517,10 +2517,10 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte var err error res := make([]string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2665,7 +2665,7 @@ func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2680,7 +2680,7 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2692,7 +2692,7 @@ func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v int return nil, nil } res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { @@ -2704,7 +2704,7 @@ func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2716,7 +2716,7 @@ func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v in return nil, nil } res, err := graphql.UnmarshalString(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { diff --git a/example/scalars/generated.go b/example/scalars/generated.go index a47102b0849..63920f7dddb 100644 --- a/example/scalars/generated.go +++ b/example/scalars/generated.go @@ -327,7 +327,7 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("name")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -342,7 +342,7 @@ func (ec *executionContext) field_Query_search_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 *model.SearchArgs if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("input")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) arg0, err = ec.unmarshalOSearchArgs2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐSearchArgs(ctx, tmp) if err != nil { return nil, err @@ -357,7 +357,7 @@ func (ec *executionContext) field_Query_userByTier_args(ctx context.Context, raw args := map[string]interface{}{} var arg0 model.Tier if tmp, ok := rawArgs["tier"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("tier")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tier")) arg0, err = ec.unmarshalNTier2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐTier(ctx, tmp) if err != nil { return nil, err @@ -366,7 +366,7 @@ func (ec *executionContext) field_Query_userByTier_args(ctx context.Context, raw args["tier"] = arg0 var arg1 *model.Prefs if tmp, ok := rawArgs["darkMode"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("darkMode")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("darkMode")) arg1, err = ec.unmarshalNDarkMode2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐPrefs(ctx, tmp) if err != nil { return nil, err @@ -381,7 +381,7 @@ func (ec *executionContext) field_Query_user_args(ctx context.Context, rawArgs m args := map[string]interface{}{} var arg0 external.ObjectID if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("id")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) arg0, err = ec.unmarshalNID2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋexternalᚐObjectID(ctx, tmp) if err != nil { return nil, err @@ -396,7 +396,7 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -411,7 +411,7 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -2103,7 +2103,7 @@ func (ec *executionContext) unmarshalInputSearchArgs(ctx context.Context, obj in case "location": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("location")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("location")) it.Location, err = ec.unmarshalOPoint2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐPoint(ctx, v) if err != nil { return it, err @@ -2111,7 +2111,7 @@ func (ec *executionContext) unmarshalInputSearchArgs(ctx context.Context, obj in case "createdAfter": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("createdAfter")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAfter")) it.CreatedAfter, err = ec.unmarshalOTimestamp2ᚖtimeᚐTime(ctx, v) if err != nil { return it, err @@ -2119,7 +2119,7 @@ func (ec *executionContext) unmarshalInputSearchArgs(ctx context.Context, obj in case "isBanned": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("isBanned")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isBanned")) it.IsBanned, err = ec.unmarshalOBanned2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐBanned(ctx, v) if err != nil { return it, err @@ -2561,7 +2561,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) unmarshalNBanned2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐBanned(ctx context.Context, v interface{}) (model.Banned, error) { var res model.Banned err := res.UnmarshalGQL(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNBanned2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐBanned(ctx context.Context, sel ast.SelectionSet, v model.Banned) graphql.Marshaler { @@ -2570,7 +2570,7 @@ func (ec *executionContext) marshalNBanned2githubᚗcomᚋ99designsᚋgqlgenᚋe func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2585,7 +2585,7 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se func (ec *executionContext) unmarshalNDarkMode2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐPrefs(ctx context.Context, v interface{}) (*model.Prefs, error) { res, err := model.UnmarshalPreferences(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNDarkMode2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐPrefs(ctx context.Context, sel ast.SelectionSet, v *model.Prefs) graphql.Marshaler { @@ -2606,7 +2606,7 @@ func (ec *executionContext) marshalNDarkMode2ᚖgithubᚗcomᚋ99designsᚋgqlge func (ec *executionContext) unmarshalNID2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋexternalᚐObjectID(ctx context.Context, v interface{}) (external.ObjectID, error) { res, err := model.UnmarshalID(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNID2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋexternalᚐObjectID(ctx context.Context, sel ast.SelectionSet, v external.ObjectID) graphql.Marshaler { @@ -2622,7 +2622,7 @@ func (ec *executionContext) marshalNID2githubᚗcomᚋ99designsᚋgqlgenᚋexamp func (ec *executionContext) unmarshalNPoint2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐPoint(ctx context.Context, v interface{}) (model.Point, error) { var res model.Point err := res.UnmarshalGQL(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNPoint2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐPoint(ctx context.Context, sel ast.SelectionSet, v model.Point) graphql.Marshaler { @@ -2632,7 +2632,7 @@ func (ec *executionContext) marshalNPoint2githubᚗcomᚋ99designsᚋgqlgenᚋex func (ec *executionContext) unmarshalNPoint2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐPoint(ctx context.Context, v interface{}) (*model.Point, error) { var res = new(model.Point) err := res.UnmarshalGQL(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNPoint2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐPoint(ctx context.Context, sel ast.SelectionSet, v *model.Point) graphql.Marshaler { @@ -2647,7 +2647,7 @@ func (ec *executionContext) marshalNPoint2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2663,7 +2663,7 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S func (ec *executionContext) unmarshalNTier2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐTier(ctx context.Context, v interface{}) (model.Tier, error) { var res model.Tier err := res.UnmarshalGQL(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNTier2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐTier(ctx context.Context, sel ast.SelectionSet, v model.Tier) graphql.Marshaler { @@ -2760,7 +2760,7 @@ func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgq func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2785,10 +2785,10 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte var err error res := make([]string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2933,7 +2933,7 @@ func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2953,7 +2953,7 @@ func (ec *executionContext) marshalOAddress2githubᚗcomᚋ99designsᚋgqlgenᚋ func (ec *executionContext) unmarshalOBanned2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐBanned(ctx context.Context, v interface{}) (model.Banned, error) { var res model.Banned err := res.UnmarshalGQL(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBanned2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐBanned(ctx context.Context, sel ast.SelectionSet, v model.Banned) graphql.Marshaler { @@ -2962,7 +2962,7 @@ func (ec *executionContext) marshalOBanned2githubᚗcomᚋ99designsᚋgqlgenᚋe func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2974,7 +2974,7 @@ func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v int return nil, nil } res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { @@ -2986,7 +2986,7 @@ func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast func (ec *executionContext) unmarshalODarkMode2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐPrefs(ctx context.Context, v interface{}) (model.Prefs, error) { res, err := model.UnmarshalPreferences(v) - return *res, graphql.WrapErrorWithInputPath(ctx, err) + return *res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalODarkMode2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐPrefs(ctx context.Context, sel ast.SelectionSet, v model.Prefs) graphql.Marshaler { @@ -2998,7 +2998,7 @@ func (ec *executionContext) unmarshalODarkMode2ᚖgithubᚗcomᚋ99designsᚋgql return nil, nil } res, err := model.UnmarshalPreferences(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalODarkMode2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐPrefs(ctx context.Context, sel ast.SelectionSet, v *model.Prefs) graphql.Marshaler { @@ -3014,7 +3014,7 @@ func (ec *executionContext) unmarshalOPoint2ᚖgithubᚗcomᚋ99designsᚋgqlgen } var res = new(model.Point) err := res.UnmarshalGQL(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOPoint2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐPoint(ctx context.Context, sel ast.SelectionSet, v *model.Point) graphql.Marshaler { @@ -3029,12 +3029,12 @@ func (ec *executionContext) unmarshalOSearchArgs2ᚖgithubᚗcomᚋ99designsᚋg return nil, nil } res, err := ec.unmarshalInputSearchArgs(ctx, v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -3046,7 +3046,7 @@ func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v in return nil, nil } res, err := graphql.UnmarshalString(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { @@ -3059,7 +3059,7 @@ func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel as func (ec *executionContext) unmarshalOTier2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐTier(ctx context.Context, v interface{}) (model.Tier, error) { var res model.Tier err := res.UnmarshalGQL(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOTier2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐTier(ctx context.Context, sel ast.SelectionSet, v model.Tier) graphql.Marshaler { @@ -3068,7 +3068,7 @@ func (ec *executionContext) marshalOTier2githubᚗcomᚋ99designsᚋgqlgenᚋexa func (ec *executionContext) unmarshalOTimestamp2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { res, err := model.UnmarshalTimestamp(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOTimestamp2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { @@ -3080,7 +3080,7 @@ func (ec *executionContext) unmarshalOTimestamp2ᚖtimeᚐTime(ctx context.Conte return nil, nil } res, err := model.UnmarshalTimestamp(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOTimestamp2ᚖtimeᚐTime(ctx context.Context, sel ast.SelectionSet, v *time.Time) graphql.Marshaler { diff --git a/example/selection/generated.go b/example/selection/generated.go index 1823dff85ae..2b54d40ea90 100644 --- a/example/selection/generated.go +++ b/example/selection/generated.go @@ -230,7 +230,7 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("name")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -245,7 +245,7 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -260,7 +260,7 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -2084,7 +2084,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2109,7 +2109,7 @@ func (ec *executionContext) marshalNEvent2githubᚗcomᚋ99designsᚋgqlgenᚋex func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2124,7 +2124,7 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S func (ec *executionContext) unmarshalNTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { res, err := graphql.UnmarshalTime(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { @@ -2180,7 +2180,7 @@ func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgq func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2205,10 +2205,10 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte var err error res := make([]string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2353,7 +2353,7 @@ func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2368,7 +2368,7 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2380,7 +2380,7 @@ func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v int return nil, nil } res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { @@ -2432,7 +2432,7 @@ func (ec *executionContext) marshalOEvent2ᚕgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2454,10 +2454,10 @@ func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v var err error res := make([]string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2480,7 +2480,7 @@ func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v in return nil, nil } res, err := graphql.UnmarshalString(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { diff --git a/example/starwars/generated/exec.go b/example/starwars/generated/exec.go index 8955f60b196..8e493899979 100644 --- a/example/starwars/generated/exec.go +++ b/example/starwars/generated/exec.go @@ -694,7 +694,7 @@ func (ec *executionContext) field_Droid_friendsConnection_args(ctx context.Conte args := map[string]interface{}{} var arg0 *int if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("first")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) arg0, err = ec.unmarshalOInt2ᚖint(ctx, tmp) if err != nil { return nil, err @@ -703,7 +703,7 @@ func (ec *executionContext) field_Droid_friendsConnection_args(ctx context.Conte args["first"] = arg0 var arg1 *string if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("after")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) arg1, err = ec.unmarshalOID2ᚖstring(ctx, tmp) if err != nil { return nil, err @@ -718,7 +718,7 @@ func (ec *executionContext) field_Human_friendsConnection_args(ctx context.Conte args := map[string]interface{}{} var arg0 *int if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("first")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) arg0, err = ec.unmarshalOInt2ᚖint(ctx, tmp) if err != nil { return nil, err @@ -727,7 +727,7 @@ func (ec *executionContext) field_Human_friendsConnection_args(ctx context.Conte args["first"] = arg0 var arg1 *string if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("after")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) arg1, err = ec.unmarshalOID2ᚖstring(ctx, tmp) if err != nil { return nil, err @@ -742,7 +742,7 @@ func (ec *executionContext) field_Human_height_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 models.LengthUnit if tmp, ok := rawArgs["unit"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("unit")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("unit")) arg0, err = ec.unmarshalOLengthUnit2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐLengthUnit(ctx, tmp) if err != nil { return nil, err @@ -757,7 +757,7 @@ func (ec *executionContext) field_Mutation_createReview_args(ctx context.Context args := map[string]interface{}{} var arg0 models.Episode if tmp, ok := rawArgs["episode"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("episode")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("episode")) arg0, err = ec.unmarshalNEpisode2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx, tmp) if err != nil { return nil, err @@ -766,7 +766,7 @@ func (ec *executionContext) field_Mutation_createReview_args(ctx context.Context args["episode"] = arg0 var arg1 models.Review if tmp, ok := rawArgs["review"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("review")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("review")) arg1, err = ec.unmarshalNReviewInput2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐReview(ctx, tmp) if err != nil { return nil, err @@ -781,7 +781,7 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("name")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -796,7 +796,7 @@ func (ec *executionContext) field_Query_character_args(ctx context.Context, rawA args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("id")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) arg0, err = ec.unmarshalNID2string(ctx, tmp) if err != nil { return nil, err @@ -811,7 +811,7 @@ func (ec *executionContext) field_Query_droid_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("id")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) arg0, err = ec.unmarshalNID2string(ctx, tmp) if err != nil { return nil, err @@ -826,7 +826,7 @@ func (ec *executionContext) field_Query_hero_args(ctx context.Context, rawArgs m args := map[string]interface{}{} var arg0 *models.Episode if tmp, ok := rawArgs["episode"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("episode")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("episode")) arg0, err = ec.unmarshalOEpisode2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx, tmp) if err != nil { return nil, err @@ -841,7 +841,7 @@ func (ec *executionContext) field_Query_human_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("id")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) arg0, err = ec.unmarshalNID2string(ctx, tmp) if err != nil { return nil, err @@ -856,7 +856,7 @@ func (ec *executionContext) field_Query_reviews_args(ctx context.Context, rawArg args := map[string]interface{}{} var arg0 models.Episode if tmp, ok := rawArgs["episode"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("episode")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("episode")) arg0, err = ec.unmarshalNEpisode2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx, tmp) if err != nil { return nil, err @@ -865,7 +865,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 { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("since")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("since")) arg1, err = ec.unmarshalOTime2ᚖtimeᚐTime(ctx, tmp) if err != nil { return nil, err @@ -880,7 +880,7 @@ func (ec *executionContext) field_Query_search_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["text"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("text")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -895,7 +895,7 @@ func (ec *executionContext) field_Query_starship_args(ctx context.Context, rawAr args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("id")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) arg0, err = ec.unmarshalNID2string(ctx, tmp) if err != nil { return nil, err @@ -910,7 +910,7 @@ func (ec *executionContext) field_Starship_length_args(ctx context.Context, rawA args := map[string]interface{}{} var arg0 *models.LengthUnit if tmp, ok := rawArgs["unit"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("unit")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("unit")) arg0, err = ec.unmarshalOLengthUnit2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐLengthUnit(ctx, tmp) if err != nil { return nil, err @@ -925,7 +925,7 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -940,7 +940,7 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -3419,7 +3419,7 @@ func (ec *executionContext) unmarshalInputReviewInput(ctx context.Context, obj i case "stars": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("stars")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stars")) it.Stars, err = ec.unmarshalNInt2int(ctx, v) if err != nil { return it, err @@ -3427,7 +3427,7 @@ func (ec *executionContext) unmarshalInputReviewInput(ctx context.Context, obj i case "commentary": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("commentary")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("commentary")) it.Commentary, err = ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err @@ -3435,7 +3435,7 @@ func (ec *executionContext) unmarshalInputReviewInput(ctx context.Context, obj i case "time": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("time")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("time")) it.Time, err = ec.unmarshalOTime2timeᚐTime(ctx, v) if err != nil { return it, err @@ -4241,7 +4241,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -4267,7 +4267,7 @@ func (ec *executionContext) marshalNCharacter2githubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalNEpisode2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx context.Context, v interface{}) (models.Episode, error) { var res models.Episode err := res.UnmarshalGQL(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNEpisode2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx context.Context, sel ast.SelectionSet, v models.Episode) graphql.Marshaler { @@ -4286,10 +4286,10 @@ func (ec *executionContext) unmarshalNEpisode2ᚕgithubᚗcomᚋ99designsᚋgqlg var err error res := make([]models.Episode, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalNEpisode2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -4334,7 +4334,7 @@ func (ec *executionContext) marshalNEpisode2ᚕgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalNFloat2float64(ctx context.Context, v interface{}) (float64, error) { res, err := graphql.UnmarshalFloat(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { @@ -4373,7 +4373,7 @@ func (ec *executionContext) marshalNFriendsEdge2ᚖgithubᚗcomᚋ99designsᚋgq func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalID(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -4388,7 +4388,7 @@ func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.Selec func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { res, err := graphql.UnmarshalInt(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { @@ -4413,10 +4413,10 @@ func (ec *executionContext) unmarshalNInt2ᚕintᚄ(ctx context.Context, v inter var err error res := make([]int, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalNInt2int(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -4443,10 +4443,10 @@ func (ec *executionContext) unmarshalNInt2ᚕᚕintᚄ(ctx context.Context, v in var err error res := make([][]int, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalNInt2ᚕintᚄ(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -4514,7 +4514,7 @@ func (ec *executionContext) marshalNReview2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalNReviewInput2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐReview(ctx context.Context, v interface{}) (models.Review, error) { res, err := ec.unmarshalInputReviewInput(ctx, v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNSearchResult2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐSearchResult(ctx context.Context, sel ast.SelectionSet, v models.SearchResult) graphql.Marshaler { @@ -4576,7 +4576,7 @@ func (ec *executionContext) marshalNStarship2ᚖgithubᚗcomᚋ99designsᚋgqlge func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -4632,7 +4632,7 @@ func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgq func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -4657,10 +4657,10 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte var err error res := make([]string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -4805,7 +4805,7 @@ func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -4820,7 +4820,7 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -4832,7 +4832,7 @@ func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v int return nil, nil } res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { @@ -4902,7 +4902,7 @@ func (ec *executionContext) unmarshalOEpisode2ᚖgithubᚗcomᚋ99designsᚋgqlg } var res = new(models.Episode) err := res.UnmarshalGQL(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOEpisode2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx context.Context, sel ast.SelectionSet, v *models.Episode) graphql.Marshaler { @@ -4914,7 +4914,7 @@ func (ec *executionContext) marshalOEpisode2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalOFloat2float64(ctx context.Context, v interface{}) (float64, error) { res, err := graphql.UnmarshalFloat(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { @@ -4973,7 +4973,7 @@ func (ec *executionContext) unmarshalOID2ᚖstring(ctx context.Context, v interf return nil, nil } res, err := graphql.UnmarshalID(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOID2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { @@ -4988,7 +4988,7 @@ func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interfac return nil, nil } res, err := graphql.UnmarshalInt(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler { @@ -5001,7 +5001,7 @@ func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.Sele func (ec *executionContext) unmarshalOLengthUnit2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐLengthUnit(ctx context.Context, v interface{}) (models.LengthUnit, error) { var res models.LengthUnit err := res.UnmarshalGQL(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOLengthUnit2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐLengthUnit(ctx context.Context, sel ast.SelectionSet, v models.LengthUnit) graphql.Marshaler { @@ -5014,7 +5014,7 @@ func (ec *executionContext) unmarshalOLengthUnit2ᚖgithubᚗcomᚋ99designsᚋg } var res = new(models.LengthUnit) err := res.UnmarshalGQL(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOLengthUnit2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐLengthUnit(ctx context.Context, sel ast.SelectionSet, v *models.LengthUnit) graphql.Marshaler { @@ -5080,7 +5080,7 @@ func (ec *executionContext) marshalOStarship2ᚖgithubᚗcomᚋ99designsᚋgqlge func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -5092,7 +5092,7 @@ func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v in return nil, nil } res, err := graphql.UnmarshalString(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { @@ -5104,7 +5104,7 @@ func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel as func (ec *executionContext) unmarshalOTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { res, err := graphql.UnmarshalTime(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { @@ -5116,7 +5116,7 @@ func (ec *executionContext) unmarshalOTime2ᚖtimeᚐTime(ctx context.Context, v return nil, nil } res, err := graphql.UnmarshalTime(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOTime2ᚖtimeᚐTime(ctx context.Context, sel ast.SelectionSet, v *time.Time) graphql.Marshaler { diff --git a/example/todo/generated.go b/example/todo/generated.go index 47a3e313f63..1e365aa5597 100644 --- a/example/todo/generated.go +++ b/example/todo/generated.go @@ -280,7 +280,7 @@ func (ec *executionContext) dir_hasRole_args(ctx context.Context, rawArgs map[st args := map[string]interface{}{} var arg0 Role if tmp, ok := rawArgs["role"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("role")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) arg0, err = ec.unmarshalNRole2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋtodoᚐRole(ctx, tmp) if err != nil { return nil, err @@ -295,7 +295,7 @@ func (ec *executionContext) dir_user_args(ctx context.Context, rawArgs map[strin args := map[string]interface{}{} var arg0 int if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("id")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) arg0, err = ec.unmarshalNID2int(ctx, tmp) if err != nil { return nil, err @@ -310,7 +310,7 @@ func (ec *executionContext) field_MyMutation_createTodo_args(ctx context.Context args := map[string]interface{}{} var arg0 TodoInput if tmp, ok := rawArgs["todo"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("todo")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("todo")) arg0, err = ec.unmarshalNTodoInput2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋtodoᚐTodoInput(ctx, tmp) if err != nil { return nil, err @@ -325,7 +325,7 @@ func (ec *executionContext) field_MyMutation_updateTodo_args(ctx context.Context args := map[string]interface{}{} var arg0 int if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("id")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) arg0, err = ec.unmarshalNID2int(ctx, tmp) if err != nil { return nil, err @@ -334,7 +334,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 { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("changes")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("changes")) arg1, err = ec.unmarshalNMap2map(ctx, tmp) if err != nil { return nil, err @@ -349,7 +349,7 @@ func (ec *executionContext) field_MyQuery___type_args(ctx context.Context, rawAr args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("name")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -364,7 +364,7 @@ func (ec *executionContext) field_MyQuery_todo_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 int if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("id")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) arg0, err = ec.unmarshalNID2int(ctx, tmp) if err != nil { return nil, err @@ -379,7 +379,7 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -394,7 +394,7 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -831,7 +831,7 @@ func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.Collec tmp, err := directive1(rctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if tmp == nil { return nil, nil @@ -1821,7 +1821,7 @@ func (ec *executionContext) unmarshalInputTodoInput(ctx context.Context, obj int case "text": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("text")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) it.Text, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -1829,7 +1829,7 @@ func (ec *executionContext) unmarshalInputTodoInput(ctx context.Context, obj int case "done": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("done")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("done")) it.Done, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err @@ -2231,7 +2231,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2246,7 +2246,7 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se func (ec *executionContext) unmarshalNID2int(ctx context.Context, v interface{}) (int, error) { res, err := graphql.UnmarshalIntID(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNID2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { @@ -2261,7 +2261,7 @@ func (ec *executionContext) marshalNID2int(ctx context.Context, sel ast.Selectio func (ec *executionContext) unmarshalNMap2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { res, err := graphql.UnmarshalMap(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNMap2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { @@ -2283,7 +2283,7 @@ func (ec *executionContext) marshalNMap2map(ctx context.Context, sel ast.Selecti func (ec *executionContext) unmarshalNRole2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋtodoᚐRole(ctx context.Context, v interface{}) (Role, error) { var res Role err := res.UnmarshalGQL(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNRole2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋtodoᚐRole(ctx context.Context, sel ast.SelectionSet, v Role) graphql.Marshaler { @@ -2292,7 +2292,7 @@ func (ec *executionContext) marshalNRole2githubᚗcomᚋ99designsᚋgqlgenᚋexa func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2358,7 +2358,7 @@ func (ec *executionContext) marshalNTodo2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋ func (ec *executionContext) unmarshalNTodoInput2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋtodoᚐTodoInput(ctx context.Context, v interface{}) (TodoInput, error) { res, err := ec.unmarshalInputTodoInput(ctx, v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { @@ -2404,7 +2404,7 @@ func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgq func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2429,10 +2429,10 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte var err error res := make([]string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2577,7 +2577,7 @@ func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2592,7 +2592,7 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2604,7 +2604,7 @@ func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v int return nil, nil } res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { @@ -2616,7 +2616,7 @@ func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2628,7 +2628,7 @@ func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v in return nil, nil } res, err := graphql.UnmarshalString(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { diff --git a/example/type-system-extension/generated.go b/example/type-system-extension/generated.go index 1472cd48681..4fd8a9e398c 100644 --- a/example/type-system-extension/generated.go +++ b/example/type-system-extension/generated.go @@ -300,7 +300,7 @@ func (ec *executionContext) field_MyMutation_createTodo_args(ctx context.Context args := map[string]interface{}{} var arg0 TodoInput if tmp, ok := rawArgs["todo"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("todo")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("todo")) arg0, err = ec.unmarshalNTodoInput2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋtypeᚑsystemᚑextensionᚐTodoInput(ctx, tmp) if err != nil { return nil, err @@ -315,7 +315,7 @@ func (ec *executionContext) field_MyQuery___type_args(ctx context.Context, rawAr args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("name")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -330,7 +330,7 @@ func (ec *executionContext) field_MyQuery_todo_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("id")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) arg0, err = ec.unmarshalNID2string(ctx, tmp) if err != nil { return nil, err @@ -345,7 +345,7 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -360,7 +360,7 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -414,7 +414,7 @@ func (ec *executionContext) _MyMutation_createTodo(ctx context.Context, field gr tmp, err := directive1(rctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if tmp == nil { return nil, nil @@ -468,7 +468,7 @@ func (ec *executionContext) _MyQuery_todos(ctx context.Context, field graphql.Co tmp, err := directive1(rctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if tmp == nil { return nil, nil @@ -529,7 +529,7 @@ func (ec *executionContext) _MyQuery_todo(ctx context.Context, field graphql.Col tmp, err := directive1(rctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if tmp == nil { return nil, nil @@ -751,7 +751,7 @@ func (ec *executionContext) _Todo_verified(ctx context.Context, field graphql.Co tmp, err := directive1(rctx) if err != nil { - return nil, err + return nil, graphql.ErrorOnPath(ctx, err) } if tmp == nil { return nil, nil @@ -1840,7 +1840,7 @@ func (ec *executionContext) unmarshalInputTodoInput(ctx context.Context, obj int case "text": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("text")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) it.Text, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -2266,7 +2266,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2281,7 +2281,7 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalID(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2297,7 +2297,7 @@ func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.Selec func (ec *executionContext) unmarshalNState2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋtypeᚑsystemᚑextensionᚐState(ctx context.Context, v interface{}) (State, error) { var res State err := res.UnmarshalGQL(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNState2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋtypeᚑsystemᚑextensionᚐState(ctx context.Context, sel ast.SelectionSet, v State) graphql.Marshaler { @@ -2306,7 +2306,7 @@ func (ec *executionContext) marshalNState2githubᚗcomᚋ99designsᚋgqlgenᚋex func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2372,7 +2372,7 @@ func (ec *executionContext) marshalNTodo2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋ func (ec *executionContext) unmarshalNTodoInput2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋtypeᚑsystemᚑextensionᚐTodoInput(ctx context.Context, v interface{}) (TodoInput, error) { res, err := ec.unmarshalInputTodoInput(ctx, v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { @@ -2418,7 +2418,7 @@ func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgq func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2443,10 +2443,10 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte var err error res := make([]string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2591,7 +2591,7 @@ func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2606,7 +2606,7 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2618,7 +2618,7 @@ func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v int return nil, nil } res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { @@ -2630,7 +2630,7 @@ func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2642,7 +2642,7 @@ func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v in return nil, nil } res, err := graphql.UnmarshalString(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { diff --git a/go.mod b/go.mod index 16affcf04ee..96e15663972 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/urfave/cli/v2 v2.1.1 github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e github.com/vektah/gqlparser v1.3.1 - github.com/vektah/gqlparser/v2 v2.0.1 + github.com/vektah/gqlparser/v2 v2.0.2-0.20200827054904-149cf705615e golang.org/x/tools v0.0.0-20200114235610-7ae403b6b589 gopkg.in/yaml.v2 v2.2.4 sourcegraph.com/sourcegraph/appdash v0.0.0-20180110180208-2cc67fd64755 diff --git a/go.sum b/go.sum index 02d393c3b41..59914dfb9a8 100644 --- a/go.sum +++ b/go.sum @@ -78,6 +78,8 @@ github.com/vektah/gqlparser v1.3.1 h1:8b0IcD3qZKWJQHSzynbDlrtP3IxVydZ2DZepCGofqf github.com/vektah/gqlparser v1.3.1/go.mod h1:bkVf0FX+Stjg/MHnm8mEyubuaArhNEqfQhF+OTiAL74= github.com/vektah/gqlparser/v2 v2.0.1 h1:xgl5abVnsd4hkN9rk65OJID9bfcLSMuTaTcZj777q1o= github.com/vektah/gqlparser/v2 v2.0.1/go.mod h1:SyUiHgLATUR8BiYURfTirrTcGpcE+4XkV2se04Px1Ms= +github.com/vektah/gqlparser/v2 v2.0.2-0.20200827054904-149cf705615e h1:NPSDCQ8FknoeZvdakV9NJcD7Ov8ft4wxJyGQIQGZsOg= +github.com/vektah/gqlparser/v2 v2.0.2-0.20200827054904-149cf705615e/go.mod h1:SyUiHgLATUR8BiYURfTirrTcGpcE+4XkV2se04Px1Ms= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= diff --git a/graphql/context_field_input.go b/graphql/context_field_input.go deleted file mode 100644 index 0ed6f8b6602..00000000000 --- a/graphql/context_field_input.go +++ /dev/null @@ -1,85 +0,0 @@ -package graphql - -import ( - "context" - - "github.com/vektah/gqlparser/v2/ast" - "github.com/vektah/gqlparser/v2/gqlerror" -) - -const fieldInputCtx key = "field_input_context" - -type FieldInputContext struct { - ParentField *FieldContext - ParentInput *FieldInputContext - Field *string - Index *int -} - -func (fic *FieldInputContext) Path() ast.Path { - var inputPath ast.Path - for it := fic; it != nil; it = it.ParentInput { - if it.Index != nil { - inputPath = append(inputPath, ast.PathIndex(*it.Index)) - } else if it.Field != nil { - inputPath = append(inputPath, ast.PathName(*it.Field)) - } - } - - // because we are walking up the chain, all the elements are backwards, do an inplace flip. - for i := len(inputPath)/2 - 1; i >= 0; i-- { - opp := len(inputPath) - 1 - i - inputPath[i], inputPath[opp] = inputPath[opp], inputPath[i] - } - - if fic.ParentField != nil { - fieldPath := fic.ParentField.Path() - return append(fieldPath, inputPath...) - - } - - return inputPath -} - -func NewFieldInputWithField(field string) *FieldInputContext { - return &FieldInputContext{Field: &field} -} - -func NewFieldInputWithIndex(index int) *FieldInputContext { - return &FieldInputContext{Index: &index} -} - -func WithFieldInputContext(ctx context.Context, fic *FieldInputContext) context.Context { - if fieldContext := GetFieldContext(ctx); fieldContext != nil { - fic.ParentField = fieldContext - } - if fieldInputContext := GetFieldInputContext(ctx); fieldInputContext != nil { - fic.ParentInput = fieldInputContext - } - - return context.WithValue(ctx, fieldInputCtx, fic) -} - -func GetFieldInputContext(ctx context.Context) *FieldInputContext { - if val, ok := ctx.Value(fieldInputCtx).(*FieldInputContext); ok { - return val - } - return nil -} - -func WrapErrorWithInputPath(ctx context.Context, err error) error { - if err == nil { - return nil - } - - inputContext := GetFieldInputContext(ctx) - path := inputContext.Path() - if gerr, ok := err.(*gqlerror.Error); ok { - if gerr.Path == nil { - gerr.Path = path - } - return gerr - } else { - return gqlerror.WrapPath(path, err) - } -} diff --git a/graphql/context_operation.go b/graphql/context_operation.go index d19b9fd3452..4f4607eab3a 100644 --- a/graphql/context_operation.go +++ b/graphql/context_operation.go @@ -18,7 +18,7 @@ type OperationContext struct { Operation *ast.OperationDefinition DisableIntrospection bool - Recover RecoverFunc + RecoverFunc RecoverFunc ResolverMiddleware FieldMiddleware Stats Stats @@ -37,8 +37,8 @@ func (c *OperationContext) Validate(ctx context.Context) error { if c.ResolverMiddleware == nil { return errors.New("field 'ResolverMiddleware' is required") } - if c.Recover == nil { - c.Recover = DefaultRecover + if c.RecoverFunc == nil { + c.RecoverFunc = DefaultRecover } return nil @@ -105,3 +105,7 @@ func (c *OperationContext) Errorf(ctx context.Context, format string, args ...in func (c *OperationContext) Error(ctx context.Context, err error) { AddError(ctx, err) } + +func (c *OperationContext) Recover(ctx context.Context, err interface{}) error { + return ErrorOnPath(ctx, c.RecoverFunc(ctx, err)) +} diff --git a/graphql/context_path.go b/graphql/context_path.go new file mode 100644 index 00000000000..a46ed83ddc4 --- /dev/null +++ b/graphql/context_path.go @@ -0,0 +1,77 @@ +package graphql + +import ( + "context" + + "github.com/vektah/gqlparser/v2/ast" +) + +const fieldInputCtx key = "path_context" + +type PathContext struct { + ParentField *FieldContext + Parent *PathContext + Field *string + Index *int +} + +func (fic *PathContext) Path() ast.Path { + var path ast.Path + for it := fic; it != nil; it = it.Parent { + if it.Index != nil { + path = append(path, ast.PathIndex(*it.Index)) + } else if it.Field != nil { + path = append(path, ast.PathName(*it.Field)) + } + } + + // because we are walking up the chain, all the elements are backwards, do an inplace flip. + for i := len(path)/2 - 1; i >= 0; i-- { + opp := len(path) - 1 - i + path[i], path[opp] = path[opp], path[i] + } + + if fic.ParentField != nil { + fieldPath := fic.ParentField.Path() + return append(fieldPath, path...) + + } + + return path +} + +func NewPathWithField(field string) *PathContext { + return &PathContext{Field: &field} +} + +func NewPathWithIndex(index int) *PathContext { + return &PathContext{Index: &index} +} + +func WithPathContext(ctx context.Context, fic *PathContext) context.Context { + if fieldContext := GetFieldContext(ctx); fieldContext != nil { + fic.ParentField = fieldContext + } + if fieldInputContext := GetPathContext(ctx); fieldInputContext != nil { + fic.Parent = fieldInputContext + } + + return context.WithValue(ctx, fieldInputCtx, fic) +} + +func GetPathContext(ctx context.Context) *PathContext { + if val, ok := ctx.Value(fieldInputCtx).(*PathContext); ok { + return val + } + return nil +} + +func GetPath(ctx context.Context) ast.Path { + if pc := GetPathContext(ctx); pc != nil { + return pc.Path() + } + if fc := GetFieldContext(ctx); fc != nil { + return fc.Path() + } + return nil +} diff --git a/graphql/context_field_input_test.go b/graphql/context_path_test.go similarity index 61% rename from graphql/context_field_input_test.go rename to graphql/context_path_test.go index 789ef2f7b88..085b40c7ea6 100644 --- a/graphql/context_field_input_test.go +++ b/graphql/context_path_test.go @@ -10,6 +10,6 @@ import ( func TestGetFieldInputContext(t *testing.T) { require.Nil(t, GetFieldContext(context.Background())) - rc := &FieldInputContext{} - require.Equal(t, rc, GetFieldInputContext(WithFieldInputContext(context.Background(), rc))) + rc := &PathContext{} + require.Equal(t, rc, GetPathContext(WithPathContext(context.Background(), rc))) } diff --git a/graphql/context_response.go b/graphql/context_response.go index cc952ed72a0..d4c2e75445c 100644 --- a/graphql/context_response.go +++ b/graphql/context_response.go @@ -38,12 +38,7 @@ func WithResponseContext(ctx context.Context, presenterFunc ErrorPresenterFunc, // AddErrorf writes a formatted error to the client, first passing it through the error presenter. func AddErrorf(ctx context.Context, format string, args ...interface{}) { - c := getResponseContext(ctx) - - c.errorsMu.Lock() - defer c.errorsMu.Unlock() - - c.errors = append(c.errors, c.errorPresenter(ctx, fmt.Errorf(format, args...))) + AddError(ctx, fmt.Errorf(format, args...)) } // AddError sends an error to the client, first passing it through the error presenter. @@ -53,12 +48,12 @@ func AddError(ctx context.Context, err error) { c.errorsMu.Lock() defer c.errorsMu.Unlock() - c.errors = append(c.errors, c.errorPresenter(ctx, err)) + c.errors = append(c.errors, c.errorPresenter(ctx, ErrorOnPath(ctx, err))) } func Recover(ctx context.Context, err interface{}) (userMessage error) { c := getResponseContext(ctx) - return c.recover(ctx, err) + return ErrorOnPath(ctx, c.recover(ctx, err)) } // HasFieldError returns true if the given field has already errored diff --git a/graphql/error.go b/graphql/error.go index 201058a2f63..9e38fe4237b 100644 --- a/graphql/error.go +++ b/graphql/error.go @@ -2,32 +2,27 @@ package graphql import ( "context" + "errors" "github.com/vektah/gqlparser/v2/gqlerror" ) type ErrorPresenterFunc func(ctx context.Context, err error) *gqlerror.Error -type ExtendedError interface { - Extensions() map[string]interface{} +func DefaultErrorPresenter(ctx context.Context, err error) *gqlerror.Error { + return err.(*gqlerror.Error) } -func DefaultErrorPresenter(ctx context.Context, err error) *gqlerror.Error { - if gqlerr, ok := err.(*gqlerror.Error); ok { +func ErrorOnPath(ctx context.Context, err error) error { + if err == nil { + return nil + } + var gqlerr *gqlerror.Error + if errors.As(err, &gqlerr) { if gqlerr.Path == nil { - gqlerr.Path = GetFieldContext(ctx).Path() + gqlerr.Path = GetPath(ctx) } return gqlerr } - - var extensions map[string]interface{} - if ee, ok := err.(ExtendedError); ok { - extensions = ee.Extensions() - } - - return &gqlerror.Error{ - Message: err.Error(), - Path: GetFieldContext(ctx).Path(), - Extensions: extensions, - } + return gqlerror.WrapPath(GetPath(ctx), err) } diff --git a/graphql/executor/executor.go b/graphql/executor/executor.go index b3163a4bd2e..44a2b04c36c 100644 --- a/graphql/executor/executor.go +++ b/graphql/executor/executor.go @@ -40,7 +40,7 @@ func New(es graphql.ExecutableSchema) *Executor { func (e *Executor) CreateOperationContext(ctx context.Context, params *graphql.RawParams) (*graphql.OperationContext, gqlerror.List) { rc := &graphql.OperationContext{ DisableIntrospection: true, - Recover: e.recoverFunc, + RecoverFunc: e.recoverFunc, ResolverMiddleware: e.ext.fieldMiddleware, Stats: graphql.Stats{ Read: params.ReadTime, diff --git a/integration/generated.go b/integration/generated.go index 41fbb30242f..3cb230a99a0 100644 --- a/integration/generated.go +++ b/integration/generated.go @@ -316,7 +316,7 @@ func (ec *executionContext) dir_magic_args(ctx context.Context, rawArgs map[stri args := map[string]interface{}{} var arg0 *int if tmp, ok := rawArgs["kind"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("kind")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) arg0, err = ec.unmarshalOInt2ᚖint(ctx, tmp) if err != nil { return nil, err @@ -331,7 +331,7 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("name")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -346,7 +346,7 @@ func (ec *executionContext) field_Query_complexity_args(ctx context.Context, raw args := map[string]interface{}{} var arg0 int if tmp, ok := rawArgs["value"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("value")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) arg0, err = ec.unmarshalNInt2int(ctx, tmp) if err != nil { return nil, err @@ -361,7 +361,7 @@ func (ec *executionContext) field_Query_date_args(ctx context.Context, rawArgs m args := map[string]interface{}{} var arg0 models.DateFilter if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("filter")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) arg0, err = ec.unmarshalNDateFilter2githubᚗcomᚋ99designsᚋgqlgenᚋintegrationᚋmodelsᚑgoᚐDateFilter(ctx, tmp) if err != nil { return nil, err @@ -376,7 +376,7 @@ func (ec *executionContext) field_Query_error_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 *models.ErrorType if tmp, ok := rawArgs["type"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("type")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) arg0, err = ec.unmarshalOErrorType2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋintegrationᚋmodelsᚑgoᚐErrorType(ctx, tmp) if err != nil { return nil, err @@ -391,7 +391,7 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -406,7 +406,7 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("includeDeprecated")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -1981,7 +1981,7 @@ func (ec *executionContext) unmarshalInputDateFilter(ctx context.Context, obj in case "value": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("value")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) it.Value, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err @@ -1989,7 +1989,7 @@ func (ec *executionContext) unmarshalInputDateFilter(ctx context.Context, obj in case "timezone": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("timezone")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("timezone")) it.Timezone, err = ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err @@ -1997,7 +1997,7 @@ func (ec *executionContext) unmarshalInputDateFilter(ctx context.Context, obj in case "op": var err error - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithField("op")) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("op")) it.Op, err = ec.unmarshalODATE_FILTER_OP2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋintegrationᚋmodelsᚑgoᚐDateFilterOp(ctx, v) if err != nil { return it, err @@ -2497,7 +2497,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2512,7 +2512,7 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se func (ec *executionContext) unmarshalNDateFilter2githubᚗcomᚋ99designsᚋgqlgenᚋintegrationᚋmodelsᚑgoᚐDateFilter(ctx context.Context, v interface{}) (models.DateFilter, error) { res, err := ec.unmarshalInputDateFilter(ctx, v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNElement2githubᚗcomᚋ99designsᚋgqlgenᚋintegrationᚋmodelsᚑgoᚐElement(ctx context.Context, sel ast.SelectionSet, v models.Element) graphql.Marshaler { @@ -2531,7 +2531,7 @@ func (ec *executionContext) marshalNElement2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { res, err := graphql.UnmarshalInt(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { @@ -2546,7 +2546,7 @@ func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.Selecti func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2571,10 +2571,10 @@ func (ec *executionContext) unmarshalNString2ᚕstringᚄ(ctx context.Context, v var err error res := make([]string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2632,7 +2632,7 @@ func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgq func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2657,10 +2657,10 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte var err error res := make([]string, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2805,7 +2805,7 @@ func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2820,7 +2820,7 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -2842,10 +2842,10 @@ func (ec *executionContext) unmarshalOBoolean2ᚕboolᚄ(ctx context.Context, v var err error res := make([]bool, len(vSlice)) for i := range vSlice { - ctx := graphql.WithFieldInputContext(ctx, graphql.NewFieldInputWithIndex(i)) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalNBoolean2bool(ctx, vSlice[i]) if err != nil { - return nil, graphql.WrapErrorWithInputPath(ctx, err) + return nil, err } } return res, nil @@ -2868,7 +2868,7 @@ func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v int return nil, nil } res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { @@ -2884,7 +2884,7 @@ func (ec *executionContext) unmarshalODATE_FILTER_OP2ᚖgithubᚗcomᚋ99designs } var res = new(models.DateFilterOp) err := res.UnmarshalGQL(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalODATE_FILTER_OP2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋintegrationᚋmodelsᚑgoᚐDateFilterOp(ctx context.Context, sel ast.SelectionSet, v *models.DateFilterOp) graphql.Marshaler { @@ -2947,7 +2947,7 @@ func (ec *executionContext) unmarshalOErrorType2ᚖgithubᚗcomᚋ99designsᚋgq } var res = new(models.ErrorType) err := res.UnmarshalGQL(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOErrorType2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋintegrationᚋmodelsᚑgoᚐErrorType(ctx context.Context, sel ast.SelectionSet, v *models.ErrorType) graphql.Marshaler { @@ -2962,7 +2962,7 @@ func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interfac return nil, nil } res, err := graphql.UnmarshalInt(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler { @@ -2974,7 +2974,7 @@ func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.Sele func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { res, err := graphql.UnmarshalString(v) - return res, graphql.WrapErrorWithInputPath(ctx, err) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -2986,7 +2986,7 @@ func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v in return nil, nil } res, err := graphql.UnmarshalString(v) - return &res, graphql.WrapErrorWithInputPath(ctx, err) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { diff --git a/integration/server/server.go b/integration/server/server.go index b7b66ebd8d3..27237300ed7 100644 --- a/integration/server/server.go +++ b/integration/server/server.go @@ -2,17 +2,16 @@ package main import ( "context" + "errors" "log" "net/http" "os" - "github.com/99designs/gqlgen/graphql/handler/extension" - "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/handler" + "github.com/99designs/gqlgen/graphql/handler/extension" "github.com/99designs/gqlgen/graphql/playground" "github.com/99designs/gqlgen/integration" - "github.com/pkg/errors" "github.com/vektah/gqlparser/v2/gqlerror" ) @@ -33,10 +32,11 @@ func main() { srv := handler.NewDefaultServer(integration.NewExecutableSchema(cfg)) srv.SetErrorPresenter(func(ctx context.Context, e error) *gqlerror.Error { - if e, ok := errors.Cause(e).(*integration.CustomError); ok { + var ie *integration.CustomError + if errors.As(e, &ie) { return &gqlerror.Error{ - Message: e.UserMessage, - Path: graphql.GetFieldContext(ctx).Path(), + Message: ie.UserMessage, + Path: graphql.GetPath(ctx), } } return graphql.DefaultErrorPresenter(ctx, e)