apollo-link-rest
apollo-link-rest copied to clipboard
Add support for AbortController signal passed via context
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: 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/
Duplicate of #302