apollo-link-rest icon indicating copy to clipboard operation
apollo-link-rest copied to clipboard

Add support for AbortController signal passed via context

Open marioestrada opened this issue 3 years ago • 2 comments

Why

Resolves https://github.com/apollographql/apollo-link-rest/issues/251

Description

Adding a good unit test for the abort case was tricky because of the way it's handled in line 1389: https://github.com/apollographql/apollo-link-rest/blob/cde5f56f8fc4938dd3b26ebcc2812ab439bf00ec/src/restLink.ts#L1388-L1390

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

marioestrada avatar Apr 22 '22 22:04 marioestrada

@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/

apollo-cla avatar Apr 22 '22 22:04 apollo-cla

Duplicate of #302

TrevinAvery avatar Mar 21 '24 02:03 TrevinAvery