How to retrigger a defined query (was defined using useQuery), without a queryFn? #5964
Unanswered
Jurek-Raben
asked this question in
Q&A
Replies: 1 comment
-
Not sure how your keys are structured, are they related? Eg. maybe they begin with a common string or object? Anyway you can use or await queryClient.refetchQueries({ queryKey: [key] })
// or
await queryClient.invalidateQueries({ queryKey: [key] }) //may need do specify refetchType depending on your usecase |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to await a query, which already was defined before in a useQuery, but retrigger it without the need to define a new queryFn. Instead, it should retrigger the one before... is this possible?
This should happen within the react router v6 loader method, here some pseudo code:
Beta Was this translation helpful? Give feedback.
All reactions