File
Blob: src/client/lib/query-client.ts
| 1 | import { QueryClient } from "@tanstack/react-query"; |
| 2 | |
| 3 | /** |
| 4 | * Shared QueryClient for orthogonal server-state reads (shared inbox, search). |
| 5 | * Workspace/page state stays in Zustand and the ActivePageProvider — Query is |
| 6 | * scoped to surfaces where built-in dedup + window-focus/reconnect refresh is |
| 7 | * a pure win and doesn't compete with the durable snapshot store. |
| 8 | */ |
| 9 | export const queryClient = new QueryClient({ |
| 10 | defaultOptions: { |
| 11 | queries: { |
| 12 | staleTime: 60_000, |
| 13 | gcTime: 5 * 60_000, |
| 14 | retry: 1, |
| 15 | refetchOnWindowFocus: true, |
| 16 | refetchOnReconnect: true, |
| 17 | }, |
| 18 | }, |
| 19 | }); |