ardatan/graphql-mesh

Hive Gateway reports only first of subgraph errors

klys-equinix opened this issue · 4 comments

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

Make sure to fork this template and run yarn generate in the terminal.

Please make sure Mesh package versions under package.json matches yours.

  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

Hive Gateway return just one of the errors that the subgraph it calls actually returns.
For example if i call a mutation using gateway, i will get just one error
Screenshot 2024-09-12 at 11 05 38

But if i call this operation directly on subgraph, i will get a list of errors
Screenshot 2024-09-12 at 11 06 18

To Reproduce Steps to reproduce the behavior:

As above, try calling a subgraph mutation that can respond with more than one error

Expected behavior
All errors should be returned

Environment:

  • OS:
  • Hive gateway docker 1.0.4

The error you show in the second one looks a bit incorrect to me.
Your operation only has "id" field but you have two different errors on the right with different paths so this is actually unexpected behavior for the gateway.

The error you show in the second one looks a bit incorrect to me. Your operation only has "id" field but you have two different errors on the right with different paths so this is actually unexpected behavior for the gateway.

What is incorrect? What is the expected behavior for the gateway?

Notice that the gateway returned one of the errors from the subgraph which doesn't relate to 'id' field that you mentioned. Why didn't it return all of them?
Regarding

Your operation only has "id" field

'id' is a requested field from the returned type, and it is normal behavior for the service to return not only errors related to the returned type, but also errors related to the request.

The path in the errors you shared doesn't match the operation
In the operation, you have approveDesign and id while the error has "cage", "design" and "customer" which is unexpected.

Closing the issue due to the lack of response!
Let us know the latest status. If the issue still persists, we can reopen the issue.