-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
Optimistic updates / Refetching queries after mutations #212
Comments
The default cache is document based so it doesn't support optimistic updates as we only know about very specific query and variables combinations. So from our perspective it makes more Re sense to add this functionality to a normalised cache, like the one that Apollo has. I'm currently working on a normalised cache for urql and it's not quite ready yet, but you can track it's progress here: https://github.com/kitten/urql-exchange-graphcache |
That sounds great. I was thinking that there might be a way to override the cache even on the document however - a another argument to the mutation? Im sure you know the limitations however |
@tonypee So basically, you're looking for a I think that should be a possible option that can be implemented outside of the exchange infrastructure. It could be built into |
I'll close this for now as this is completely under the scope of the normalised cache which we'll track separately |
@kitten I see the normalized cache is out now so can we do Optimistic updates now? |
@deadcoder0904 Hiya 👋 Yes, |
Thanks, Phil for your work on this. I really love the name "Wonka" for some reason 😂 |
Thanks for the amazing work so far!
I am using antd Form element, which takes props, then keeps an internal form state. When my form is ready, i submit a mutation. The problem is, this triggers a new render with the initital props, causing the fields to flicker back to the original values until the mutation is complete (http request)
This all makes sense. I guess i need to overwrite the local state immediately?
The text was updated successfully, but these errors were encountered: