ardatan / graphql-mesh

🕸️ GraphQL Federation Framework for any API services such as REST, OpenAPI, Swagger, SOAP, gRPC and more...
https://the-guild.dev/graphql/mesh
MIT License
3.27k stars 338 forks source link

Hive Gateway reports only first of subgraph errors #7674

Open klys-equinix opened 4 weeks ago

klys-equinix commented 4 weeks ago

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.


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:

ardatan commented 4 weeks ago

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.

tgelo-equinix commented 4 weeks ago

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.

ardatan commented 3 weeks ago

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.