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 access queryClient to invalidate cache?
queryClient
from _app.tsx
. I have some instances where I want to invalidate cache (for example when I mutate data). From the docs (v5) it seems that the only way to do this is through queryClient
.
What do you think of something like this, is it okay? It bugs me that I am importing something from _app.tsx
, at the same time I am not sure how to do otherwise.
```tsx
export const queryClient = new QueryClient();...share data from component
useQuery fire on each mount
react-query doesn't use the client cache from the useInfiniteQuery when routing to the same link
invalidate without using hook
"a vast majority of users do not actually need a normalized cache" ... "check with us first"
Clarity about keys and refetching
empty data on refetch error
useQuery with different queryKey
React Query fetches data even if staleTime is set to Infinity
How to implement a callback/action when the query is successful?
useQueries isPending is always true
useQueries
, I see that even if I set placeholderData
isPending
is always true when refetching with different params.
What I'm trying to have is a Skeleton on first load, then a "loading indicator" when the user triggers another request because of a filter or something.
If isPending
and isLoading
are always true, how can I check that the request is not happening for the first time with useQueries
?...Initial data is applied when the query key is changed
How do you provide a default select function and keep TypeScript happy?
What's a good style for organizing useMutation and fetch function types?
Suspense and Mutations
<Suspense>
, and I'm trying to understand how it can (and if it should) be used with mutations. For example, we have a file upload that is being handled with a mutation. When the mutation is in progress/file is uploading, we want to show a loading indicator. Can <Suspense/>
be used here somehow? Or, since this is a mutation, it needs to use cond...How to install old version of tanstack react query using yarn
Migrated from v4 to v5, don't know how to use it without onSucess
Hide API key to frontend
Migrating v4 to v5 give me couple of errors on some of the queries
codemod
in the docs. After running it, I get some queries where I have to manually migrate te query. But I'm having problems understanding the error and how to migrate them. For example
```ts
// v4...