I would like my application to automatically refresh some of my queries when they change on the backend. My solution is to setup an additional channel of communication via websockets. Via this websockets channel I’d be sending information what entities in my cache need to be refreshed. My initial plan was to parse those messages and evict specific entities from my cache, so that Apollo Graphql re-fetches them automatically.
- Can I evict parts of my cache from outside of the Apollo Context?
- Is this a good approach to achieve what I have planned?
- If this is not a good approach, what would you suggest instead? Subscriptions seem to require too much additional work at least this is how it seems to me