Hi, how can I delay or pause all queries and resume them when needed? #7555
Unanswered
luckykenlin
asked this question in
Q&A
Replies: 1 comment
-
Hi you can use cancelQueries and after refetchQueries, so in cancelQueries you canceling your queries basing on query keys, after you refetching queries by query key. I think it might work |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I use Laravel with react query and Axios as the fetching library. I set Axios withCredentials: true to avoid unauthorized issues.
Everything works great until I use Google login.
After logging in with Google and being redirected back to the main page, I need to post the Google ID to the server for authentication.
However, some stale queries are refetching in the background with unauthorized cookies,
as the login request hasn't yet been completed. This causes the stale queries to overwrite my cookie, leading to unauthorized issues.
Is there a flag I can use to pause all background queries and resume them when needed?
This way, I can pause and resume all queries after the login process.
Any tips and help would be really appreciated.
Beta Was this translation helpful? Give feedback.
All reactions