-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Canceling a request #90
Comments
I don't mind seeing this, maybe I think this is tricky to implement tho, as the pipeline of plugins isn't really aware of the caller and the caller isn't aware of what happens inside, which might require some fiddling. I will mark this as an enhancement, for now, will try to get around to it when I can. Feel free to PR it or share your ideas. |
Update: at the moment there is a PR to get this functionality out, this is the proposed behavior
The only problems left to work out is to determine what happens if:
Looking at how apollo and other clients handle this, it doesn't seem that they offer this out of the box and user's handling is required for these cases, but they do seem to cancel the request completely which might cause issues with both scenarios, the community seems to turn off these features when using cancellable queries/mutations. I'm thinking of introducing 2 layers of cancellation, a hard cancellation with |
Has there been any movement on this since above? I also have a similar need to explicitly cancel a request. |
@freddieerg I still haven't worked out the caveats of calling The specs for this so far looks like this:
This would require writing the tests and logic to do this, and also writing the documentation to make it clear in these cases how the PRs are welcome here as well :) |
@logaretm, will this also work with useSubscription? Or is there already option to cancel (not just pause) subscriptions? |
@argoroots Nope, this is only for mutations/queries and if you use HTTP for subscriptions it could work. However there is no way to avoid the issues I mentioned at the moment. I may need to revisit this at another time when I can focus on it. For subs, I realize there is no way to completely stop it, maybe we can expose something quickly, the logic is already there. It just needs exposing on |
Can we still get close to be exposed? Would be a nice to have so we don't have open subscriptions if we do not need them. |
We have a use-case that would require canceling requests - some are triggered explicitly using
execute
and some are triggered dynamically, by mutating responsive query variables.Is there any way to do this with Villus? If not, how do you feel about such a feature, would you consider implementing it/accept a PR implementing it or do you think it's not a good fit for the automagic approach the library generally takes?
The text was updated successfully, but these errors were encountered: