Weird behaviour with setQueriesData
I have a mutation that I want to use the setQueriesData feature. The behaviour I'm seeing, is that the query gets invalidated despite the fact that I'm setQueriesData is called, and not invalidateQueries. I've tried creating a reproduction but couldn't. Is there any reason why using setQueriesData would also invalidate the query?
The query involved is as follows:
And the mutation function is
2 Replies
foreign-sapphire•3y ago
not that I know of
ambitious-aquaOP•3y ago
Thank you for getting back to me. It turns out it's caused by an idiosyncrasy of the backend API - the pagination data is returned in the first member of the list response, but it's missing in the update response, so when updating the list with the update response, the pagination data becomes undefined, causing invalidation as it's part of the queryKey. Should I delete this post, I don't think it adds much value to the Solid Query knowledge base?