apollographql / apollographql/fullstack-tutorial
Error object in Integration test is different compared to error in playground
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 808
- PR merge metrics
- No merged PRs in 30d
Description
I wanted to test the error scenario for my query/mutation but I’m unable to do so. I've reproduced the issue in this [PR here at this line](https://github.com/apollographql/fullstack-tutorial/pull/153/files#diff-e38243b449b86e768973cba723ec7c8fR103).
Basically the problem is that when one of our datasource methods triggers an error then the `errorFromResponse` method is called and then the error is returned and we see that error in our playground but when you try to test it and mock the error in your test the error you get from query/mutation method from `apollo-server-testing` are both different.
#153
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the integration-test case in PR #153, specifically the linked diff at line 103, and trace the datasource error through errorFromResponse and the query/mutation calls from apollo-server-testing. Compare that result with the playground error and run the affected integration test. Done means the test reproduces the datasource failure with the same error shape or message as the playground.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, node.js, typescript
- Domain
- api, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100