Comments: Accessing the Relay Store Without a Mutation
I recently encountered a problem where client-side data (returned from a Relay query) became out of sync after a user interaction. How can we make sure our data is consistent while maintaining a single source of truth? This post explores why a developer might want to update client-side data locally, the basics of Relay and its store, and how to delete records in the store when you're not using a mutation.
Hello @annacarey, great post! :clap:
The scenario you described is interesting and it indeed requires updating the Relay store without first performing a mutation. So, commitLocalUpdate is the way to go!
I also want to mention that not that long ago, I explored how the Relay store works in a lot of detail, and I wrote a very long blog post about it. I would appreciate if you can check it out and let me know what you think. :raised_hands:
Either way, have a nice day! :wave: