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

Feature request: use abortController to cancel any running requests when a new one is queued

Open martaver opened this issue 5 years ago • 0 comments

Currently, for mutations, when the debounce timeout is reached and a request is sent, if the the same request is queued again while the first's request is in network flight, then a mutation result will be returned that overrides the requests queued since.

The solution to this is to cancel any in-flight requests with an abortController whenever a new request is enqueued.

This article is a pretty decent write-up: https://evilmartians.com/chronicles/aborting-queries-and-mutations-in-react-apollo

martaver avatar Jul 05 '20 21:07 martaver