-
Hi 👋 I tried to figure out a way to mark an invalidated update as local (my own) and skip it to avoid ui rerendering because I already update it in UI (redux store). I understand it needs every update to update cache. Every real-time framework has this feature: sharedb, yjs, fluid framework, logux, automerge, etc... Thanks again. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hey @ianberdin, thank you for sharing this insight! Personally, I did not perceive this as a performance issue for me, as I have been using live query with relay without many optimistic updates yet. Also, relay diffes the incoming result with the current cache result and automatically skips triggering re-renders if the previous and new values are the same. But I 100% agree that this is something we should address. My first thought would be that we allow to store a unique identifier for the executer with each registered live query and then also send that unique identifier to the server when triggering invalidations 🤔 . {
"query": "query @live { something }",
"extensions": { "live": { "sessionId": "12345678" } }
} But we could also send this as an {
"query": "query @live(sessionId: "12345678") { something }"
} The server could also extract this from the HTTP headers automatically (if you are already sending an authentication token to the server). In the resolvers it could be as easy as calling invalidate with a liveQueryStore.invalidate("Query.something", { sessionId }) The engine will then automatically skip all live query re-executions (and thus sending the result to clients) that have that What do you think? |
Beta Was this translation helpful? Give feedback.
Hey @ianberdin, thank you for sharing this insight!
Personally, I did not perceive this as a performance issue for me, as I have been using live query with relay without many optimistic updates yet. Also, relay diffes the incoming result with the current cache result and automatically skips triggering re-renders if the previous and new values are the same.
But I 100% agree that this is something we should address. My first thought would be that we allow to store a unique identifier for the executer with each registered live query and then also send that unique identifier to the server when triggering invalidations 🤔 .