artsy.github.io icon indicating copy to clipboard operation
artsy.github.io copied to clipboard

Comments: Accessing the Relay Store Without a Mutation

Open annacarey opened this issue 4 years ago • 1 comments

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.

annacarey avatar Apr 19 '21 16:04 annacarey

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:

kyarik avatar Jun 29 '21 19:06 kyarik