Closed as not planned
Description
Describe the bug
Hi there,
I have been looking at the documentation and experimenting with setQueriesData
using the latest version of React Query.
For some reason, the oldData
is always undefined
Your minimal, reproducible example
See code below
Steps to reproduce
Here is an example of code:
queryClient.setQueriesData(
{
queryKey, // The query key correctly filters my queries
},
(oldData) => {
// oldData is retrieve when the query has been made with useQuery but not useInfiniteQuery
console.log(">>", queryKey, oldData);
// Do any immutable change here if needed
return oldData
}
);
Expected behavior
I was expecting to get the data and be able to modify an object if the identifier matches
I am wondering if it's a known expectation as useInfiniteQuery returns an object containing the pages and the pageParams.
How often does this bug happen?
None
Screenshots or Videos
No response
Platform
Chrome on macOS
Tanstack Query adapter
None
TanStack Query version
5.76.2
TypeScript version
6.15.0
Additional context
No response