API reference
These pages list the public surface a user touches, one page per surface, in tables: every option, field and member with its type, its default and what it does, and the name it has in TanStack Query. Each row links to the generated dartdoc, which has the full signature and the longer explanation.
| Page | What it covers |
|---|---|
| QueryClient | The client: fetching, reading and writing the cache, operating on many queries at once, defaults, mounting and clearing. |
| Options | QueryOptions, QueryObserverOptions, the infinite and mutation options — every field — and the sealed option values (StaleTime, GcTime, RetryPolicy, RefetchOn, …). |
| Results | What a reader is handed: QueryResult and its three cases, QueryState, InfiniteData and the paging flags, MutationResult, MutationState, CombinedResult. |
| Widgets and controllers | The Flutter binding: QueryClientProvider, the four call styles, listeners, collections, OnlineStatus. |
| Caches and observers | QueryCache and MutationCache with their events, Query and Mutation, the observers, the filters, and the focus, online and notify managers. |
| Errors | Every error either package throws or records, and every check a debug build runs. |
A typical app touches them in that order: it builds a client with some defaults, describes its queries with options, reads results through a widget or a controller, and looks at the caches and errors when something needs explaining.
The generated dartdoc
Every public member of both packages carries a dartdoc comment, and pub.dev builds and hosts the reference for every published version:
- pub.dev/documentation/query_kit — the core: client, caches, observers, options, results.
- pub.dev/documentation/query_kit_flutter — the binding. It re-exports the core, so an app imports only this one.
dart doc in a package's directory writes the same reference to doc/api/;
open doc/api/index.html. For a package in your pub cache, run it there.
Where to start reading
| If you want | Start at |
|---|---|
| the whole imperative surface | QueryClient |
| what a widget is handed | QueryResult, and its QueryPending / QuerySuccess / QueryError cases |
| every option and what unset means | the options, then the option values |
| paging | the infinite fields, InfiniteData, InfiniteQueryObserver |
| writes | the mutation fields, MutationResult, MutationController |
| the caches | QueryCache, MutationCache, filters |
| the Flutter side | QueryClientProvider and the four call styles |
| widget tests | nothing exported: the teardown is a documented snippet, see Testing |
Beyond signatures
- Feature matrix — what exists, per TanStack Query feature.
- Differences from TanStack Query — where the behaviour differs, and why.
- Troubleshooting — symptoms, causes and fixes.
- Coming from React Query — the name map.
TanStack Query's React reference is generated, one page per function, class
and interface: useQuery, QueryClient, QueryCache, QueryObserverOptions,
QueryObserverSuccessResult and so on. Here the pages group by surface
instead, and the options and the results have a page each, because the four
call styles share them.