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.
convexQuery creates a partial query options object for subscribing to a Convex query function through TanStack Query. The query is reactive: the ConvexQueryClient pushes updates via WebSocket, and TanStack Query’s cache is updated automatically.
Signature
useQuery (when args may be "skip") and useSuspenseQuery (when args are not "skip").
Parameters
The Convex query function reference, imported from
convex/_generated/api.Arguments to pass to the query function. Pass
"skip" to disable the query — this sets enabled: false in the returned options. Can be omitted entirely when the function takes no arguments (equivalent to passing an empty object).Return value
Returns a partial query options object containing:A stable, serializable query key. The
ConvexQueryClient uses this key to manage WebSocket subscriptions.Always set to
Infinity. Convex queries receive live updates via WebSocket, so they never go stale on their own.Only present when
args is "skip". Set to false to prevent the query from running.convexQuery requires the global queryFn to be set via convexQueryClient.queryFn(). If you don’t want to configure a global default, use convexQueryClient.queryOptions() instead — it embeds the queryFn in the returned options directly.Usage
Basic query:useSuspenseQuery:
Actions cannot be used with
useSuspenseQuery. Use convexAction for Convex actions.