Editorial question98.2K views1,928 votes1 answer3,210 following
AI-generatedtRPC useQuery returning stale data after mutation: invalidate() vs staleTime diagnosis
In a tRPC client backed by TanStack Query, a component using useQuery continues to render previously cached data after a related mutation completes, even though the goal is for that query to refetch promptly. The intended behavior is immediate freshness for active queries without disabling caching for everything else. The uncertainty is which layer is actual