If your app runs happily on v5 of TanStack Query, will you have to rewrite half your hooks for v6? Probably not. Maintainer Dominik Dorfmeister (TkDodo) posted the v6 roadmap in GitHub Discussion #12669 and immediately calmed the hype: new features will keep shipping in minor releases, while the major version is for spring cleaning. Breaking changes (updates that require adapting existing code or build setups) will happen, but they're being kept to a minimum.
Cost and payoff of moving to ESM and React 19
Part of the plan is already live on the query-v6 branch, showing the exact price of upgrading. The package becomes ESM-only—pure import/export modules, dropping CommonJS require builds and legacy Webpack 4 targets. @tanstack/react-query bumps its minimum peer dependency to React 19. Sibling adapters are trimming legacy weight too: @tanstack/vue-query drops Vue 2 (vue-demi) support, and @tanstack/solid-query drops the deprecated suspense option. No new strict TypeScript or Node.js floors have been set in the thread yet.
In return, the internals get cleaner. Requiring React 19 lets useSuspenseQuery switch to the native use() hook instead of the old throw promise trick. The built-in scheduler has already moved from setTimeout(0) to the microtask queue (queueMicrotask / Promise): previously, after await invalidateQueries, the UI could briefly render a new state with stale cached data (#8815), and microtasks eliminate that mismatch.
Two quiet production fixes landed as well: exponential retries gained jitter (#9390)—randomizing retry delays so thousands of tabs don't slam your server at once after an outage—and HydrationBoundary dropped redundant runtime checks (#11437) that TypeScript already catches.
API cleanup, required queryFn, and the enabled debate
Deprecated v5 APIs are being removed from query-core and sibling packages: isInitialLoading, context.direction, queryObserver.getOptimisticResult, old signatures of fetch(Infinite)Query, prefetch(Infinite)Query, and ensure(Infinite)QueryData, styleNonce in devtools, and legacy parts of sync-storage-persister.
queryFn is now required in useQuery, just as it already is in queryOptions. If you use a global default fetcher, you can't omit queryFn anymore—you must pass the explicit defaultQueryFn marker.
import { defaultQueryFn, useQuery } from '@tanstack/react-query'
// In v6, the global fetcher is wired up with an explicit marker
const query = useQuery({
queryKey: ['todos'],
queryFn: defaultQueryFn,
})
It's one line longer, but it makes clear that a query wasn't left incomplete and removes TypeScript's type-inference guesswork.
Two gcTime (inactive cache lifetime) changes are also planned: replacing the "largest value wins" rule with "last value passed wins," and fixing SSR where Infinity is the default yet an explicit gcTime in useQuery still triggers.
The biggest debate in the thread is a proposal to remove the enabled option in favor of skipToken.
import { queryOptions, skipToken } from '@tanstack/react-query'
// While id is missing, the query simply stays idle
const eventsOptions = (id: string | null) =>
queryOptions({
queryKey: ['events', id],
queryFn: id ? () => fetchEvents(id) : skipToken,
})
skipToken handles conditional queries cleanly and narrows types inside queryFn. The practical catch: what about permanently disabled queries triggered manually via refetch()? skipToken doesn't replicate that pattern one-to-one, and queryOptions factories are already sparking debate. The final call will depend on community feedback.
How to prepare and where to share feedback
There is no hard release date for v6: query-v6 will ship when ready, so you can knock out the baseline prep on v5 ahead of time.
What to check in your project right now
- Your build and tests run cleanly with pure ESM and no CommonJS.
- An upgrade to React 19 is planned (or moving off Vue 2 for
@tanstack/vue-query). - Deprecated v5 APIs are removed (
isInitialLoading, oldfetchQuery/prefetchQuerysignatures,styleNonce). - All cases where
enabled: falseis paired with manualrefetch()are audited.
If you run complex enabled or server-side gcTime setups in production, share them in discussion #12669. The TanStack team has one strict rule: don't send uncoordinated AI-agent pull requests—they get closed immediately, while code help is welcome after discussing it in the TanStack Discord.

