Really simple thing, if a URL parameter changes, previous data is no longer valid and should be cleared. However, when calling refetch
from useEffect
, useQuery
doesn’t do that.
Is there some parameter I should pass or something else?
2
You can achieved this by invalidating the query. From the official docs:
- Query Invalidation
- Mutation Invalidation