If your query-key changes it will refetch automatically, so that is if a parameter which drives the query needs to change, change that parameter in state from the effect and let react trigger the refetch
You can also use the trpc `useContext` hook to call the `.invalidate()` method . This is typical to model relationships between mutations and queries which have now been invalidated
Simplest (but least preferred) you can use the returned object from useQuery and call `.refetch()` on it