React Query refetch is refetching very slowly

So I'm running into an issue with react query where I am having to put an event listener which refetches the data to display. Essentially, we're using a 3rd party api to schedule meetings (Nylas), and their api is interesting, and requires you to attach a modal to the window. We are refetching the data when the window sees the modal closing. We know that the event listener is running due to a console.log. However, when we call the refetch function, the data doesn't update right away, instead, it will stall for a few seconds, and then eventually update. We know that the data is updated, since when you reload the page, the data is correct. Any ideas on what I could be doing wrong here? Should I be running a useMutation despite not owning the 3rd party api? Am I misunderstanding refetch? Thanks in advance!
7 Replies
Neto
Neto2y ago
is the request itself show? if on devtools the request time is slow or if its on rq side
Kyle
Kyle2y ago
no the request itself is not slow
Neto
Neto2y ago
you can check the react query devtools to see from the refetch to the state phase
Kyle
Kyle2y ago
oh true true holy shit lmao our typescript is so out of date that we run into a type error with ts with the devtools
Neto
Neto2y ago
oh lmao
Kyle
Kyle2y ago
I hate this godforsaken codebase lmao
Neto
Neto2y ago
ik the feel
Want results from more Discord servers?
Add your server