socket io and manually updating the cache #2075
-
I am using a graphql backend where subscriptions are not an option (strapi cms). For real time functionality, I'm using Socket IO to emit events to the client from the server. Currently I have the following structure:
In practice, this works, but it means that I have to re-fetch all the data ( |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Please assist on this since i would love to do the same thing on my app |
Beta Was this translation helpful? Give feedback.
-
Hey, What kind off cache are you using? Default or normalized? This question is relevant because in the default cache we won't be able to offer that functionality instead we'd advise you to abstract the logic in some hook that listens to your websocket and appends the data to its own localstate. In our normalized cache, we've been thinking about this functionality. There's even an open pr for it currently. |
Beta Was this translation helpful? Give feedback.
-
I am currently using default but if the normalized one will offer what i need i will go for it . I have also seen the PR please merge it it will be very useful |
Beta Was this translation helpful? Give feedback.
Hey,
What kind off cache are you using? Default or normalized? This question is relevant because in the default cache we won't be able to offer that functionality instead we'd advise you to abstract the logic in some hook that listens to your websocket and appends the data to its own localstate.
In our normalized cache, we've been thinking about this functionality. There's even an open pr for it currently.