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
Always refetching 😫
one query depending on another
useItem query depends on my useFormOptions query, and sometimes useItem finishes fetching before useFormOptions.
What would be the correct way to always prefetch form options (or fetch if stale) before actually fetching item?...Stuck with Cache
How to work with rotating auth tokens? (Clerk)
useQuery hook that fetches some global settings data for my application.
However, updating other things in my application has the potential to invalidate the cache that this call has, and so, it will need to be refetched (which happens automatically, since we are dealing with a global context).
Here is what I think might be problem. I think useQuery might be caching (?) the auth token that is passed to my backend in the call?...new QueryClient instantiated in a function component
cacheTime, maxAge and persistence
maxAge: Infinity in persister and cacheTime: Infinity in default query options, following the documentation. It all works.
However, there are some queries which I don't want to be persisted forever and I would like them to be garbage collected after, let's say, 10 minutes of inactivity. If I unsubscribe from such query and app is running for the next 10 minutes, it all works as expected. Query is removed from cache and it will not be persisted. But, if the app gets killed/closed after unsubscribing from the query, but before 10 minutes, the query will stay in the cache and it will be persisted. So when I open app again, after hydration query will be there with the cacheTime: Infinity from defaults, and it will basically stay in the cache forever if I never subscribe to it again.
Is there any way it can be solved? So if unsubscribe from this query, kill the app after 2 minutes and then open it again after an hour, the query won't get hydrated?...Invalidating Queries doesn't send a request
getWebsites does not invalidate when invalidate is called. TRPC's invalidate is using queryClient.invalidateQueries
I have the following code snippet:
```ts
const websites = trpc.website.getWebsites.useQuery(undefined, {...
simple useQuery is forever loading...
How to access previous data of query?
Request not being cached
How to use hooks in react-query global onError handler

React query calling api each time and not caching

TS best practice with `enabled` prop
isValid=true . How do you guys handle this situation?
I'd love to hear your opinion on this approach....
Running query being cancelled for no discernible reason
useInfiniteQuery, on the page /documents/[category] with the query key ["documents", category].
Each document can be opened and edited on the page /document/[id] with the query key ["document", id]. After being edited, the document's query cache ["document", id] and any query caches matching the key ["documents"] that contain that document are invalidated.
The issue ...
Managing Consistent Favorited State Across Paginated Searches with React Query
How to use react-query for a request with filters
TS errors using ColumnMeta - All declarations of 'ColumnMeta' must have identical type parameters
ColumnMeta interface to fix the error?
```
declare module '@tanstack/table-core' {
interface ColumnMeta<PartialContact extends RowData, TValue> {
columnName: string...Using component function names in query keys?
LogReadingsMainGrid I was thinking maybe we can use the function name.
So instead of typing useQuery(['logReadingsMainGrid', id], ... we can use useQuery([LogReadingsMainGrid.name, id], ... where LogReadingsMainGrid is the component function name.
In my tests this works fine and linters can catch if a developer copies this code into a new component and forgets to change it. However I'm wondering there's a reason not to do this that I'm not seeing....fetch at the same time + expired token issue
Referential stability of the mutation object