Reevaluate filtered query result based on some changed data #1672
-
Hi guys! I'm trying to find out how I can most easily achieve real time updates in my app using subscriptions. The current challenge is that I have different views based on filters. Let's consider an example of an email inbox, which is similar to my scenario. where each email can be unread, read, deleted, archived etc.. Each property change to an email will emit a message through a subscription (e.g. a Are there any easy ways to deal with this scenario? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hiya 👋 I believe you're correct on all points. If you have subscriptions set up then with Graphcache the normalised cache structure will update any matching entities, but lists will be left out of that as a cache can't assme how lists will update in reaction to changing messages. In these cases you'd need to write manual cache updates:
This would require you to write some small pieces of logic that update your lists to exclude changing items depending on their updated properties. |
Beta Was this translation helpful? Give feedback.
Hiya 👋
I believe you're correct on all points. If you have subscriptions set up then with Graphcache the normalised cache structure will update any matching entities, but lists will be left out of that as a cache can't assme how lists will update in reaction to changing messages.
In these cases you'd need to write manual cache updates:
This would require you to write some small pieces of logic that update your lists to exclude changing items depending on their updated properties.