How to get data in dependent querys? #3257
Unanswered
ZahraMirzaei
asked this question in
Q&A
Replies: 1 comment
-
Why do you want to call a const [getUserId, userIdResponse] = useFindMutation({
fixedCacheKey: USER_ID_CACHE_KEY,
});
const { data: userInfo } = useGetUserInfoQuery(
{
id: userId,
},
{
skip: !userIdResponse.isSuccess,
}
);
const userId = userInfo.userId; // or something like that |
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.
-
Scenario:
I have a web application when the user clicks on
signin/signup
button and goes to signin page, the user should sign in with a google account. then If the user had already registered and had a username, should redirect to the home page, else redirect to signup page.Description with code:
userId service:
userInfo service:
A part of signin page:
As I mentioned above in
.then
part, I want to getuserId
there and then fetchuserInfo
, and check if user registers or not.but after call
getUserId
, in.then
part when I checkuserInfo
itsundefined
. Based on my search it may be can be solved byManual Cache Updates
but I'm not sure.Please guide me, on how to solve this problem.
Beta Was this translation helpful? Give feedback.
All reactions