Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

94
Views
Mutation in Apollo Client

I am using apollo client to perform an auto login with refresh token. The code I use is:

 const expirationTime = exp * 1000 - 60000;
if (Date.now() >= expirationTime) {
  await client //this is how user relogin
  .mutate({
    mutation: USER_LOGIN,
    variables: { rt: localStorage.getItem("refreshToken") },
  })
  .then((response) => console.log(response.data))
  .catch((err) => console.error(err));
}

But I am not sure whether this is the right way, because my app seems to crash when I do this. I read the documentation for react but couldn't find anything other than useMutation

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!