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
Struggling to build a PWA with react-query
PersistQueryClientProvider
with localStorage
. I have this specific use case where I have refetchOnWindowFocus
enabled, which provides a better overal UX imo. The issue is that when a user is on another application, looses his network connection somehow, then returns to my PWA, the queries will be executed (be cause of refetchOnWindowFocus
) and ultimately fail which will then delete the cached data in local storage, why does this happen? Btw im not using the offlineFirst
network mode (just using the default one) because that would require me to cache the API data in my service worker (which I might consider now because of all the issues I have building an offline experience).
Tips are welcome! 🙏...Help figuring out why queryFn is firing with stale params
Is it considered bad practice to use a GET request with useMutation?
Error while using Expo: No QueryClient set, use QueryClientProvider to set one
Customizing error messages in global onError callback.
Successfully created [name_of_thing]
where [name_of_thing]
comes from the mutation response. In the case of an error, [name_of_thing]
may need to come from local state if the network request fails. I can't use the meta
option because the data isn't static. I thought a...Reconcile server data, local state, session storage.
Problems integrating Tanstack Query with MUI X Data Grid server-sided data source
@mui/x-data-grid
server sided data (https://mui.com/x/react-data-grid/server-side-data/).
Based on a different post in the MUI discord I got to the conclusion that this should be feasible by providing a queryClient.fetchQuery
to the getRows
function for the dataSource
however the problem I am now facing is that I get the following error from the onDataSourceError
:...Is it expected behavior that polling queries ignore offline mode?
Using RQ with MultipleSelector component in Async
getNextParam is for the wrong query
Refetch at every X seconds
refetchInterval
behavior. I'm working with a query that should refetch every 60 seconds, but I need it to sync with an external schedule.
Use case: Users can land on the page at any time, but data updates happen on a fixed 60-second server schedule (e.g., at :00, :01, :02 of each minute). If a user arrives at :40, I want the first refetch to happen in 20 seconds (to sync with the :00 mark), then continue every 60 seconds after that....How to run the `queryFn` only on the server and not on browser at all?
Nextjs Warning: Cannot update a component (`Router`) while rendering a different component (`Home`). To locate the bad setState() call inside Home
Nextjs Warning: Cannot update a component (`Router`) while rendering a different component (`Home`). To locate the bad setState() call inside Home
queryOptions not persisted during the hydration/dehydration process
gcTime
and staleTime
?
Seems like it only does it for queryKey
, queryHash
, and meta
.
This causes some issues in TS Start when defining queries with custom options on the server as those completely get lost on the client....Is this cursed? Anyone knows a better way to achieve it?
useGlobalStore.getState().selectedProvider
to not break the rule of hooks does not work, as it isn't reactive. This can be obviously fixed if i just do a proper custom hook instead of just using the queryOptions, but wanted to know if this is accepted or if there is a good way to do it like this, else i'll just make it a custom hook
```ts
export function getUsersQueryOptions(params: QueryUserDto) {
// eslint-disable-next-line react-hooks/rules-of-hooks...Is it possible to augment the queryKey type? i.e extend Register for queryKey
Offline behaviour (V5)
Unexpected useQuery behavior
Dispatching actions based off query response
useInfiniteQuery
as well.
We thought about handling this in an effect, but since the effect modifies the state that is an input to the query, it triggers a re-fetch. I think ultimately, we are going to have to keep track of the inputs to the api request and the ui state separately, but I wanted to see if there was a documented pattern here. ...query composition/dependencies
Programatically stop/pause all queries