diff --git a/codegen/testserver/generated.go b/codegen/testserver/generated.go index b737424dd7..6eab307c39 100644 --- a/codegen/testserver/generated.go +++ b/codegen/testserver/generated.go @@ -273,6 +273,7 @@ type ComplexityRoot struct { ErrorBubble func(childComplexity int) int Errors func(childComplexity int) int Fallback func(childComplexity int, arg FallbackToStringEncoding) int + InputNullableSlice func(childComplexity int, arg []string) int InputSlice func(childComplexity int, arg []string) int InvalidIdentifier func(childComplexity int) int Issue896a func(childComplexity int) int @@ -415,6 +416,7 @@ type QueryResolver interface { User(ctx context.Context, id int) (*User, error) NullableArg(ctx context.Context, arg *int) (*string, error) InputSlice(ctx context.Context, arg []string) (bool, error) + InputNullableSlice(ctx context.Context, arg []string) (bool, error) ShapeUnion(ctx context.Context) (ShapeUnion, error) Autobind(ctx context.Context) (*Autobind, error) DeprecatedField(ctx context.Context) (string, error) @@ -1193,6 +1195,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.Fallback(childComplexity, args["arg"].(FallbackToStringEncoding)), true + case "Query.inputNullableSlice": + if e.complexity.Query.InputNullableSlice == nil { + break + } + + args, err := ec.field_Query_inputNullableSlice_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.InputNullableSlice(childComplexity, args["arg"].([]string)), true + case "Query.inputSlice": if e.complexity.Query.InputSlice == nil { break @@ -2039,6 +2053,7 @@ type Query { user(id: Int!): User! nullableArg(arg: Int = 123): String inputSlice(arg: [String!]!): Boolean! + inputNullableSlice(arg: [String!]): Boolean! shapeUnion: ShapeUnion! autobind: Autobind deprecatedField: String! @deprecated(reason: "test deprecated directive") @@ -2628,6 +2643,20 @@ func (ec *executionContext) field_Query_fallback_args(ctx context.Context, rawAr return args, nil } +func (ec *executionContext) field_Query_inputNullableSlice_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []string + if tmp, ok := rawArgs["arg"]; ok { + arg0, err = ec.unmarshalOString2ᚕstringᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["arg"] = arg0 + return args, nil +} + func (ec *executionContext) field_Query_inputSlice_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -5773,6 +5802,44 @@ func (ec *executionContext) _Query_inputSlice(ctx context.Context, field graphql return ec.marshalNBoolean2bool(ctx, field.Selections, res) } +func (ec *executionContext) _Query_inputNullableSlice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Query_inputNullableSlice_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp := ec._fieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().InputNullableSlice(rctx, args["arg"].([]string)) + }) + + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + func (ec *executionContext) _Query_shapeUnion(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { @@ -11281,6 +11348,20 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } return res }) + case "inputNullableSlice": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_inputNullableSlice(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + }) case "shapeUnion": field := field out.Concurrently(i, func() (res graphql.Marshaler) { @@ -12478,9 +12559,6 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se } func (ec *executionContext) unmarshalNBytes2ᚕbyte(ctx context.Context, v interface{}) ([]byte, error) { - if v == nil { - return nil, nil - } return UnmarshalBytes(v) } @@ -12599,9 +12677,6 @@ func (ec *executionContext) unmarshalNInnerDirectives2githubᚗcomᚋ99designs } func (ec *executionContext) unmarshalNInnerDirectives2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInnerDirectives(ctx context.Context, v interface{}) (*InnerDirectives, error) { - if v == nil { - return nil, nil - } res, err := ec.unmarshalNInnerDirectives2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInnerDirectives(ctx, v) return &res, err } @@ -12611,9 +12686,6 @@ func (ec *executionContext) unmarshalNInnerInput2githubᚗcomᚋ99designsᚋgqlg } func (ec *executionContext) unmarshalNInnerInput2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInnerInput(ctx context.Context, v interface{}) (*InnerInput, error) { - if v == nil { - return nil, nil - } res, err := ec.unmarshalNInnerInput2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐInnerInput(ctx, v) return &res, err } @@ -12716,9 +12788,6 @@ func (ec *executionContext) marshalNMarshalPanic2githubᚗcomᚋ99designsᚋgqlg } func (ec *executionContext) unmarshalNMarshalPanic2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚐMarshalPanicᚄ(ctx context.Context, v interface{}) ([]MarshalPanic, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { @@ -12868,9 +12937,6 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S } func (ec *executionContext) unmarshalNString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { @@ -12900,9 +12966,6 @@ func (ec *executionContext) marshalNString2ᚕstringᚄ(ctx context.Context, sel } func (ec *executionContext) unmarshalNString2ᚕᚖstring(ctx context.Context, v interface{}) ([]*string, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { @@ -12932,9 +12995,6 @@ func (ec *executionContext) marshalNString2ᚕᚖstring(ctx context.Context, sel } func (ec *executionContext) unmarshalNString2ᚖstring(ctx context.Context, v interface{}) (*string, error) { - if v == nil { - return nil, nil - } res, err := ec.unmarshalNString2string(ctx, v) return &res, err } @@ -13133,9 +13193,6 @@ func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Conte } func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { diff --git a/codegen/testserver/input_test.go b/codegen/testserver/input_test.go index 562569ef3b..1a54508d72 100644 --- a/codegen/testserver/input_test.go +++ b/codegen/testserver/input_test.go @@ -28,4 +28,22 @@ func TestInput(t *testing.T) { require.EqualError(t, err, `http 422: {"errors":[{"message":"Expected type String!, found 1.","locations":[{"line":1,"column":32}],"extensions":{"code":"GRAPHQL_VALIDATION_FAILED"}},{"message":"Expected type String!, found 2.","locations":[{"line":1,"column":35}],"extensions":{"code":"GRAPHQL_VALIDATION_FAILED"}}],"data":null}`) require.Nil(t, resp.DirectiveArg) }) + + t.Run("when input slice nullable", func(t *testing.T) { + resolvers.QueryResolver.InputNullableSlice = func(ctx context.Context, arg []string) (b bool, e error) { + return arg == nil, nil + } + + var resp struct { + InputNullableSlice bool + } + var err error + err = c.Post(`query { inputNullableSlice(arg: null) }`, &resp) + require.NoError(t, err) + require.True(t, resp.InputNullableSlice) + + err = c.Post(`query { inputNullableSlice(arg: []) }`, &resp) + require.NoError(t, err) + require.False(t, resp.InputNullableSlice) + }) } diff --git a/codegen/testserver/resolver.go b/codegen/testserver/resolver.go index 17245e9518..baf1b30f15 100644 --- a/codegen/testserver/resolver.go +++ b/codegen/testserver/resolver.go @@ -107,6 +107,10 @@ func (r *queryResolver) InputSlice(ctx context.Context, arg []string) (bool, err panic("not implemented") } +func (r *queryResolver) InputNullableSlice(ctx context.Context, arg []string) (bool, error) { + panic("not implemented") +} + func (r *queryResolver) ShapeUnion(ctx context.Context) (ShapeUnion, error) { panic("not implemented") } diff --git a/codegen/testserver/schema.graphql b/codegen/testserver/schema.graphql index c75bd8177d..1672d7be8a 100644 --- a/codegen/testserver/schema.graphql +++ b/codegen/testserver/schema.graphql @@ -12,6 +12,7 @@ type Query { user(id: Int!): User! nullableArg(arg: Int = 123): String inputSlice(arg: [String!]!): Boolean! + inputNullableSlice(arg: [String!]): Boolean! shapeUnion: ShapeUnion! autobind: Autobind deprecatedField: String! @deprecated(reason: "test deprecated directive") diff --git a/codegen/testserver/stub.go b/codegen/testserver/stub.go index 4322ef31be..7e353863e7 100644 --- a/codegen/testserver/stub.go +++ b/codegen/testserver/stub.go @@ -51,6 +51,7 @@ type Stub struct { User func(ctx context.Context, id int) (*User, error) NullableArg func(ctx context.Context, arg *int) (*string, error) InputSlice func(ctx context.Context, arg []string) (bool, error) + InputNullableSlice func(ctx context.Context, arg []string) (bool, error) ShapeUnion func(ctx context.Context) (ShapeUnion, error) Autobind func(ctx context.Context) (*Autobind, error) DeprecatedField func(ctx context.Context) (string, error) @@ -254,6 +255,9 @@ func (r *stubQuery) NullableArg(ctx context.Context, arg *int) (*string, error) func (r *stubQuery) InputSlice(ctx context.Context, arg []string) (bool, error) { return r.QueryResolver.InputSlice(ctx, arg) } +func (r *stubQuery) InputNullableSlice(ctx context.Context, arg []string) (bool, error) { + return r.QueryResolver.InputNullableSlice(ctx, arg) +} func (r *stubQuery) ShapeUnion(ctx context.Context) (ShapeUnion, error) { return r.QueryResolver.ShapeUnion(ctx) } diff --git a/codegen/type.gotpl b/codegen/type.gotpl index f283f5603a..469c2a373d 100644 --- a/codegen/type.gotpl +++ b/codegen/type.gotpl @@ -1,7 +1,7 @@ {{- range $type := .ReferencedTypes }} {{ with $type.UnmarshalFunc }} func (ec *executionContext) {{ . }}(ctx context.Context, v interface{}) ({{ $type.GO | ref }}, error) { - {{- if $type.IsNilable }} + {{- if and $type.IsNilable (not $type.GQL.NonNull) }} if v == nil { return nil, nil } {{- end }} {{- if $type.IsPtr }} diff --git a/example/chat/generated.go b/example/chat/generated.go index 9ed9ae91b4..f64e588ceb 100644 --- a/example/chat/generated.go +++ b/example/chat/generated.go @@ -2490,9 +2490,6 @@ func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Conte } func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { diff --git a/example/config/generated.go b/example/config/generated.go index f14c0cdaa5..4322c888ba 100644 --- a/example/config/generated.go +++ b/example/config/generated.go @@ -2381,9 +2381,6 @@ func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Conte } func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { diff --git a/example/dataloader/generated.go b/example/dataloader/generated.go index 915473b509..ddb182fc75 100644 --- a/example/dataloader/generated.go +++ b/example/dataloader/generated.go @@ -2666,9 +2666,6 @@ func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Conte } func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { diff --git a/example/federation/accounts/graph/generated/generated.go b/example/federation/accounts/graph/generated/generated.go index 08286ab0bb..d799cc0132 100644 --- a/example/federation/accounts/graph/generated/generated.go +++ b/example/federation/accounts/graph/generated/generated.go @@ -2180,9 +2180,6 @@ func (ec *executionContext) marshalNUser2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋ } func (ec *executionContext) unmarshalN_Any2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { - if v == nil { - return nil, nil - } return graphql.UnmarshalMap(v) } @@ -2203,9 +2200,6 @@ func (ec *executionContext) marshalN_Any2map(ctx context.Context, sel ast.Select } func (ec *executionContext) unmarshalN_Any2ᚕmapᚄ(ctx context.Context, v interface{}) ([]map[string]interface{}, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { @@ -2345,9 +2339,6 @@ func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Conte } func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { diff --git a/example/federation/products/graph/generated/generated.go b/example/federation/products/graph/generated/generated.go index d6005ae532..2fee8579f0 100644 --- a/example/federation/products/graph/generated/generated.go +++ b/example/federation/products/graph/generated/generated.go @@ -2254,9 +2254,6 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S } func (ec *executionContext) unmarshalN_Any2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { - if v == nil { - return nil, nil - } return graphql.UnmarshalMap(v) } @@ -2277,9 +2274,6 @@ func (ec *executionContext) marshalN_Any2map(ctx context.Context, sel ast.Select } func (ec *executionContext) unmarshalN_Any2ᚕmapᚄ(ctx context.Context, v interface{}) ([]map[string]interface{}, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { @@ -2419,9 +2413,6 @@ func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Conte } func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { diff --git a/example/federation/reviews/graph/generated/generated.go b/example/federation/reviews/graph/generated/generated.go index 9326171535..3b702da640 100644 --- a/example/federation/reviews/graph/generated/generated.go +++ b/example/federation/reviews/graph/generated/generated.go @@ -2537,9 +2537,6 @@ func (ec *executionContext) marshalNUser2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋ } func (ec *executionContext) unmarshalN_Any2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { - if v == nil { - return nil, nil - } return graphql.UnmarshalMap(v) } @@ -2560,9 +2557,6 @@ func (ec *executionContext) marshalN_Any2map(ctx context.Context, sel ast.Select } func (ec *executionContext) unmarshalN_Any2ᚕmapᚄ(ctx context.Context, v interface{}) ([]map[string]interface{}, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { @@ -2702,9 +2696,6 @@ func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Conte } func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { diff --git a/example/fileupload/generated.go b/example/fileupload/generated.go index 630055cacc..517cbb1fca 100644 --- a/example/fileupload/generated.go +++ b/example/fileupload/generated.go @@ -2353,9 +2353,6 @@ func (ec *executionContext) marshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋg } func (ec *executionContext) unmarshalNUpload2ᚕᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUploadᚄ(ctx context.Context, v interface{}) ([]*graphql.Upload, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { @@ -2385,9 +2382,6 @@ 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) { - if v == nil { - return nil, nil - } res, err := ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, v) return &res, err } @@ -2407,9 +2401,6 @@ func (ec *executionContext) unmarshalNUploadFile2githubᚗcomᚋ99designsᚋgqlg } func (ec *executionContext) unmarshalNUploadFile2ᚕᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋfileuploadᚋmodelᚐUploadFileᚄ(ctx context.Context, v interface{}) ([]*model.UploadFile, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { @@ -2430,9 +2421,6 @@ 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) { - if v == nil { - return nil, nil - } res, err := ec.unmarshalNUploadFile2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋfileuploadᚋmodelᚐUploadFile(ctx, v) return &res, err } @@ -2493,9 +2481,6 @@ func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Conte } func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { diff --git a/example/scalars/generated.go b/example/scalars/generated.go index 54544c72e9..95c630adcf 100644 --- a/example/scalars/generated.go +++ b/example/scalars/generated.go @@ -2373,9 +2373,6 @@ 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) { - if v == nil { - return nil, nil - } res, err := ec.unmarshalNPoint2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋscalarsᚋmodelᚐPoint(ctx, v) return &res, err } @@ -2511,9 +2508,6 @@ func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Conte } func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { diff --git a/example/selection/generated.go b/example/selection/generated.go index 266c97d41c..f25e924fbb 100644 --- a/example/selection/generated.go +++ b/example/selection/generated.go @@ -2187,9 +2187,6 @@ func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Conte } func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { diff --git a/example/starwars/generated/exec.go b/example/starwars/generated/exec.go index 150c1a1ec9..35644f0ba0 100644 --- a/example/starwars/generated/exec.go +++ b/example/starwars/generated/exec.go @@ -4248,9 +4248,6 @@ func (ec *executionContext) marshalNEpisode2githubᚗcomᚋ99designsᚋgqlgenᚋ } func (ec *executionContext) unmarshalNEpisode2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisodeᚄ(ctx context.Context, v interface{}) ([]models.Episode, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { @@ -4378,9 +4375,6 @@ func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.Selecti } func (ec *executionContext) unmarshalNInt2ᚕintᚄ(ctx context.Context, v interface{}) ([]int, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { @@ -4410,9 +4404,6 @@ func (ec *executionContext) marshalNInt2ᚕintᚄ(ctx context.Context, sel ast.S } func (ec *executionContext) unmarshalNInt2ᚕᚕintᚄ(ctx context.Context, v interface{}) ([][]int, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { @@ -4631,9 +4622,6 @@ func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Conte } func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { diff --git a/example/todo/generated.go b/example/todo/generated.go index 93c819a01b..cb9b3b617e 100644 --- a/example/todo/generated.go +++ b/example/todo/generated.go @@ -2245,9 +2245,6 @@ func (ec *executionContext) marshalNID2int(ctx context.Context, sel ast.Selectio } func (ec *executionContext) unmarshalNMap2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { - if v == nil { - return nil, nil - } return graphql.UnmarshalMap(v) } @@ -2401,9 +2398,6 @@ func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Conte } func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { diff --git a/example/type-system-extension/generated.go b/example/type-system-extension/generated.go index 0d63ac02aa..318ff3baec 100644 --- a/example/type-system-extension/generated.go +++ b/example/type-system-extension/generated.go @@ -2359,9 +2359,6 @@ func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Conte } func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { diff --git a/integration/generated.go b/integration/generated.go index edf4d1a904..ee0a66a4da 100644 --- a/integration/generated.go +++ b/integration/generated.go @@ -2543,9 +2543,6 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S } func (ec *executionContext) unmarshalNString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { @@ -2630,9 +2627,6 @@ func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Conte } func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - if v == nil { - return nil, nil - } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok {