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
What is the recommended way to trigger a GET just once on button press?
React - queryClient.getQueryData(key) - can I think about it as about useContext?
<ParentComponent />
using useQuery
hook. I have a lot of nested children in this component and I need to display the data on the bottom of the tree and I consider following options:
- props drilling - sounds bad as usual props drilling 🙂
- context - there are performance issues with the context without using useContextSelector and it's not compliant for some reason.
- queryClient.getQueryData as a mechanism to retrieve in the bottom of the tree or throw when undefined.
...Modifying the type of mutateAsync's
mutateAsync
with partial data for that entry. However, the type for the variables
of the mutateAsync
function seem to be the same as each element in my useQuery
result, and this gives me a type error, because I'm leaving out a bunch of fields that the database will eventually default to.
Specifically, I have this:
```ts...Project structure
useInfiniteQuery Hook
fetchNextPage
working via the getNextPageParam
method. I do not know how to go about the fetchPreviousPage
working, i've tweaked with the getPreviousPageParam
method but it doesn't still work. I'll appreciate if anyone can point out how i can fix this. Attached below is the query function:
`const {
data,
fetchNextPage,...Vue Query potential issue?
use...()
in two components).
In both components it has staleTime
of 60 minutes.
When I'm loading app in Cypress tests, sometimes it fails (80% of the time).
The difference between pass and fail is that when test fails - query is called only once (as expected). And test passes when query is called twice (but only one request is actually made)....React Query with apisauce
How i can use QueryClient in server and client component?
QueryClient
from a separate file and import it in my components?...Angular Query
Error Handling Mechanism
invalidate all queries with specifix prefix
`invalidateQueries` only triggers re-fetch once after reload but not afterwards
invalidateQueries
onSuccess
and the dialog will be closed.
For the first time after reloading this also re-fetches the query connected to the table after invalidation. After that, when I edit data again, nothing happens. How can that be and how to fix it?
UPDATE: The source problem (I think) is that I set the queryClient
within the function body because showNotification
is used with is returned from a custom hook. I would like to keep this solution but do not know how...MongoDB's Keyset Pagination technique
`setQueryData` slow to update
setQueryData
to opmistically persist reordered elements, but looks like there is some kind of delay to state update and I can notice a flash of items getting back to old positions before the new order is persisted.
Is there something I can do without need to use a local useState?...setQueryData with infinite query
Mutation optimistic updated slows down the UI
how to cancel / disable previous mutation onSuccess calls?
Delay query invalidation
How to know HTTP status code in `onError`
onError = (error: Error) => {
}
onError = (error: Error) => {
}
Infinite query + loader