T
TanStack3y ago
generous-apricot

QueryCache not being updated after a successful mutation

I’m posting a new todo to a json placeholder. Now the mutation is successful and server state gets updated with the new todo. But even after invalidating queries in onSettled, refetch returns the old todos. Please help me with this as I’ve been losing mind over this for past couple of nights
No description
4 Replies
rival-black
rival-black3y ago
if you're talking about the json placeholder API (https://jsonplaceholder.typicode.com/): it doesn't really save updates. Where should it store those ?
generous-apricot
generous-apricotOP3y ago
I didn’t know that jsonplacholder api doesn’t save updates. Thanks for the response. You’re a legend. Also, can you suggest any other api that would work in this case?
deep-jade
deep-jade3y ago
generous-apricot
generous-apricotOP3y ago
Thanks @julien

Did you find this page helpful?