Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Router responds with different error message for 400 subgraph responses than gateway #5241

Open
danpayne17 opened this issue May 24, 2024 · 3 comments
Assignees

Comments

@danpayne17
Copy link

Describe the bug
If the router receives a 400 from a subgraph, the error object the router returns to the caller will contain an empty error message which is different than what the gateway did. The gateway would return a generic error message with the subgraph name:

Router:

  "errors": [
    {
      "message": "",
      ...

Gateway:

  "errors": [
    {
      "message": "Error while fetching subquery from service \"demo-subgraph\"",
      ...

To Reproduce
Steps to reproduce the behavior:

  1. Setup a router with a single subgraph
  2. Have the subgraph return a 400 BAD_REQUEST error
  3. See error

Expected behavior
The router exhibits the same behavior as the gateway and includes a non-empty, generic error message

Output
See above

Router:

  • Version: 1.45.1
@Geal
Copy link
Contributor

Geal commented May 27, 2024

this was an intentional decision early on in the router, to hide internal architecture details from responses in production. To transmit the subgraph errors to the client, you can use the include_subgraph_errors option.

@Geal Geal self-assigned this May 27, 2024
@garypen
Copy link
Contributor

garypen commented Jun 3, 2024

@danpayne17 Could you please confirm that @Geal answer meets your requirements?

@danpayne17
Copy link
Author

@Geal whether include_subgraph_errors is enabled or not has no effect on this behavior. We have it enabled yet still get the empty error message whereas the gateway would return that generic error message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants