TanStackT
TanStack13mo ago
1 reply
military-pink

Cache Invalidation Issue with Prefetching

With the latest current release of Svelte query and Svelte 5, I'm having an issue with invalidating queries upon a mutation.

Take a simple prefetch for example in a +page.ts file,
export const load = async ({ parent, fetch }) => {
    const { queryClient } = await parent();
    await queryClient.prefetchQuery(queryHandler({ fetch }).users.me());
};


If I perform a mutation upon this query, I also have to call InvalidateAll from the sveltekit api. This is pretty much bare bones and setup directly from the docs. Is anyone else having this issue with latest releases?
Was this page helpful?