Skip to content

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

@willyamjarcand

Description

@willyamjarcand

I'm trying to upgrade our version of graphql gem from 2.4.10 to 2.4.11, and this commit 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:

#<GraphQL::Client::Response:0x0000000155d92280
 @data=#<#<Module:0x000000015ad35148>::Mutation labelCreate=nil>,
 @errors=
  #<GraphQL::Client::Errors @messages={"data"=>["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:

=> #<GraphQL::Client::Response:0x0000000137d12670
 @data=#<#<Module:0x0000000140f316a0>::Mutation labelCreate=nil>,
 @errors=#<GraphQL::Client::Errors @messages={} @details={}>,
 @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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions