Task: Setup React Query Global Client and Error Boundary
Type: Infrastructure
Milestone: M0-Project - Foundation
Estimate: M
What This Enables
All server-state data fetching (API hooks, mutations, caching, refetch). Without this, feature teams can't fetch data. Blocks all feature API work.
Deliverables
Default Config
new QueryClient({
defaultOptions: {
queries: {
staleTime: 1000 * 60 * 5, // 5 min
retry: 1,
refetchOnWindowFocus: false,
},
},
})
Acceptance Criteria
Task: Setup React Query Global Client and Error Boundary
Type: Infrastructure
Milestone: M0-Project - Foundation
Estimate: M
What This Enables
All server-state data fetching (API hooks, mutations, caching, refetch). Without this, feature teams can't fetch data. Blocks all feature API work.
Deliverables
src/lib/query-client.ts:QueryClientwith global defaults (staleTime,retry,refetchOnWindowFocus)src/app/providers.tsx:QueryClientProviderwrapping the app; includesReactQueryDevtools(dev only)src/components/QueryErrorBoundary.tsx: catches query errors, renders fallback UI, includes retry actiononErrorhandler wired to query client: logs errors, triggers toast notificationsDefault Config
Acceptance Criteria
new QueryClient()elsewhere