Problem
The app already wires QueryClientProvider in src/main.tsx and uses useQuery in some components (e.g. AddressConnectionGraph.tsx, CircuitBreakerStatus.tsx, ContractDependencyGraph3D.tsx), but several pages fetch with raw fetch and manual useState/useEffect, giving inconsistent loading states, no caching, and duplicated error handling. Examples: src/pages/RpcMetricsDashboard.tsx, src/pages/RateLimitDashboard.tsx, src/pages/BatchMultiCall.tsx, src/pages/SetupPage.tsx.
What needs to be done
- Convert the manual-fetch pages to
useQuery/useMutation (reads vs. actions), using the shared API client.
- Standardize loading and error UI via the query state (
isLoading, error).
- Configure sensible defaults (retry, staleTime) on the
QueryClient where appropriate.
Files
src/main.tsx (query defaults)
src/pages/RpcMetricsDashboard.tsx, src/pages/RateLimitDashboard.tsx, src/pages/BatchMultiCall.tsx, src/pages/SetupPage.tsx
Acceptance deliverables
- The listed pages use React Query for all reads/writes.
- Loading and error states are derived from query state, not ad hoc flags.
Tests to pass
- Tests for at least one converted page assert loading, success, and error rendering (with the API client mocked).
- Existing tests continue to pass.
Problem
The app already wires
QueryClientProviderinsrc/main.tsxand usesuseQueryin some components (e.g.AddressConnectionGraph.tsx,CircuitBreakerStatus.tsx,ContractDependencyGraph3D.tsx), but several pages fetch with rawfetchand manualuseState/useEffect, giving inconsistent loading states, no caching, and duplicated error handling. Examples:src/pages/RpcMetricsDashboard.tsx,src/pages/RateLimitDashboard.tsx,src/pages/BatchMultiCall.tsx,src/pages/SetupPage.tsx.What needs to be done
useQuery/useMutation(reads vs. actions), using the shared API client.isLoading,error).QueryClientwhere appropriate.Files
src/main.tsx(query defaults)src/pages/RpcMetricsDashboard.tsx,src/pages/RateLimitDashboard.tsx,src/pages/BatchMultiCall.tsx,src/pages/SetupPage.tsxAcceptance deliverables
Tests to pass