apollographql / apollographql/apollo-tooling
How can I deliberately fail a mutation for testing purposes?
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 460
- PR merge metrics
- No merged PRs in 30d
Description
For example in the following code, how do I make the code go into the ```.catch``` block
```
changeSubjectLine({
variables: {
campaignId,
},
})
.then(() => {
toast(successToast('Subject line dynamic saved.'));
})
.catch((e) => {
toast(errorToastConfig(e));
// I want the code to go into here
});
```
Is there a flag I can put in there to make it do that
Contributor guide
Research direction
The issue names no files or tests; begin with the changeSubjectLine mutation call and its promise chain. Determine whether the client or Apollo tooling exposes a testable failure hook, then verify that the .catch callback receives an error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, typescript
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100