-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cancel fetchMore network requests #107
Comments
+1 |
Hi any updates or workaround for this? |
@i8ramin I don't have any way to cancel the network request, but I did find a way to work around issue apollographql/apollo-client#2813 |
For the "when the Query component unmounts" scenario, it would be great if we could at least not get an error thrown when this happens. I don't necessarily care if the request gets cancelled (which doesn't look to be possible with Edit: Wait, I found this apollographql/apollo-client#4114 (comment). Still there should probably be a better way of handling it. Or at least this should be documented maybe, I dunno. |
👋 @dylanwulf - just touching base on this; do you think this is still a significant issue with current day |
@hwillson Thank you for checking in! I don't think this is as big of a problem with modern-day apollo client, but it's still something which I feel would make sense to implement eventually. Currently, if a query is mounted and then unmounted the network request will be canceled. But if a query is unmounted after changing the variables or calling fetchMore, the request will not be canceled. To me this feels inconsistent and confusing, but doesn't really cause any problems so it's not super important that it get solved. Neither of the issues I referenced in the original description (apollographql/apollo-client#4114 and apollographql/apollo-client#2813) are a problem for me anymore. |
Hello,
I would like to be able to cancel fetchMore requests in these two scenarios:
Currently it seems like the initial query request will get cancelled when the component unmounts, but there is no way to cancel a request which was initiated with the fetchMore function. I think this would solve apollo-client issue #4114.
If the variables are changed while a fetchMore request is still in progress, the results from that fetchMore request are going to be completely useless; might as well just cancel the request. I think this would solve apollo-client issue #2813
Thank you!
Edit: This could possibly be considered a migration from apollo-client #3360
The text was updated successfully, but these errors were encountered: