how to send queryClient's cache to the client?
so let's say i have a route like this
and the
so i populate the query cache of the
however this doesn't seem to play well with tanstack start, since only the result of the
so the question is: what would be the best way to implement sending the
or maybe there's another recommended way to handle server entities in tanstack query+start and i'm just doing everything wrong? :D
and the
queryFn inside my getUserFriendsQuery looks something like this:so i populate the query cache of the
queryClient while fetching the friends list so that i have a single store for all server-side user entities, that i can access by simply calling useQuery(getUserQuery(123)) (i.e. useQuery({ queryKey: ['user', 123], queryFn: ... })however this doesn't seem to play well with tanstack start, since only the result of the
loader function is sent to the client, and the queryClient cache is not, leading to n+1 extra requests from the client, since the client doesn't know anything about the usersso the question is: what would be the best way to implement sending the
queryClient cache to the client? is there maybe something ready-made for this? (though haven't found anything in the docs)or maybe there's another recommended way to handle server entities in tanstack query+start and i'm just doing everything wrong? :D