Skip to content

Invalid GID produces top-level error and erases rest of response #7346

Closed

Description

@tobias-tengler

Product

Hot Chocolate

Version

14.0.0-p.139

Link to minimal reproduction

#7345

Steps to reproduce

Run the test in #7345

What is expected?

I would expect the rest of the response (the unrelated field) to be present and a proper error that associates the error of the invalid Id to the field / argument where it happened:

{
 "errors": [
   {
     "message": "The node ID string has an invalid format.",
     "locations": [
       {
         "line": 2,
         "column": 8
       }
     ],
     "path": [
       "byId"
     ],
     "extensions": {
       "originalValue": "invalid"
     }
   }
 ],
 "data": {
   "byId": null,
   "unrelated": "value"
 }
}

What is actually happening?

A unassociated top-level error is raised without any data:

{
  "errors": [
    {
      "message": "The node ID string has an invalid format.",
      "extensions": {
        "originalValue": "invalid"
      }
    }
  ]
}

Relevant log output

No response

Additional context

No response

Activity

  1. added
    Area: Relay
    on Aug 8, 2024
  2. tobias-tengler commented on Aug 8, 2024

    @tobias-tengler
    MemberAuthor

    I also added another test in #7345 that showcases that the error is raised even if the field is skipped. It produces exactly the same error:

    {
      "errors": [
        {
          "message": "The node ID string has an invalid format.",
          "extensions": {
            "originalValue": "invalid"
          }
        }
      ]
    }

    This seems veeeery unexpected.

  3. cliedeman commented on Aug 16, 2024

    @cliedeman

    Ran into the same issue.

    Quite a slow down on tracking down errors. I also didnt' find any easy workaround to get a better error.

    Wrapping the default IDSerializer throwing also results in the same behaviour

  4. added a commit that references this issue on Feb 27, 2026
    5f03a48
  5. added a commit that references this issue on Feb 27, 2026
    d71862e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: Relay🌶️ hot chocolate

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions