For Chrome, Firefox, and Edge users: Third-party browser extensions are available for debugging TanStack Query directly in browser DevTools. These provide the same functionality as the framework-specific devtools packages:
The devtools are a separate package that you need to install:
npm i @tanstack/svelte-query-devtoolsnpm i @tanstack/svelte-query-devtoolsor
pnpm add @tanstack/svelte-query-devtoolspnpm add @tanstack/svelte-query-devtoolsor
yarn add @tanstack/svelte-query-devtoolsyarn add @tanstack/svelte-query-devtoolsor
bun add @tanstack/svelte-query-devtoolsbun add @tanstack/svelte-query-devtoolsYou can import the devtools like this:
import { SvelteQueryDevtools } from '@tanstack/svelte-query-devtools'import { SvelteQueryDevtools } from '@tanstack/svelte-query-devtools'Floating Mode will mount the devtools as a fixed, floating element in your app and provide a toggle in the corner of the screen to show and hide the devtools. This toggle state will be stored and remembered in localStorage across reloads.
Place the following code as high in your Svelte app as you can. The closer it is to the root of the page, the better it will work!
<script>
import { QueryClientProvider } from '@tanstack/svelte-query'
import { SvelteQueryDevtools } from '@tanstack/svelte-query-devtools'
</script>
<QueryClientProvider client={queryClient}>
{/* The rest of your application */}
<SvelteQueryDevtools />
</QueryClientProvider><script>
import { QueryClientProvider } from '@tanstack/svelte-query'
import { SvelteQueryDevtools } from '@tanstack/svelte-query-devtools'
</script>
<QueryClientProvider client={queryClient}>
{/* The rest of your application */}
<SvelteQueryDevtools />
</QueryClientProvider>