apollo-link-debounce
apollo-link-debounce copied to clipboard
Feature request: use abortController to cancel any running requests when a new one is queued
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