Documentation Index
Fetch the complete documentation index at: https://mintlify.com/get-convex/convex-react-query/llms.txt
Use this file to discover all available pages before exploring further.
@convex-dev/react-query bridges Convex real-time subscriptions with TanStack Query, giving you live-updating data in your React app without polling or manual cache invalidation.
When a Convex query result changes on the server, the update is pushed to your client instantly. Your TanStack Query cache stays fresh automatically — no queryClient.invalidateQueries() needed.
Quickstart
Install the package and wire up your first reactive query in minutes.
How it works
Learn how Convex subscriptions integrate with the TanStack Query cache.
API Reference
Full reference for
ConvexQueryClient, convexQuery, and convexAction.Guides
Deep dives into queries, mutations, authentication, and SSR.
Why use this library?
Convex pushes new query results to your client over a WebSocket whenever the underlying data changes. TanStack Query is the most popular data-fetching library for React. This adapter connects them so you can use the full TanStack Query API —useQuery, useSuspenseQuery, useMutation, devtools, and more — while getting Convex’s real-time guarantees for free.
No stale data
Results are pushed from the server;
staleTime: Infinity is set automatically so TanStack Query never marks Convex data as stale.No manual invalidation
Forget
invalidateQueries(). The ConvexQueryClient updates the cache whenever the server pushes a new result.Type-safe queries
Full TypeScript inference for function arguments and return types using Convex’s generated
api object.SSR ready
Fetch consistent query snapshots on the server with
ConvexHttpClient and hydrate on the client.Quick look
quickstart.tsx
Create ConvexQueryClient
Instantiate a
ConvexQueryClient and connect it to your TanStack QueryClient.