welp
welp10mo ago

Configuration help

Hello! I want to apply the following configuration on the client: https://tanstack.com/query/v4/docs/react/guides/window-focus-refetching Which is basically setting refetchOnWindowFocus to false. How can I achieve this in tRPC? Thank you for your help.
Window Focus Refetching | TanStack Query Docs
If a user leaves your application and returns and the query data is stale, TanStack Query automatically requests fresh data for you in the background. You can disable this globally or per-query using the refetchOnWindowFocus option: Disabling Globally
2 Replies
welp
welp10mo ago
I found this: https://github.com/trpc/trpc/issues/3684 But I am confused on how to pursue this in a websocket tRPC context.
GitHub
docs: Add commentary on how to configure global react-query options...
Area of Improvement I struggled with figuring out how to adjust global react-query options, and I think it's because the answer seems fairly obvious on one page of the docs, but it isn't ex...
welp
welp10mo ago
Explicitly specifying logic on useQuery({}, { refetchOnWindowFocus: false, }) is sufficient enough.