query
query copied to clipboard
🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.
### context Almost everyone gets `cacheTime` wrong ([exhibit A](https://twitter.com/TkDodo/status/1575893647392145408)). It sounds like "the amount of time that data is cached for", but that is not correct. `cacheTime` does nothing as...
Related: - https://github.com/TanStack/query/discussions/2649 One approach would be to have another async function that runs _before_ the `queryFn` (and maybe one that runs _after_ it ?) that would skip calling the...
### Describe the bug Our code uses `react-native`, `useInfiniteQuery` with `PersistQueryClientProvider`: ```typescript const queryClient = new QueryClient({ defaultOptions: { queries: { staleTime: 5 * 60 * 1000, // 5 min...
### Describe the bug Infinite Queries can be used in two ways: - they implement `getNextPageParam / getPreviousPageParam` (automatic) - they pass `pageParam` directly to `fetchNextPage / fetchPreviousPage` (manual) Mixing...
Hydration implementation details (major) Step 1: Should still happen in render for new queries (and queries with no observers?), but be scheduled for a useEffect for queries that someone is...
as per this RFC: - https://github.com/TanStack/query/discussions/4426
### context Inspired by [swr cache provider](https://swr.vercel.app/docs/advanced/cache#cache-provider), we can allow to pass a "custom cache" into our QueryCache: ``` new QueryClient({ queryCache: new QueryCache({ cache: myCache }) }) ``` The...
### context we currently use `unstable_batchedUpdates` as our `batchNotifyFn` in React and React Native: https://github.com/TanStack/query/blob/357ec041a6fcc4a550f3df02c12ecc7bcdefbc05/packages/react-query/src/setBatchUpdatesFn.ts#L4 Apparently, this function is a "noop" in React18, as discussed here: https://github.com/facebook/react/issues/24831#issuecomment-1296944806 ### proposal -...
### context `remove` removes the query from the queryCache without informing observers about it. It is best used to remove data imperatively that is no longer needed, e.g. when logging...