Wave your hands in the air and shout hooray because Solid Query comes with dedicated devtools! 🥳
When you begin your Solid Query journey, you'll want these devtools by your side. They help visualize all of the inner workings of Solid Query and will likely save you hours of debugging if you find yourself in a pinch!
The devtools are a separate package that you need to install:
npm i @tanstack/solid-query-devtools
npm i @tanstack/solid-query-devtools
or
pnpm add @tanstack/solid-query-devtools
pnpm add @tanstack/solid-query-devtools
or
yarn add @tanstack/solid-query-devtools
yarn add @tanstack/solid-query-devtools
or
bun add @tanstack/solid-query-devtools
bun add @tanstack/solid-query-devtools
You can import the devtools like this:
import { SolidQueryDevtools } from '@tanstack/solid-query-devtools'
import { SolidQueryDevtools } from '@tanstack/solid-query-devtools'
By default, Solid Query Devtools are only included in bundles when isServer === true (isServer comes from the solid-js/web package), so you don't need to worry about excluding them during a production build.
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 Solid app as you can. The closer it is to the root of the page, the better it will work!
import { SolidQueryDevtools } from '@tanstack/solid-query-devtools'
function App() {
return (
<QueryClientProvider client={queryClient}>
{/* The rest of your application */}
<SolidQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
)
}
import { SolidQueryDevtools } from '@tanstack/solid-query-devtools'
function App() {
return (
<QueryClientProvider client={queryClient}>
{/* The rest of your application */}
<SolidQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
)
}