npm / @tanstack/solid-query
@tanstack/solid-query
What changed in @tanstack/solid-query 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
75 breaking9 deprecations16 new APIs and options1 performance1 behavior and defaults12 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@tanstack/solid-query 5114 changes
Breaking changes 75
The filters accepted by this API no longer include status; it always counts mutations with status: 'pending'.
Excludes fetchStatus from filters accepted by QueryClient.isFetching, useIsFetching, and injectIsFetching; these APIs always count queries with fetchStatus: 'fetching'.
Removes the
promiseproperty from query results.Removes experimental render-time prefetching.
The Solid prefix was removed from SolidInfiniteQueryOptions, making InfiniteQueryOptions the type name.
The Solid prefix was removed from SolidMutationOptions, making MutationOptions the type name.
The Solid prefix was removed from SolidQueryOptions, making QueryOptions the type name.
Custom loggers have been removed; logging only had an effect in development mode.
Custom loggers have been removed; logging only had an effect in development mode, where passing a custom logger is not necessary.
Queries and mutations are always dehydrated by default; customize this with shouldDehydrateQuery or shouldDehydrateMutation instead of boolean options.
Queries and mutations are always dehydrated by default; use shouldDehydrateQuery or shouldDehydrateMutation to change this behavior.
Error is now the default TypeScript error type instead of unknown; specify a generic for other thrown values.
Error is now the default TypeScript error type instead of unknown; specify a generic to use another thrown value type.
Renamed from cacheTime; it controls when unused query data is garbage collected.
Renames cacheTime to gcTime to clarify that the duration applies after a query becomes unused, before its data is garbage collected.
Now required for infinite queries; returning null or undefined indicates that no further page is available.
Returning null, as well as undefined, now indicates that no further page is available.
Returning null or undefined now indicates that no further page is available.
Renamed from hashQueryKey; it also hashes mutation keys and can be used in mutation predicates.
Renames hashQueryKey to hashKey, which also hashes mutation keys.
Required for infinite queries and supplies the pageParam for the first page instead of implicitly passing undefined.
Infinite queries now require an explicit initialPageParam, used as the pageParam for the first page.
Removed; use structuralSharing to provide the equivalent comparison behavior.
The useQuery option has been removed; use structuralSharing to implement equivalent data comparison.
For queries, now means isPending && isFetching; for mutations, the former isLoading flag is renamed isPending.
Replaces isLoading as the derived flag for pending queries and mutations.
Use this flag in place of isPreviousData; placeholderData now puts the query into success state and dataUpdatedAt stays at 0.
Removed in favor of isPlaceholderData.
The keepPreviousData option was removed; use placeholderData with the identity function or the included keepPreviousData function.
An included identity function can be passed to placeholderData to achieve the previous keep-previous-data behavior.
The keepPreviousData option and isPreviousData flag are removed; use placeholderData with an identity function or the included keepPreviousData function.
Removed the ability to override pagination parameters by passing pageParam directly to fetchNextPage or fetchPreviousPage; getNextPageParam is now required.
Manual mode for infinite queries has been removed, and getNextPageParam is now required.
Network status no longer relies on navigator.onLine; it starts online and updates from online and offline events.
Starts online and updates only in response to online and offline events instead of relying on navigator.onLine.
Removed from queries and QueryObserver callbacks; mutation callbacks are unchanged.
Query callbacks onSuccess, onError, and onSettled have been removed; mutation callbacks remain.
Now receives previous query data as an argument, allowing an identity function to provide keep-previous-data behavior.
Its callback now receives previous query data, enabling an identity function to provide the prior data as placeholder data.
Class fields and methods that were TypeScript-private now use ECMAScript private features and cannot be accessed externally at runtime.
Class fields and methods that were TypeScript-private now use ECMAScript private features and cannot be accessed from outside at runtime.
QueryClient methods that accept query or mutation filters now use the single options-object form instead of positional overloads.
Now accepts only queryKey; the filters argument is no longer accepted.
Now accepts only a queryKey argument; remove any filters argument from calls.
Now merges all matching registrations instead of returning only the first matching registration.
Now accepts only queryKey; the filters argument is no longer accepted.
Now accepts only a queryKey argument; remove any filters argument from calls.
Registrations should be ordered from the most generic query key to the least generic because matching defaults are merged.
Its callback now receives only query rather than data and query; transformed data is not provided.
Its callback now receives only the query, rather than data and query.
Window-focus refetching now uses visibilitychange exclusively and no longer listens to the focus event.
Removed in favor of maxPages for limiting infinite-query pages stored and refetched.
The infinite-query refetchPage option has been removed in favor of maxPages, which limits stored and refetched pages.
Removed from the useQuery result; use queryClient.removeQueries with queryKey to remove a query.
The remove method has been removed from useQuery; use queryClient.removeQueries({ queryKey }) to remove a query.
Retries now default to 0 on the server instead of 3.
Retries now default to 0 on the server.
Function equivalent to the removed dehydrateMutations boolean option for controlling mutation dehydration.
Function equivalent to the removed dehydrateQueries boolean option for controlling query dehydration.
The loading status value is now pending for queries and mutations.
The loading status is renamed to pending for queries and mutations; isLoading is renamed to isPending, and queries gain a new isLoading flag.
The supported browser requirements have been updated to produce a more modern, performant, and smaller bundle.
The experimental suspense boolean flag on query hooks has been removed in favor of dedicated suspense hooks.
Replaces useErrorBoundary as the option for controlling whether errors are thrown.
The minimum required TypeScript version is now 4.7.
The minimum required TypeScript version is now 4.7.
No longer automatically used as the batching function; frameworks can register a custom function with notifyManager.setBatchNotifyFunction.
Renamed to throwOnError to describe its behavior in a framework-agnostic way.
Infinite-query hooks now support only the single options-object signature; positional overloads have been removed.
The hook now supports only the single options-object signature; positional overloads have been removed.
The hook now supports only the single options-object signature; positional overloads have been removed.
Mutation hooks now support only the single options-object signature; positional overloads have been removed.
Query hooks now support only the single options-object signature; positional overloads are no longer supported.
Query hooks now support only the single options-object signature; positional overloads have been removed.
Window-focus refetching now listens exclusively to the visibilitychange event, not the focus event.
Deprecations 9
Deprecated because it has the same behavior as the new isLoading flag and will be removed in the next major version.
isInitialLoading is deprecated; it has the same behavior as the new isLoading flag and will be removed in the next major version.
Deprecated in favor of queryClient.infiniteQuery with staleTime set to static and will be removed in v6.
Deprecated in favor of queryClient.query with staleTime set to static and will be removed in v6.
Deprecated in favor of queryClient.infiniteQuery and will be removed in v6.
Deprecated in favor of queryClient.query and will be removed in v6.
Imperative fetch and prefetch methods are deprecated in favor of queryClient.query and queryClient.infiniteQuery, and will be removed in v6.
Deprecated in favor of queryClient.infiniteQuery with a catch handler and will be removed in v6.
Deprecated in favor of queryClient.query with a catch handler and will be removed in v6.
New APIs and options 16
Adds mutationOptions to solid-query.
A new option for useQueries.
A new combine option is available for useQueries.
An experimental fine-grained storage persister is available.
An experimental fine-grained storage persister is available.
Limits the number of pages stored in infinite-query data and subsequently refetched; both pagination directions must be defined.
Infinite queries can limit the number of pages stored and refetched; the infinite list must define both getNextPageParam and getPreviousPageParam.
Infinite-query prefetching can use the pages option to prefetch more than the first page.
Infinite queries can prefetch more than the first page using the pages option.
Introduced as the replacement for queryClient.fetchInfiniteQuery and as an API for infinite queries with an options object.
Introduced as the replacement for queryClient.fetchQuery and as an API for querying with an options object.
A typesafe way to create query options is available.
Mutation results expose submittedAt and variables for simplified optimistic UI updates without writing data directly to the cache.
A dedicated suspense infinite-query hook provides data that is never potentially undefined at the type level.
A dedicated suspense queries hook provides data that is never potentially undefined at the type level.
A dedicated suspense query hook provides data that is never potentially undefined at the type level.
Performance 1
The supported browser set was updated to produce a more modern, performant, and smaller bundle.
Behavior and default changes 1
Allows a framework with a custom batching function to register it with TanStack Query.
Fixes and other changes 12
Corrects the overload selected when initialData may be undefined.
Corrects the overload selected for initialData in solid-query's queryOptions and useQuery.
When the queryClient passed to useQuery changes, the hook now subscribes to the new observer.
Switched the SSR cleanup property to address an Astro crash.
Fixes return types so exported inferred options can be emitted in declaration files without leaking internal data tag symbols.
Mutation variables are optional when
undefined extends TVariables.Propagates generic type parameters to the select callback.
Maintains the error state on reset refetch when initialData is defined.
Fixed solid-router so context reads use only useQueryClient and useIsRestoring.
Solid now allows both create- and use-style APIs.
Deprecated type aliases now forward generic parameters.
Errors are skipped if returned data is undefined.