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
How to handle when query depends on a non string/JSON serializable object reference?
What are some common practices regarding queryOption abstractions?
US partner wanted for a profitable venture
MutateAsync error handling (callback vs. try/catch/finally)
Reconcile query invalidation with fresh data, selectively overwrite cache.
useSuspenseQuery when offline
experimental_createPersister so the network mode is set to offlineFirst. Whenever I render this when offline, and no data is persisted yet, the suspense fallback (LoadingComponent) keeps showing. Instead I want a placeholder to tell the user they are offline and they should retry when online.
```ts
<QueryErrorResetBoundary>...`keepPreviousData` with `useSuspenseQuery` with nextjs streaming ssr
useSuspenseQuery with ReactQueryStreamedHydration from @tanstack/react-query-next-experimental
This works great
However my query has a regular changing query key, but I want to show the previous data during loading states
So I switched useSuspenseQuery to useQuery with placeholderData: keepPreviousData, this also worked great however it lost all of the server streaming behavior...queryOptions counterpart for useMutation?
queryOptions as mentioned in this section of the documentation:
https://tanstack.com/query/v5/docs/framework/react/guides/query-options
I was wondering if there was a counterpart for this for useMutation....Query returning old data after mutation when manually setting data using setQueryData
How to mock loading/error states.
Vue Query 401 Unauthorized response
How can I pass an authorization header to all queries and mutations
UI gets stuck after updating React to React 18
Is there a way to either go back to initial state or set data directly?
How do I tell useQuery that initial data is prefetched on the server?
MyData | undefined because useQuery doesn't know the initial data will be there. How do I solve that? For now I solved it by setting initialData: {} as MyData in useQuery but I wonder if there is a better way?How to use CSS Modules with TanStack Start?
response.json() failing only within useQuery - receiving HTML instead of JSON
"next": "14.2.5"
What's strange is:
The endpoint works perfectly when called directly or in a normal fetch...refresh in useQueries cause infinite rerender
useAllData causes a re-render, whereas useOneData data works normally?
```
const useOneData = () => {
const { data, refetch } = useQuery(["a_key"], async () => {...`getPreviousPageParam` final parameter - is it the "current" page or is it the previous page?
useInfiniteQuery.
So the documentation code here:...
Setting gcTime on prefetched data
prefetchQuery on the serverside to fetch some data for the page. The page that is loaded does not actively have a useSuspenseQuery call for that particular piece of data, it is only used on other pages. The useSuspenseQuery sets a gcTime of Infinity to disable garbage collection on the prefetched data. The prefetch call also sets gcTime of Infinity.
The problem:
The prefetched data stored in the query cache gets a gcTime of "5 minutes" when there are no active queries subscribed to it, since there is nobody there to tell it otherwise. That means there doesn't seem to be a way to keep the prefetched data around until it's actually used by a query hook, without just calling a "dummy" hook on every page to make sure gcTime is set?...