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

Add support for AbortController signal passed via context #296

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

marioestrada
Copy link

Why

Resolves #251

Description

Adding a good unit test for the abort case was tricky because of the way it's handled in line 1389:

.catch(err => {
if (err.name === 'AbortError') return;
if (err.result && err.result.errors) {

So I added a unit test using setTimeout to test that the request never fulfills, but I know it's not a great pattern to test because it adds an artificial delay to completing the tests.

Test

npm test

@apollo-cla
Copy link

@marioestrada: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

@TrevinAvery
Copy link

Duplicate of #302

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

Successfully merging this pull request may close these issues.

Add Support for Request cancellation
5 participants