Feedback for “Subscriptions” #2301
boomdizz
started this conversation in
Docs Discussions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Since Subscriptions are long-lived operations (compared to Queries and Mutations), we need a means to terminate the subscription.
A usecase we have is to show monitoring data for a bunch of hosts we manage. We have a webpage where the user selects a host from a drop down list (or select list) and we get it's monitoring data from the backend, display it and then use subscribeToMore to fetch new data as it becomes available on the backend. But if the user uses the drop-down for another host, we want to start the subscription for data on the new host. At this point we want to 'unsubscribe' for the old host, otherwise the backend will unnecessarily be consuming resources to send data to the client which will not be shown in the UI. It is best to have an option to unsubscribe as it conserves resources on the client and server end.
Maybe there is a way of doing this, but I could not find it in the documentation.
Beta Was this translation helpful? Give feedback.
All reactions