TanStack Query (React Query) v5 best practices for fetching, caching, synchronizing and updating server state in React applications. Use when writing, reviewing, or refactoring code that involves: (1) Data fetching with useQuery, useSuspenseQuery, useInfiniteQuery, (2) Mutations with useMutation and cache invalidation, (3) Query key design and query function patterns, (4) Optimistic updates and cache manipulation, (5) Pagination and infinite scroll implementations, (6) Prefetching and request waterfall optimization, (7) Server-side rendering (SSR) with Next.js pages/app router or Remix, (8) Suspense integration and streaming with Server Components, (9) TanStack Query TypeScript patterns (queryOptions, type inference, global type registration), (10) Testing components that use React Query hooks, (11) Setting up QueryClient, QueryClientProvider, staleTime, gcTime, retry configuration, (12) Any @tanstack/react-query imports or configuration.