TanStack

T

TanStack

TanStack is a community of passionate software engineers striving for high-quality, open-source software for web devs

Join

react-query-questions

solid-query-questions

table-questions

virtual-questions

router-questions

react-charts-questions

ranger-questions

vue-query-questions

svelte-query-questions

bling-questions

form-questions

angular-query-questions

start-questions

db-questions

start-showcase

router-showcase

📣-announcements

quickest-silver
quickest-silver8/3/2025

Make queries reactive

When passing a query object to a component like this: ```ts const dataQuery = useQuery(() => ({...
conscious-sapphire
conscious-sapphire4/28/2025

SolidQueryDevtools doesn't render in a TansStack Start app

When I try to add the dev tools to a Start project using Solid, I just get a [object Promise] Example: https://codesandbox.io/p/devbox/amazing-varahamihira-n3n952...
deep-jade
deep-jade4/21/2025

Solidstart + TanStack/query error prefetch

Hello, I'm writing here because I have a problem with TanstackQuery. I tried to implement it in my Solidstart project. But I get this error every time:
 (index):347 Uncaught (in promise) Error: experimental_prefetchInRender feature flag is not enabled
 (index):347 Uncaught (in promise) Error: experimental_prefetchInRender feature flag is not enabled
Here is an example of my implementation : ``` export default function Home() {...
conscious-sapphire
conscious-sapphire4/1/2025

Solid.js + tanstack/solid-query multiple refetch problem on error

Hi all, I'm using tanstack for client-server communication. And I'm turning the hook to createMemo if I want it to be re-mounted when I change query-params. But, for some reason, if such a hook receives an error from the server, it mounts infinitely many times. How to solve this problem?
const eventsQuery = createMemo(() => messagesIds().length ? getScheduledEventsApiFrontendScheduledEventsGetQuery(...
No description
firm-tan
firm-tan3/24/2025

How to use QueryClient within Actions

It's my first time using Solid Query in a Solid app and have questions about what the proper usage of it is within action functions that come from Solid. Given the following: ```ts type SignInForm = {...
rising-crimson
rising-crimson11/2/2024

TanstackQuery useMutation example

Hey folks, would like your takes/assistance on a silly one. I'm using TSQ for a small SolidJS project and I'm trying to create a mutation but it seems like the newer version does not support the previous version in which we passed a mutationFn and a mutationKey . This is the way I usually go about it. I've got the follow function to create a thing: ``` const createThing = async (thing: object) => { try {...
robust-apricot
robust-apricot10/24/2024

Error: experimental_prefetchInRender feature flag is not enabled

I started getting this error in Solid Query in code that worked fine before. Has there been a breaking change?
No description
correct-apricot
correct-apricot5/21/2024

Invalidate during an action()

If you have an action attached to a form, and you call invalidate and await that, the rest of the action never runs.
``` const myAction = action(async ()=>{ /// do something await queryClient.invalidateQueries();...
correct-apricot
correct-apricot5/21/2024

TypeScript errors for createQuery(options, queryClient)

If I do the following: ``` const tsqSessionQueryOptions = () => { return queryOptions({...
wise-white
wise-white5/14/2024

Suspend with query data from external promise

I'd like to do something like the following repro: - Create a query in a component - Fetch query data in some promise outside of the createQuery - Use that promise as the next result for the createQuery - Cause the createQuery to re-suspend while waiting for the promise to resolve...
absent-sapphire
absent-sapphire3/29/2024

accessing the queries status triggers <Suspense>?

Hi, Using the latest solid-query and got a question regarding its interaction with suspense: Stackblitz repro: https://stackblitz.com/edit/solid-vite-6v3qxx?file=src%2Findex.tsx...
robust-apricot
robust-apricot3/20/2024

Bug during hydratation - wrong queryKey is hydrated

I use Solid Query to load a list of items. The list is paginated. Page number is part of the queryKey. If the user clicks on the "Next page" button before hydratation has completed, the user sees the title "Page 2" but is displayed items that belong to page 1. On window refocus, items for page 2 are fetched and displayed correctly. In Solid Query dev tools, I can see:...
magic-beige
magic-beige3/13/2024

Suspense sometimes not resolving

Hi there, I've got a bit of a strange issue which I believe is a bug in solid-query. I've got a reproduction here https://stackblitz.com/edit/solidjs-templates-al24pp?file=src%2FApp.tsx When typing into the input slowly everything works correctly, however spamming keys quickly can sometimes cause it to get stuck in a loading state. I believe it might be a race condition somewhere, as my demo doesn't actually reproduce it quite as reliably as the app I extracted it from....
robust-apricot
robust-apricot2/8/2024

Optimistic updates without re-rendering everything?

Hi, I have a shopping cart. When a user changes the quantity of some item, I'd like to do an optimistic update along with the mutation. If I call:
queryClient.setQueryData(['cart'], /* shopping cart where relevant item is modified */);
queryClient.setQueryData(['cart'], /* shopping cart where relevant item is modified */);
...
metropolitan-bronze
metropolitan-bronze1/10/2024

Query dependencies

Is there any way to mark one query as dependency of another query? literally, I need to pass part of the data from one query into another one. I don't think enabled: would work for me, as I need to hold suspense and resolve all of these queries during SSR phase. I could probably combine them in the same async+query, but that means I can't reuse first query without the second one...
fascinating-indigo
fascinating-indigo11/11/2023

Ability to disable suspense for certain queries

I only want <Suspense> to only be triggered on certain queries, is there no way to do this? The suspense property in query options seems to be ignored and from what I can tell in the source code, nothing actually reads that property.
old-apricot
old-apricot8/22/2023

Same update for multiple queries

My app has a general feed with posts of all the subcommnuties under the queryKey ['posts', communityId]. But you can go directly to one community and scroll over the posts of that community (queryKey: ['posts', communityId, subCommunityId]) And if you enter to see post details you have the queryKey ['post', 'communityId, postId] My problem is that every mutation hook that dispatch an action like 'comment', 'upvote', etc ends in three setQueryData that the search in the list of posts to update the correct post....
automatic-azure
automatic-azure8/7/2023

Multiple calls in createInfiniteQuery

this question is not strictly related to the solidjs version, it would be the same with useInfiniteQuery, is there a way in the queryFn to call two api endpoint instead of just one? I need to aggregate some data from two different call ``` queryFn: ({ pageParam = 1 }) => fetchPage(pageParam),...
rival-black
rival-black8/1/2023

getQueryState result isn’t reactive

I'm calling queryClient.getQueryState(['current-user'])?.status === 'error' in a Match statement but despite the query erroring, the conditional never renders In order to account for this I hacked it into an effect ``` let timerId: number | undefined; createEffect(() => { timerId = setInterval(() => {...
sensitive-blue
sensitive-blue7/27/2023

Weird behaviour with setQueriesData

I have a mutation that I want to use the setQueriesData feature. The behaviour I'm seeing, is that the query gets invalidated despite the fact that I'm setQueriesData is called, and not invalidateQueries. I've tried creating a reproduction but couldn't. Is there any reason why using setQueriesData would also invalidate the query? The query involved is as follows: ``` const listResourcesQuery = createQuery({...
Next