Closed sajadghawami closed 2 years ago
@sajadghawami did you happen to find a workaround to this behavior? I'm seeing it as well.
@stevewillard
When i dug deeper, i found out that there was a pretty big bug. Since this repository is not maintained anymore i ended up copying everything over, fixing it and optimizing it for my application.
Feel free to message me if you need the code i ended up with.
Cheers.
@sajadghawami Totally - that would be super helpful if you could share your modified version! Thanks.
Hey guys! Sorry I've been a bit out of the loop. Had some personal issues to attend.
@sajadghawami If you have the code, I can include it in the main repo.
@miguelocarvajal
no worries, hope you are doing well! thank you for your great work! :)
I created this gist.
Please keep in mind that it is a little tailored to our application (see CUSTOMER_HYDRATE)
Everything works fine, but sometimes the app would successfully send all the mutations to the server and update the apollo-cache accordingly, except for the last mutation. The mutation would go successfully through to our server, but somehow the app would swallow the last response.
It was a really long and messy fight with the apollo-cache, different versions of the apollo-client that wouldn't act as promised so i ended up hydrating the data at the end, to always keep the UI in sync after all mutations where successful.
We are using this in production and didn't have any problems yet. If you happen to have a more elegant solution to our little desync problem, i would be very glad if you could share it :).
Hey there,
very nice library!
Unfortunately, i ve seen these two bugs:
optimisticResponse
if you want to use theupdate
in an apollo mutation. So you end up needing to set your ownoptimisticResponse
besides the one that this library will provide. Otherwise theupdate
will not shoot. So you end up having two different responses.optimisticResponse
,update
function in a mutation will also be called twice for eachoptimisticResponse
. You'll end up havingupdate
called 4 times.Thank you.