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

Asserting error responses #39

Open
nijk opened this issue Nov 4, 2021 · 1 comment
Open

Asserting error responses #39

nijk opened this issue Nov 4, 2021 · 1 comment

Comments

@nijk
Copy link

nijk commented Nov 4, 2021

I'm trying to understand if it is possible to use this library to assert on error responses from a resolver. My use case is:

I have a resolver which calls an upstream process, if that process throws an error, then my resolver throws an ApolloError. I want to be able to test that an ApolloError has been thrown under the correct conditions.

The problem I have at the moment is that this library throws it's own error because the response is not in a shape it expects for a successful response, e.g.

Expected Iterable, but did not find one for field "Query.fieldName".
@nijk
Copy link
Author

nijk commented Nov 11, 2021

Having had a look through the code, it appears that if the subgraph response includes the errors property, then this library throws its own error which masks the underlying error thrown by the subgraph. Making it impossible to test the errors thrown by a subgraph.

I'm happy to submit a PR if you would consider it?

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

No branches or pull requests

1 participant