graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

[Fusion] Add tests for various error cases

Open tobias-tengler opened this issue 3 months ago • 5 comments

This PR adds a number of tests for both the handling of transport and individual subgraph errors. The data portion of the response is as expected in most cases, but errors and especially their paths are incorrect most of the time. This is problematic for error handling clients such as Relay which will expect error paths to the leaf field that has been nulled by the error. I've also added a new TestSubgraph and TestSubgraphCollection to simplify simulating Fusion composition and execution in the scope of a single test without having to update the Demo Subgraphs used for other integration tests.

This PR doesn't change any functionality, it just adds tests and the expected + current snapshot versions. I plan to use this as a foundation on which to submit subsequent PRs to (hopefully) address all of the issues surfaced by these tests. I'm sorry for the large diff, but I wanted to have all error cases I could think of covered by tests before modifying the behavior and accidentally changing correct behavior.

3e81e5a35501d293484e160d8c06e70c7db3bb32: This commit shows what is currently produced, compared to the expected response.

tobias-tengler avatar Mar 21 '24 13:03 tobias-tengler