Skip to content

Errors not populating correctlyΒ #75

@djpate

Description

@djpate

Given this response

#<GraphQL::Client::Response:0x000071fb2142c000
 @data=#<#<Module:0x000071fb20ea5820>::Mutation addUser=nil>,
 @errors=#<GraphQL::Client::Errors @messages={} @details={}>,
 @extensions=nil,
 @full_response=
  {"connection" => ["close"],
   "server" => ["TwistedWeb/24.3.0"],
   "date" => ["Wed, 18 Jun 2025 12:45:29 GMT"],
   "content-type" => ["application/json"],
   "content-length" => ["338"]},
 @original_hash=
  {"data" => {"addUser" => nil},
   "errors" =>
    [{"message" => "The provided field is not unique and already exists in GUS.",
      "locations" => [{"line" => 2, "column" => 3}],
      "path" => ["addUser"],
      "errorType" => "FieldExistsError",
      "data" => nil,
      "errorInfo" => {"errorType" => "FieldExistsError", "field" => "userPrincipalName", "value" => "[email protected]"}}]}>

The errors object is empty even though there is an error returned. I tried stepping through I was able to get the errors object after being normalized which yielded

{"message" => "The provided field is not unique and already exists in GUS.",
 "locations" => [{"line" => 2, "column" => 3}],
 "path" => ["addUser"],
 "errorType" => "FieldExistsError",
 "data" => nil,
 "errorInfo" => {"errorType" => "FieldExistsError", "field" => "userPrincipalName", "value" => "[email protected]"},
 "normalizedPath" => ["data", "addUser"]}

I'm assuming it's part of the AST check for errors but I don't really get how it works or what's missing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions