router
router copied to clipboard
Router responds with different error message for 400 subgraph responses than gateway
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:
- Setup a router with a single subgraph
- Have the subgraph return a 400 BAD_REQUEST error
- 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
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.
@danpayne17 Could you please confirm that @Geal answer meets your requirements?
@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