Closed matepaiva closed 3 years ago
I converted it to a refetchable
fragment and now it works.
So, to close this subject: what I understand is that useQuery(query, vars, config).retry()
should not be used, as the response could be a cached one.
What I also understand is that we should use useRefetchable(frag, prop).refresh()
when we want a cache-free response.
Thank you
I am probably doing something wrong, but I can't figure what.
I want to refetch the data everytime my user log in or log out. So I have a hook that tells me if the user is logged in:
What I thought I could do is to useEffect to retry the query when
isLoggedUser
changes:That didn't help. The network tab is not showing any new requests.
So I thought another possible way would add a fetchKey:
But that didn't re-fetch either ─ I looked into the network tab.
I logged my data on my component:
So, the first load happens ok, but even if I try to retry it never happens again. I didn't find any information that could help me in the documentation. Do you have any clue about what I am doing wrongly?
Dependencies:
Thank you!