jaydenseric / graphql-react

A GraphQL client for React using modern context and hooks APIs that is lightweight (< 4 kB) but powerful; the first Relay and Apollo alternative with server side rendering.
https://npm.im/graphql-react
MIT License
717 stars 22 forks source link

Cancel in-flight requests when they are invalidated #24

Closed mike-marcacci closed 3 years ago

mike-marcacci commented 5 years ago

When an in-progress query is invalidated (due to variables changing, or the react component being removed from the virtual DOM, etc) we need to cancel the request and open up space in the browser's request queue.

For me, this is especially important in a "search-while-typing" interface, where in-flight queries are frequently invalidated by more user input.

jaydenseric commented 3 years ago

Pretty excited about how easy this is going to be soon with the new API…

Screen Shot 2021-03-19 at 3 54 19 pm