Using queryCache and mutationCache instead of axios interceptor #7617
Unanswered
dexterarmy
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I would rather use an interceptor on the API layer for that. |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
So i needed to implement a functionality where if the token is expired then i will make a refresh token call and after that again make the same api call which resulted in expired token error.
So for this instead of using axios intercepter i used queryCache and mutationCache from react-query.
CODE ->
Is this the correct way to do this functionality , or i should use axios inspector instead of queryCache and mutationCache ??
Beta Was this translation helpful? Give feedback.
All reactions