After mutation InvalidateQueries Doesn't work
I made the code which creates the post but it doesn't seem to refetch.
It works only when I refreshed the page.
Here is my useQuery code
I don't understand what it doesn't work. If somebody knows I'd be happy to hear you.
2 Replies
conscious-sapphire•3y ago
Which version are you using? If you're using v3, did you try
await queryClient.invalidateQueries(QueryKeys.posts); instead of await queryClient.invalidateQueries([QueryKeys.posts]);.
Could you also provide a reproduction sandbox?conscious-sapphireOP•3y ago
Yes I tried i am using 4 version