with trpc, how to invalidate query only when there's the query cached exist?

it seems like utils.myRouter.myQuery.invalidate(), triggers the query, even though api.myRouter.myQuery.useQuery() is not called from the page. how do i prevent this
1 Reply
Ivo
Ivo14mo ago
when you invalidate some query by default all places that uses this query will be refetched, this should be the expected behavior, right ? if you don't want to refetch, just avoid the .invalidate()
Want results from more Discord servers?
Add your server