staleTime, enabled and select become short bullets (“Fresh for 5 minutes”, “Only when ID is set”), and the fields you destructure from the result are named in plain words. Mutations read as what they run and what happens when they succeed, fail or settle.
library: { name: "@tanstack/react-query", versions: ">=4 <6" }. It narrates files that import from a TanStack Query package (React, Vue, Solid, Svelte and Angular adapters included) or belong to a package that depends on one (see Dependency detection). Same-named functions from other libraries are left alone.
Examples
A query with options
English
An infinite query
English
A mutation that refreshes a query
English
Versions
Two things changed meaning between v4 and v5. In v4,isLoading meant “has no data yet”, and in v5 that is isPending, while isLoading means the first fetch is in flight. Queries also stopped calling onSuccess, onError and onSettled in v5. The plugin picks the reading from the major version your package declares, so a v4 codebase reads onSuccess as a step and a v5 codebase is told that the callback is no longer called. Pass version to pin it. See Plugin versioning.
With tanstackQuery({ version: 5 })
English
With tanstackQuery({ version: 4 })
English
What it covers
useQuery,useSuspenseQuery,useInfiniteQuery,useQueries, and thecreate*andinject*forms used by the other adapters.- Query options:
enabled,staleTime,gcTime,select,placeholderData,refetchInterval,retry, refetch flags and paging options. queryOptionsandinfiniteQueryOptions, and the v4 positional formuseQuery(key, fn, options).useMutationwithonMutate,onSuccess,onErrorandonSettled, including the optimistic update recipe, plusmutate,mutateAsyncandreset.- The query client:
invalidateQueriesand its filters,setQueryData,getQueryData,cancelQueries, prefetching,clearand default options. - Composition with the tRPC plugin, whose options helpers can be passed straight to
useQuery.
Translating
The English phrasebook is exported asen and typed as TanStackQueryPhrases.