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 do Optimistic updates with useInfiniteQuery?
getNextPageParams with a limit of 10 items and you are already loaded 50 items (5 pages), then you are deleting 1 item on page 2, and it means that all items inside "page 3", "page 4", etc should "shift to the left" inside our optimistic update, so the "page 2" will contain 10 items)
So, if someone already have a working example it would be huge for me!...Is onSuccess recreated on each render?
prevHemoglobinValue would be outdated in the onSuccess callback?
```js
export const useEditHemoglobinEntryMutation = () => {
const dispatch = useDispatch();...onMutate and TS
newQuote param on onMutate states that it is of type void? But printing it clearly reveals that it is of type TrackdayPlannerQuoteResponse.
```ts
return useMutation<TrackdayPlannerQuoteResponse>(
(data) =>...React warning after removeQueries
How to type pageParam in useInfiniteQuery hook?
pageParam in useInfiniteQuery hook?
I'm doing it currently this way, but maybe there's a better way:
```
useInfiniteQuery<FetchStuffResponse>(...wrap use-query in hooks?
Refetch interval and stale time?
refetchInterval and the staleTime, or do those effectively accomplish the same end behavior?Use mulitple `queryClient.prefetchQuery` in parallel
queryClient.prefetchQuery in parallel in getServerSideProps?Improve Pagination
map inside Dependent query
balance which is equal to [1,2], but I haven't been capable.
I've tried even with the parallel query notation that looks pretty similar to what I'm looking for, but it must be a dependant query, indeed. Could you help me?
...Selector for rejected promises
{ result: null, error: { message: "something is wrong" } }
and I want to select the error object from the response (so the react query error object would be just { message: "something is wrong" }), I know we can pass a select callback to transform the result when the promise success, but I don't see something like that for rejected promises....Using useMutation mutate params as mutationKeys
Chained query
clear cache on error
error and previously cached data .
This is undesired for my use-case, but I can't figure out a way to achieve that.
To be clear,
Expected: useQuery only returns error but no data when the request fails....Using axios with RQ
validateStatus < 500 and using error boundaries a fair bit) and I was just wondering if (more seasoned) RQ users tend to use an axios response interceptor to wrap/decant the axios response into a custom data structure for using in custom useQuery wrappers etc.
Cheers!...useQueries - adding a queryKey or any way to mark the result?
queryClient.getQueryData is undefined once refresh
Is there built in debounce feature?
useQuery hook with the same key practically at the same time, and I noticed that there's still only 1 request to the endpoint. Before I added react-query to the project there were 2 request which is bad of course.
I'm not sure why it is happening. I haven't changed defaults, so staleTime must be 0, right? So why I see only 1 request?...optimistic *delete* with infinite query
10. In getNextPageParam, if the length of lastPage is less than 10, then return undefined to indicate that there's no more data.
- The first page is loaded
- I delete one item, setQueryData with 9 remaining items...Notifications and live updates - are websockets the best way to do it?