Replies: 4 comments
-
I of course can use 'intermittent polling' as suggested in the apollo docs. For this, I guess I could create an 'event' type (with a 'sinceTimestamp' variable) in my schema, resolve it by querying a persisted subscription event list and send it back to the client. But what to do next: Is there a way to tell vue-apollo "here is a bunch of subscription events, do your thing?" (so these events are distributed to all subscribed components) I think it makes sense to handle 'subscription events' and 'polled events' the same way as vue-apollo has the "components take care of their data on their own"-philosophy (at least that's how I understand it)... A "lazy" way (but not the 'vue-apollo'-way?) of doing it could be to have a dedicated (client) service which updates the cache based on polled subscription events. But then I would have 'update cache based on event x'-logic in my components AND in my service (code duplication). The 'wrong' / not declarative action would be to move the subscription logic out of my components to only have those in just one place. Plus all of the above feels like 'reinventing the wheel' to me. I guess its worth mentioning that a complete refetch of my cache is something I like to avoid (as it can get big) |
Beta Was this translation helpful? Give feedback.
-
Reseting the cache will refetch all the necessary queries, then your subscriptions will be up again to get updates from the server. |
Beta Was this translation helpful? Give feedback.
-
Thx for your reply! I'm looking for a way to update the local cache instead of completely refetching it (as the cache can get big). |
Beta Was this translation helpful? Give feedback.
-
Facing same problem. I want to use subscription event "FORCE_LOGOUT". but when user is offline it can't receives that event. How I suppose to do when he comes online. It is possible with managing token with backend. but I want to use subscription event to logout user when related event happens. |
Beta Was this translation helpful? Give feedback.
-
I have the feeling I'm missing something obvious here...
Beta Was this translation helpful? Give feedback.
All reactions