Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments: Accessing the Relay Store Without a Mutation #685

Open
annacarey opened this issue Apr 19, 2021 · 1 comment
Open

Comments: Accessing the Relay Store Without a Mutation #685

annacarey opened this issue Apr 19, 2021 · 1 comment

Comments

@annacarey
Copy link
Contributor

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.

@kyarik
Copy link

kyarik commented Jun 29, 2021

Hello @annacarey, great post! 👏

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. 🙌

Either way, have a nice day! 👋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants