github-community-projects / github-community-projects/graphql-client

InvalidNullError not showing up in GraphQL::Client::Response errors since Graphql-ruby 2.4.11

Open
#65 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
78
Forks
228
PR merge metrics
No merged PRs in 30d

Description

I'm trying to upgrade our version of graphql gem from 2.4.10 to 2.4.11, and this [commit](https://github.com/rmosolgo/graphql-ruby/commit/b74c41baaad24668b28ec47a3002c3864a717dc7) changes default InvalidNullError handling.
Because of that change, all of a sudden my response object doesn't have the errors populated within the errors attribute (see example).

Before:
```Ruby
#::Mutation labelCreate=nil>,
@errors=
#["Cannot return null for non-nullable field LabelCreatePayload.errors"]} @details={"data"=>[{"message"=>"Cannot return null for non-nullable field LabelCreatePayload.errors", "normalizedPath"=>["data"]}]}>,
@extensions=nil,
@full_response=nil,
@original_hash=
{:http_status=>"200",
"errors"=>[{"message"=>"Cannot return null for non-nullable field LabelCreatePayload.errors"}],
"data"=>{"labelCreate"=>nil}}>
```

Now:
```Ruby
=> #::Mutation labelCreate=nil>,
@errors=#,
@extensions=nil,
@full_response=nil,
@original_hash=
{:http_status=>"200",
"errors"=>[{"message"=>"Cannot return null for non-nullable field LabelCreatePayload.errors", "locations"=>[{"line"=>3, "column"=>5}], "path"=>["labelCreate", "errors"]}],
"data"=>{"labelCreate"=>nil}}>
```

Is this normal? Could I get some help understanding why that may be happening?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.