+ }
+ `,
+})
+export class AppComponent {
+ readonly isOpen = signal(false)
+ readonly divEl = viewChild('div')
+
+ readonly devtools = injectDevtoolsPanel(() => ({
+ hostElement: this.divEl(),
+ onClose: () => this.isOpen.set(false),
+ }))
+}
+```
+
+`injectDevtoolsPanel` must be called in an injection context, or be given an `Injector` through the `injector` option in its second argument: `injectDevtoolsPanel(() => ({ ... }), { injector })`.
+
+### Options
+
+Of these options `hostElement`, `client`, `errorTypes`, `onClose`, and `theme` support reactivity through signals.
+
+- `hostElement?: ElementRef`
+ - The element to render the devtools panel in. When it is `undefined` or `null`, the devtools panel is not created, or is destroyed if it exists.
+- `onClose?: () => void`
+ - Callback function that is called when the devtools panel is closed
+- `client?: QueryClient`,
+ - Use this to use a custom QueryClient. Otherwise, the QueryClient provided through `provideTanStackQuery` will be injected.
+- `errorTypes?: { name: string; initializer: (query: Query) => TError}[]`
+ - Use this to predefine some errors that can be triggered on your queries. Initializer will be called (with the specific query) when that error is toggled on from the UI. It must return an Error.
+- `styleNonce?: string`
+ - Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.
+- `shadowDOMTarget?: ShadowRoot`
+ - Default behavior will apply the devtool's styles to the head tag within the DOM.
+ - Use this to pass a shadow DOM target to the devtools so that the styles will be applied within the shadow DOM instead of within the head tag in the light DOM.
+- `hideDisabledQueries?: boolean`
+ - Defaults to `false`.
+ - Set this to true to hide disabled queries from the devtools panel.
+- `theme?: "light" | "dark" | "system"`
+ - Defaults to the theme selected in the devtools Settings menu, or `system` if none is selected.
+ - Set this to change the theme of the devtools panel. This overrides the theme selected in the Settings menu.
+
+## Filter queries and mutations
+
+The **Filter** input above the query and mutation lists uses the **Key** scope by default. Select the scope button inside the input to switch between **Key**, **Data**, and **All**:
+
+- **Key** matches the query hash, or the mutation key and submission time.
+- **Data** matches the query data, or the mutation variables or data, the same way **Search data** does below.
+- **All** matches either.
+
+The selected scope is remembered across reloads, like the other filter settings.
+
+## Search query and mutation data
+
+Select a query or mutation and use **Search data** in its Data Explorer to search nested property names and primitive values. Search uses case-insensitive text matching and treats special characters as plain text.
+
+Matching text is highlighted. Matching editable values have a highlighted input. The explorer opens matching branches and the first matching page in each paginated collection. Other pages with matches are highlighted so you can open them. You can still inspect other rows and edit query data.
+
+The Data Explorer highlights up to 1,000 matches at a time.
+
+Select **Clear** or press **Escape** in the search field to restore your manual expansion. Selecting another query or mutation clears the search, unless the filter scope is **Data** or **All**: then the search starts with the filter text. For a mutation, it starts only in the variables or data that match the filter.
diff --git a/docs/framework/angular/guides/background-fetching-indicators.md b/docs/framework/angular/guides/background-fetching-indicators.md
index 2aa27c62c82..9e5c5804383 100644
--- a/docs/framework/angular/guides/background-fetching-indicators.md
+++ b/docs/framework/angular/guides/background-fetching-indicators.md
@@ -31,7 +31,7 @@ replace:
`,
})
class TodosComponent {
- todosQuery = injectQuery(() => ({
+ readonly todosQuery = injectQuery(() => ({
queryKey: ['todos'],
queryFn: fetchTodos,
}))
@@ -53,7 +53,7 @@ import { injectIsFetching } from '@tanstack/angular-query-experimental'
`,
})
export class GlobalLoadingIndicatorComponent {
- isFetching = injectIsFetching()
+ readonly isFetching = injectIsFetching()
}
```
diff --git a/docs/framework/angular/guides/default-query-function.md b/docs/framework/angular/guides/default-query-function.md
index 75e0fa3c485..a7ba445b318 100644
--- a/docs/framework/angular/guides/default-query-function.md
+++ b/docs/framework/angular/guides/default-query-function.md
@@ -30,7 +30,7 @@ bootstrapApplication(MyAppComponent, {
export class PostsComponent {
// All you have to do now is pass a key!
- postsQuery = injectQuery>(() => ({
+ readonly postsQuery = injectQuery>(() => ({
queryKey: ['/posts'],
}))
// ...
@@ -38,7 +38,7 @@ export class PostsComponent {
export class PostComponent {
// You can even leave out the queryFn and just go straight into options
- postQuery = injectQuery(() => ({
+ readonly postQuery = injectQuery(() => ({
enabled: this.postIdSignal() > 0,
queryKey: [`/posts/${this.postIdSignal()}`],
}))
diff --git a/docs/framework/angular/guides/disabling-queries.md b/docs/framework/angular/guides/disabling-queries.md
index 80b3c0a5237..b52266505aa 100644
--- a/docs/framework/angular/guides/disabling-queries.md
+++ b/docs/framework/angular/guides/disabling-queries.md
@@ -11,29 +11,29 @@ replace: { 'useQuery': 'injectQuery' }
@Component({
selector: 'todos',
template: `
@@ -53,7 +59,7 @@ result = injectQuery(() => ({ queryKey: ['todos'], queryFn: fetchTodoList }))
`,
})
export class PostsComponent {
- todos = injectQuery(() => ({
+ readonly todosQuery = injectQuery(() => ({
queryKey: ['todos'],
queryFn: fetchTodoList,
}))
@@ -70,17 +76,17 @@ If booleans aren't your thing, you can always use the `status` state as well:
@Component({
selector: 'todos',
template: `
- @switch (todos.status()) {
+ @switch (todosQuery.status()) {
@case ('pending') {
Loading...
}
@case ('error') {
- Error: {{ todos.error()?.message }}
+ Error: {{ todosQuery.error()?.message }}
}
@default {
- @for (todo of todos.data(); track todo.id) {
+ @for (todo of todosQuery.data(); track todo.id) {
{{ todo.title }}
} @empty {
No todos found
diff --git a/docs/framework/angular/guides/query-cancellation.md b/docs/framework/angular/guides/query-cancellation.md
index 554cb28d1d2..100ced3c981 100644
--- a/docs/framework/angular/guides/query-cancellation.md
+++ b/docs/framework/angular/guides/query-cancellation.md
@@ -14,13 +14,12 @@ However, if you consume the `AbortSignal`, the Promise will be cancelled (e.g. a
## Using `HttpClient`
```ts
-import { HttpClient } from '@angular/common/http'
import { injectQuery } from '@tanstack/angular-query-experimental'
+import { fromEvent, lastValueFrom, takeUntil } from 'rxjs'
postQuery = injectQuery(() => ({
- enabled: this.postId() > 0,
queryKey: ['post', this.postId()],
- queryFn: async (context): Promise => {
+ queryFn: (context): Promise => {
const abort$ = fromEvent(context.signal, 'abort')
return lastValueFrom(this.getPost$(this.postId()).pipe(takeUntil(abort$)))
},
@@ -32,7 +31,7 @@ postQuery = injectQuery(() => ({
[//]: # 'Example2'
```ts
-query = injectQuery(() => ({
+todosQuery = injectQuery(() => ({
queryKey: ['todos'],
queryFn: async ({ signal }) => {
const todosResponse = await fetch('/todos', {
@@ -63,7 +62,7 @@ query = injectQuery(() => ({
```ts
import axios from 'axios'
-const query = injectQuery(() => ({
+const todosQuery = injectQuery(() => ({
queryKey: ['todos'],
queryFn: ({ signal }) =>
axios.get('/todos', {
@@ -86,7 +85,7 @@ You might want to cancel a query manually. For example, if the request takes a l
template: `Cancel`,
})
export class TodosComponent {
- query = injectQuery(() => ({
+ readonly todosQuery = injectQuery(() => ({
queryKey: ['todos'],
queryFn: async ({ signal }) => {
const resp = await fetch('/todos', { signal })
@@ -94,10 +93,10 @@ export class TodosComponent {
},
}))
- queryClient = inject(QueryClient)
+ readonly queryClient = inject(QueryClient)
onCancel() {
- this.queryClient.cancelQueries(['todos'])
+ this.queryClient.cancelQueries({ queryKey: ['todos'] })
}
}
```
diff --git a/docs/framework/angular/guides/query-functions.md b/docs/framework/angular/guides/query-functions.md
index b151869506f..966b64ea154 100644
--- a/docs/framework/angular/guides/query-functions.md
+++ b/docs/framework/angular/guides/query-functions.md
@@ -29,7 +29,7 @@ injectQuery(() => ({
[//]: # 'Example2'
```ts
-todos = injectQuery(() => ({
+todoQuery = injectQuery(() => ({
queryKey: ['todos', todoId()],
queryFn: async () => {
if (somethingGoesWrong) {
@@ -48,7 +48,7 @@ todos = injectQuery(() => ({
[//]: # 'Example3'
```ts
-todos = injectQuery(() => ({
+todoQuery = injectQuery(() => ({
queryKey: ['todos', todoId()],
queryFn: async () => {
const response = await fetch('/todos/' + todoId)
@@ -64,7 +64,7 @@ todos = injectQuery(() => ({
[//]: # 'Example4'
```ts
-result = injectQuery(() => ({
+todosQuery = injectQuery(() => ({
queryKey: ['todos', { status: status(), page: page() }],
queryFn: fetchTodoList,
}))
diff --git a/docs/framework/angular/guides/query-invalidation.md b/docs/framework/angular/guides/query-invalidation.md
index 9cd8ea58097..36956557dcf 100644
--- a/docs/framework/angular/guides/query-invalidation.md
+++ b/docs/framework/angular/guides/query-invalidation.md
@@ -11,7 +11,7 @@ replace: { 'useQuery': 'injectQuery', 'hooks': 'functions' }
import { injectQuery, QueryClient } from '@tanstack/angular-query-experimental'
class QueryInvalidationExample {
- queryClient = inject(QueryClient)
+ readonly queryClient = inject(QueryClient)
invalidateQueries() {
this.queryClient.invalidateQueries({ queryKey: ['todos'] })
diff --git a/docs/framework/angular/guides/query-options.md b/docs/framework/angular/guides/query-options.md
index d63753bbfc9..eb90770d815 100644
--- a/docs/framework/angular/guides/query-options.md
+++ b/docs/framework/angular/guides/query-options.md
@@ -7,13 +7,13 @@ ref: docs/framework/react/guides/query-options.md
[//]: # 'Example1'
```ts
-import { queryOptions } from '@tanstack/angular-query-experimental'
+import { queryOptions, noop } from '@tanstack/angular-query-experimental'
@Injectable({
providedIn: 'root',
})
export class QueriesService {
- private http = inject(HttpClient)
+ private readonly http = inject(HttpClient)
post(postId: number) {
return queryOptions({
@@ -38,7 +38,7 @@ queries = inject(QueriesService)
postQuery = injectQuery(() => this.queries.post(this.postId()))
-queryClient.prefetchQuery(this.queries.post(23))
+queryClient.query(this.queries.post(23)).catch(noop)
queryClient.setQueryData(this.queries.post(42).queryKey, newPost)
```
@@ -46,11 +46,11 @@ queryClient.setQueryData(this.queries.post(42).queryKey, newPost)
[//]: # 'Example2'
```ts
-// Type inference still works, so query.data will be the return type of select instead of queryFn
+// Type inference still works, so postQuery.data will be the return type of select instead of queryFn
queries = inject(QueriesService)
-query = injectQuery(() => ({
- ...groupOptions(1),
+postQuery = injectQuery(() => ({
+ ...this.queries.post(1),
select: (data) => data.title,
}))
```
diff --git a/docs/framework/angular/guides/query-retries.md b/docs/framework/angular/guides/query-retries.md
index 74aeef9a45f..a7b0b1841ca 100644
--- a/docs/framework/angular/guides/query-retries.md
+++ b/docs/framework/angular/guides/query-retries.md
@@ -18,7 +18,7 @@ replace:
import { injectQuery } from '@tanstack/angular-query-experimental'
// Make a specific query retry a certain number of times
-const result = injectQuery(() => ({
+const todoQuery = injectQuery(() => ({
queryKey: ['todos', 1],
queryFn: fetchTodoListPage,
retry: 10, // Will retry failed requests 10 times before displaying an error
@@ -56,7 +56,7 @@ Though it is not recommended, you can obviously override the `retryDelay` functi
[//]: # 'Example3'
```ts
-const result = injectQuery(() => ({
+const todosQuery = injectQuery(() => ({
queryKey: ['todos'],
queryFn: fetchTodoList,
retryDelay: 1000, // Will always wait 1000ms to retry, regardless of how many retries
diff --git a/docs/framework/angular/guides/testing.md b/docs/framework/angular/guides/testing.md
index 7648d7f6b32..857b2a57ee0 100644
--- a/docs/framework/angular/guides/testing.md
+++ b/docs/framework/angular/guides/testing.md
@@ -7,7 +7,7 @@ Most Angular tests using TanStack Query will involve services or components that
TanStack Query's `inject*` functions integrate with [`PendingTasks`](https://angular.dev/api/core/PendingTasks) which ensures the framework is aware of in-progress queries and mutations.
-This means tests and SSR can wait until mutations and queries resolve. In unit tests you can use `ApplicationRef.whenStable()` or `fixture.whenStable()` to await query completion. This works for both Zone.js and Zoneless setups.
+This lets the framework, for example during SSR, wait until mutations and queries resolve. In unit tests, `ApplicationRef.whenStable()` and `fixture.whenStable()` work for both Zone.js and Zoneless setups when the work settles right away, such as a synchronous query function or a response flushed through `HttpTestingController`. They can resolve before a query or mutation that takes time settles, so advance fake timers instead, as shown in the sections below.
> This integration requires Angular 19 or later. Earlier versions of Angular do not support `PendingTasks`.
@@ -55,7 +55,7 @@ expect(query.status()).toBe('success')
expect(query.data()).toBe('Hello')
```
-PendingTasks will have `whenStable()` resolve after the query settles. When using fake timers (Vitest), advance the clock and a microtask before awaiting stability:
+Here `whenStable()` resolves after the query settles because the query function returns right away. When using fake timers (Vitest), advance the clock and a microtask before awaiting stability:
```ts
await vi.advanceTimersByTimeAsync(0)
@@ -65,13 +65,88 @@ await appRef.whenStable()
## Testing components
-For components, bootstrap them through `TestBed.createComponent`, then await `fixture.whenStable()`:
+For components, create them through `TestBed.createComponent`. `fixture.whenStable()` can resolve before the query data arrives, so with fake timers, advance the clock past the query function's delay, then run `fixture.detectChanges()` and assert on what the component renders:
-```ts
-const fixture = TestBed.createComponent(ExampleComponent)
+```angular-ts
+beforeEach(() => {
+ vi.useFakeTimers()
+})
+
+afterEach(() => {
+ vi.useRealTimers()
+})
+
+it('should render the query data', async () => {
+ @Component({
+ template: `
{{ query.data()?.value ?? 'Loading...' }}
`,
+ })
+ class ExampleComponent {
+ readonly query = injectQuery(() => ({
+ queryKey: ['example'],
+ queryFn: () =>
+ new Promise<{ value: number }>((resolve) =>
+ setTimeout(() => resolve({ value: 42 }), 10),
+ ),
+ }))
+ }
+
+ const fixture = TestBed.createComponent(ExampleComponent)
+ fixture.detectChanges()
+ expect(fixture.nativeElement.textContent).toContain('Loading...')
+
+ await vi.advanceTimersByTimeAsync(11)
+ fixture.detectChanges()
+
+ expect(fixture.nativeElement.textContent).toContain('42')
+})
+```
+
+If you use [Angular Testing Library](https://testing-library.com/docs/angular-testing-library/intro/), render the component with `render` and follow the same flow, running change detection through `rendered.fixture`:
+
+```angular-ts
+it('should render the query data', async () => {
+ @Component({
+ template: `
{{ query.data()?.value ?? 'Loading...' }}
`,
+ })
+ class ExampleComponent {
+ readonly query = injectQuery(() => ({
+ queryKey: ['example'],
+ queryFn: () =>
+ new Promise<{ value: number }>((resolve) =>
+ setTimeout(() => resolve({ value: 42 }), 10),
+ ),
+ }))
+ }
+
+ const rendered = await render(ExampleComponent)
+ expect(rendered.getByText('Loading...')).toBeInTheDocument()
+
+ await vi.advanceTimersByTimeAsync(11)
+ rendered.fixture.detectChanges()
+
+ expect(rendered.getByText('42')).toBeInTheDocument()
+})
+```
-await fixture.whenStable()
-expect(fixture.componentInstance.query.data()).toEqual({ value: 42 })
+To test the same query without a component, create it with `TestBed.runInInjectionContext`, advance the clock the same way, and assert on its signals:
+
+```ts
+it('should resolve the query data', async () => {
+ const query = TestBed.runInInjectionContext(() =>
+ injectQuery(() => ({
+ queryKey: ['example'],
+ queryFn: () =>
+ new Promise<{ value: number }>((resolve) =>
+ setTimeout(() => resolve({ value: 42 }), 10),
+ ),
+ })),
+ )
+ expect(query.isPending()).toBe(true)
+
+ await vi.advanceTimersByTimeAsync(11)
+
+ expect(query.data()).toEqual({ value: 42 })
+})
```
## Handling retries
@@ -80,12 +155,15 @@ Retries slow failing tests because the default backoff runs three times. Set `re
## HttpClient & network stubs
-Angular's `HttpClientTestingModule` plays nicely with PendingTasks. Register it alongside the Query provider and flush responses through `HttpTestingController`:
+Angular's `HttpClient` testing utilities play nicely with PendingTasks. Register `provideHttpClient()` and `provideHttpClientTesting()` alongside the Query provider and flush responses through `HttpTestingController`:
```ts
TestBed.configureTestingModule({
- imports: [HttpClientTestingModule],
- providers: [provideTanStackQuery(queryClient)],
+ providers: [
+ provideHttpClient(),
+ provideHttpClientTesting(),
+ provideTanStackQuery(queryClient),
+ ],
})
const httpCtrl = TestBed.inject(HttpTestingController)
@@ -106,45 +184,60 @@ httpCtrl.verify()
## Infinite queries & pagination
-Use the same pattern for infinite queries: call `fetchNextPage()`, advance timers if you are faking time, then await stability and assert on `data().pages`.
+`whenStable()` can resolve before the pages of an infinite query reach the `data()` signal. With fake timers, advance the clock past the query function's delay instead, call `fetchNextPage()`, and advance it again before asserting on `data().pages`. Restore real timers in `afterEach`, so they are restored even when an assertion fails:
```ts
-const infinite = TestBed.runInInjectionContext(() =>
- injectInfiniteQuery(() => ({
- queryKey: ['pages'],
- queryFn: ({ pageParam = 1 }) => fetchPage(pageParam),
- getNextPageParam: (last, all) => all.length + 1,
- })),
-)
-
-await appRef.whenStable()
-expect(infinite.data().pages).toHaveLength(1)
+beforeEach(() => {
+ vi.useFakeTimers()
+})
-await infinite.fetchNextPage()
-await vi.advanceTimersByTimeAsync(0)
-await appRef.whenStable()
+afterEach(() => {
+ vi.useRealTimers()
+})
-expect(infinite.data().pages).toHaveLength(2)
+it('should load the next page', async () => {
+ const infinite = TestBed.runInInjectionContext(() =>
+ injectInfiniteQuery(() => ({
+ queryKey: ['pages'],
+ queryFn: ({ pageParam }) =>
+ new Promise((resolve) =>
+ setTimeout(() => resolve(`page ${pageParam}`), 10),
+ ),
+ initialPageParam: 1,
+ getNextPageParam: (_lastPage, allPages) => allPages.length + 1,
+ })),
+ )
+
+ await vi.advanceTimersByTimeAsync(11)
+ expect(infinite.data()?.pages).toEqual(['page 1'])
+
+ void infinite.fetchNextPage()
+ await vi.advanceTimersByTimeAsync(11)
+ expect(infinite.data()?.pages).toEqual(['page 1', 'page 2'])
+})
```
## Mutations and optimistic updates
-```ts
-const mutation = TestBed.runInInjectionContext(() =>
- injectMutation(() => ({
- mutationFn: async (input: string) => input.toUpperCase(),
- })),
-)
-
-mutation.mutate('test')
-
-// Trigger effect
-TestBed.tick()
+`whenStable()` can resolve before a mutation started with `mutate()` settles. With fake timers enabled as in the examples above, advance the clock past the mutation function's delay before asserting on the result:
-await appRef.whenStable()
-
-expect(mutation.isSuccess()).toBe(true)
-expect(mutation.data()).toBe('TEST')
+```ts
+it('should uppercase the input', async () => {
+ const mutation = TestBed.runInInjectionContext(() =>
+ injectMutation(() => ({
+ mutationFn: (input: string) =>
+ new Promise((resolve) =>
+ setTimeout(() => resolve(input.toUpperCase()), 10),
+ ),
+ })),
+ )
+
+ mutation.mutate('test')
+ await vi.advanceTimersByTimeAsync(11)
+
+ expect(mutation.isSuccess()).toBe(true)
+ expect(mutation.data()).toBe('TEST')
+})
```
## Quick checklist
@@ -152,6 +245,6 @@ expect(mutation.data()).toBe('TEST')
- Fresh `QueryClient` per test (and clear it afterwards)
- Disable or control retries to avoid timeouts
- Advance timers + microtasks before `whenStable()` when using fake timers
-- Use `HttpClientTestingModule` or your preferred mock to assert network calls
-- Await `whenStable()` after every `refetch`, `fetchNextPage`, or mutation
-- Prefer `TestBed.runInInjectionContext` for service tests and `fixture.whenStable()` for component tests
+- Use `provideHttpClientTesting()` or your preferred mock to assert network calls
+- Advance timers past the query or mutation function after every `refetch`, `fetchNextPage()`, or mutation instead of awaiting `whenStable()`
+- Prefer `TestBed.runInInjectionContext` for service tests, and `TestBed.createComponent` or Angular Testing Library's `render` with `fixture.detectChanges()` for component tests
diff --git a/docs/framework/angular/installation.md b/docs/framework/angular/installation.md
index dffc092e7cd..8ef7db4377b 100644
--- a/docs/framework/angular/installation.md
+++ b/docs/framework/angular/installation.md
@@ -7,28 +7,28 @@ title: Installation
### NPM
-_Angular Query is compatible with Angular v16 and higher_
-
-```bash
+```sh
npm i @tanstack/angular-query-experimental
```
or
-```bash
+```sh
pnpm add @tanstack/angular-query-experimental
```
or
-```bash
+```sh
yarn add @tanstack/angular-query-experimental
```
or
-```bash
+```sh
bun add @tanstack/angular-query-experimental
```
+Angular Query is compatible with Angular v16+.
+
> Wanna give it a spin before you download? Try out the [simple](./examples/simple) or [basic](./examples/basic) examples!
diff --git a/docs/framework/angular/overview.md b/docs/framework/angular/overview.md
index 69ebf2eac3f..ac71df931f1 100644
--- a/docs/framework/angular/overview.md
+++ b/docs/framework/angular/overview.md
@@ -63,7 +63,6 @@ In the example below, you can see TanStack Query in its most basic and simple fo
```angular-ts
import { ChangeDetectionStrategy, Component, inject } from '@angular/core'
import { HttpClient } from '@angular/common/http'
-import { CommonModule } from '@angular/common'
import { injectQuery } from '@tanstack/angular-query-experimental'
import { lastValueFrom } from 'rxjs'
@@ -71,13 +70,13 @@ import { lastValueFrom } from 'rxjs'
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'simple-example',
template: `
- @if (query.isPending()) {
+ @if (repoDataQuery.isPending()) {
Loading...
}
- @if (query.error()) {
- An error has occurred: {{ query.error().message }}
+ @if (repoDataQuery.isError()) {
+ An error has occurred: {{ repoDataQuery.error().message }}
}
- @if (query.data(); as data) {
+ @if (repoDataQuery.data(); as data) {
- @for (todo of query.data(); track todo.title) {
+ @for (todo of todosQuery.data(); track todo.title) {
{{ todo.title }}
}
@@ -68,15 +68,15 @@ import {
`,
})
export class TodosComponent {
- todoService = inject(TodoService)
- queryClient = inject(QueryClient)
+ readonly todoService = inject(TodoService)
+ readonly queryClient = inject(QueryClient)
- query = injectQuery(() => ({
+ readonly todosQuery = injectQuery(() => ({
queryKey: ['todos'],
queryFn: () => this.todoService.getTodos(),
}))
- mutation = injectMutation(() => ({
+ readonly addTodoMutation = injectMutation(() => ({
mutationFn: (todo: Todo) => this.todoService.addTodo(todo),
onSuccess: () => {
this.queryClient.invalidateQueries({ queryKey: ['todos'] })
@@ -84,7 +84,7 @@ export class TodosComponent {
}))
onAddTodo() {
- this.mutation.mutate({
+ this.addTodoMutation.mutate({
id: Date.now().toString(),
title: 'Do Laundry',
})
@@ -93,7 +93,7 @@ export class TodosComponent {
@Injectable({ providedIn: 'root' })
export class TodoService {
- private http = inject(HttpClient)
+ private readonly http = inject(HttpClient)
getTodos(): Promise {
return lastValueFrom(
diff --git a/docs/framework/angular/reference/classes/CancelledError.md b/docs/framework/angular/reference/classes/CancelledError.md
new file mode 100644
index 00000000000..34204318799
--- /dev/null
+++ b/docs/framework/angular/reference/classes/CancelledError.md
@@ -0,0 +1,77 @@
+---
+id: CancelledError
+title: CancelledError
+---
+
+
+
+Defined in: [packages/query-core/src/retryer.ts:120](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L120)
+
+The error thrown by a `Retryer` (and surfaced to `query.promise`/`mutation`) when a fetch is cancelled, e.g. via
+`query.cancel()`. `revert`, if `true`, tells the caller to restore the state the query was in before the fetch
+started instead of surfacing the error. `silent`, if `true`, tells the caller to suppress this error and instead
+resolve with the promise of the fetch that triggered the cancellation.
+
+## Example
+
+```ts
+query.cancel()
+
+try {
+ await query.promise
+} catch (error) {
+ if (error instanceof CancelledError) {
+ // the fetch was cancelled, e.g. via `query.cancel()`
+ }
+}
+```
+
+## Extends
+
+- `Error`
+
+## Constructors
+
+### Constructor
+
+```ts
+new CancelledError(options?: CancelOptions): CancelledError;
+```
+
+Defined in: [packages/query-core/src/retryer.ts:123](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L123)
+
+#### Parameters
+
+##### options?
+
+[`CancelOptions`](../interfaces/CancelOptions.md)
+
+#### Returns
+
+`CancelledError`
+
+#### Overrides
+
+```ts
+Error.constructor
+```
+
+## Properties
+
+### revert?
+
+```ts
+optional revert?: boolean;
+```
+
+Defined in: [packages/query-core/src/retryer.ts:121](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L121)
+
+***
+
+### silent?
+
+```ts
+optional silent?: boolean;
+```
+
+Defined in: [packages/query-core/src/retryer.ts:122](https://github.com/TanStack/query/blob/main/packages/query-core/src/retryer.ts#L122)
diff --git a/docs/framework/angular/reference/classes/InfiniteQueryObserver.md b/docs/framework/angular/reference/classes/InfiniteQueryObserver.md
new file mode 100644
index 00000000000..8c73ae49a6d
--- /dev/null
+++ b/docs/framework/angular/reference/classes/InfiniteQueryObserver.md
@@ -0,0 +1,715 @@
+---
+id: InfiniteQueryObserver
+title: InfiniteQueryObserver
+---
+
+
+
+Defined in: [packages/query-core/src/infiniteQueryObserver.ts:40](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L40)
+
+An `InfiniteQueryObserver` extends `QueryObserver` to observe and switch
+between infinite queries. It augments the base `QueryObserverResult` with
+infinite-query-specific fields and methods, such as `hasNextPage` and
+`fetchNextPage`, and is the primitive that framework adapters (e.g.
+`useInfiniteQuery`) build their hooks on top of.
+
+## Example
+
+```ts
+const observer = new InfiniteQueryObserver(queryClient, {
+ queryKey: ['projects'],
+ queryFn: ({ pageParam }) => fetchProjects(pageParam),
+ initialPageParam: 0,
+ getNextPageParam: (lastPage) => lastPage.nextCursor,
+})
+
+const unsubscribe = observer.subscribe((result) => console.log(result))
+```
+
+## Extends
+
+- [`QueryObserver`](QueryObserver.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\>
+
+## Type Parameters
+
+### TQueryFnData
+
+`TQueryFnData` = `unknown`
+
+### TError
+
+`TError` = [`DefaultError`](../type-aliases/DefaultError.md)
+
+### TData
+
+`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\>
+
+### TQueryKey
+
+`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md)
+
+### TPageParam
+
+`TPageParam` = `unknown`
+
+## Constructors
+
+### Constructor
+
+```ts
+new InfiniteQueryObserver, TQueryKey extends readonly unknown[] = readonly unknown[], TPageParam = unknown>(client: QueryClient, options: InfiniteQueryObserverOptions): InfiniteQueryObserver;
+```
+
+Defined in: [packages/query-core/src/infiniteQueryObserver.ts:82](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L82)
+
+#### Parameters
+
+##### client
+
+[`QueryClient`](QueryClient.md)
+
+##### options
+
+[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
+
+#### Returns
+
+`InfiniteQueryObserver`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
+
+#### Overrides
+
+[`QueryObserver`](QueryObserver.md).[`constructor`](QueryObserver.md#constructor)
+
+## Properties
+
+### getCurrentResult
+
+```ts
+getCurrentResult: ReplaceReturnType<() => QueryObserverResult, InfiniteQueryObserverResult>;
+```
+
+Defined in: [packages/query-core/src/infiniteQueryObserver.ts:59](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L59)
+
+Returns the most recently computed `QueryObserverResult` for the
+observed query. This is a point-in-time read; to be notified of updates
+as they happen, subscribe to the observer instead (its inherited
+`subscribe` method).
+
+#### Returns
+
+The observer's latest result.
+
+#### Example
+
+```ts
+const result = observer.getCurrentResult()
+console.log(result.status, result.data)
+```
+
+#### Overrides
+
+```ts
+QueryObserver.getCurrentResult
+```
+
+***
+
+### options
+
+```ts
+options: QueryObserverOptions, TQueryKey>;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:88](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L88)
+
+#### Inherited from
+
+[`QueryObserver`](QueryObserver.md).[`options`](QueryObserver.md#options)
+
+***
+
+### subscribe
+
+```ts
+subscribe: (listener: InfiniteQueryObserverListener) => () => void;
+```
+
+Defined in: [packages/query-core/src/infiniteQueryObserver.ts:54](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L54)
+
+Registers a listener to be called on every update this object notifies about. Returns a function
+that removes the listener again โ call it to stop listening. The base class never drops a listener
+on its own, though some subclasses clear all of theirs in `destroy()`.
+
+#### Parameters
+
+##### listener
+
+`InfiniteQueryObserverListener`
+
+Called on each update, with whatever the subclass passes to its subscribers.
+
+#### Returns
+
+A function that removes the listener.
+
+() => `void`
+
+#### Example
+
+```ts
+const unsubscribe = subscribable.subscribe(() => {
+ // react to the update
+})
+
+unsubscribe()
+```
+
+#### Overrides
+
+```ts
+QueryObserver.subscribe
+```
+
+## Methods
+
+### destroy()
+
+```ts
+destroy(): void;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:166](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L166)
+
+Stops observing the current query: clears all listeners, cancels the
+stale and refetch-interval timers, and removes this observer from the
+query it was observing.
+
+#### Returns
+
+`void`
+
+#### Inherited from
+
+[`QueryObserver`](QueryObserver.md).[`destroy`](QueryObserver.md#destroy)
+
+***
+
+### fetchNextPage()
+
+```ts
+fetchNextPage(options?: FetchNextPageOptions): Promise>;
+```
+
+Defined in: [packages/query-core/src/infiniteQueryObserver.ts:165](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L165)
+
+Fetches the next page of the infinite query and returns a promise that
+resolves with the resulting `InfiniteQueryObserverResult`. The page
+param used for the fetch is determined by `getNextPageParam`, which
+receives the current pages/page params and whose result also determines
+`hasNextPage`.
+
+#### Parameters
+
+##### options?
+
+[`FetchNextPageOptions`](../interfaces/FetchNextPageOptions.md)
+
+Set `cancelRefetch` to `false` to ignore the call while a fetch is running,
+and `throwOnError` to `true` to reject when the fetch fails.
+
+#### Returns
+
+`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\>
+
+A promise that resolves with the result after the next page is fetched. With
+`cancelRefetch: false`, a running fetch is reused instead, so the next page may not be fetched.
+
+#### See
+
+[InfiniteQueryObserver#fetchPreviousPage](#fetchpreviouspage)
+
+#### Example
+
+```ts
+const { hasNextPage } = observer.getCurrentResult()
+
+if (hasNextPage) {
+ await observer.fetchNextPage()
+}
+```
+
+***
+
+### fetchOptimistic()
+
+```ts
+fetchOptimistic(options: QueryObserverOptions, TQueryKey>): Promise>;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:412](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L412)
+
+Fetches a query defined by the given options without affecting this
+observer's own tracked query or result, and returns a promise that
+resolves with the `QueryObserverResult` for that fetch. This is useful
+for prefetching data that another observer (e.g. a query about to be
+navigated to) will need, ahead of time.
+
+#### Parameters
+
+##### options
+
+[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\>
+
+The observer options of the query to fetch.
+
+#### Returns
+
+`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\>
+
+A promise that resolves with the result for the fetched query.
+
+#### Example
+
+```ts
+const result = await observer.fetchOptimistic({
+ queryKey: ['posts', 2],
+ queryFn: () => fetchPost(2),
+})
+console.log(result.data)
+```
+
+#### Inherited from
+
+[`QueryObserver`](QueryObserver.md).[`fetchOptimistic`](QueryObserver.md#fetchoptimistic)
+
+***
+
+### fetchPreviousPage()
+
+```ts
+fetchPreviousPage(options?: FetchPreviousPageOptions): Promise>;
+```
+
+Defined in: [packages/query-core/src/infiniteQueryObserver.ts:196](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L196)
+
+Fetches the previous page of the infinite query and returns a promise
+that resolves with the resulting `InfiniteQueryObserverResult`. The page
+param used for the fetch is determined by `getPreviousPageParam`, which
+receives the current pages/page params and whose result also determines
+`hasPreviousPage`.
+
+#### Parameters
+
+##### options?
+
+[`FetchPreviousPageOptions`](../interfaces/FetchPreviousPageOptions.md)
+
+Set `cancelRefetch` to `false` to ignore the call while a fetch is running,
+and `throwOnError` to `true` to reject when the fetch fails.
+
+#### Returns
+
+`Promise`\<[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>\>
+
+A promise that resolves with the result after the previous page is fetched. With
+`cancelRefetch: false`, a running fetch is reused instead, so the previous page may not be fetched.
+
+#### See
+
+[InfiniteQueryObserver#fetchNextPage](#fetchnextpage)
+
+#### Example
+
+```ts
+const { hasPreviousPage } = observer.getCurrentResult()
+
+if (hasPreviousPage) {
+ await observer.fetchPreviousPage()
+}
+```
+
+***
+
+### getCurrentQuery()
+
+```ts
+getCurrentQuery(): Query, TQueryKey>;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:371](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L371)
+
+Returns the `Query` instance this observer is currently observing.
+
+#### Returns
+
+[`Query`](Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\>
+
+The observed query.
+
+#### Inherited from
+
+[`QueryObserver`](QueryObserver.md).[`getCurrentQuery`](QueryObserver.md#getcurrentquery)
+
+***
+
+### getOptimisticResult()
+
+```ts
+getOptimisticResult(options: DefaultedInfiniteQueryObserverOptions): InfiniteQueryObserverResult;
+```
+
+Defined in: [packages/query-core/src/infiniteQueryObserver.ts:129](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L129)
+
+The infinite-query counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult), marking the
+options as an infinite query before delegating to it. Called by framework adapters (e.g.
+`useInfiniteQuery`) ahead of subscribing, to compute the current `InfiniteQueryObserverResult`
+synchronously.
+
+#### Parameters
+
+##### options
+
+[`DefaultedInfiniteQueryObserverOptions`](../type-aliases/DefaultedInfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
+
+The defaulted infinite query observer options to compute the result for.
+
+#### Returns
+
+[`InfiniteQueryObserverResult`](../type-aliases/InfiniteQueryObserverResult.md)\<`TData`, `TError`\>
+
+The result for the given options.
+
+#### Overrides
+
+[`QueryObserver`](QueryObserver.md).[`getOptimisticResult`](QueryObserver.md#getoptimisticresult)
+
+***
+
+### hasListeners()
+
+```ts
+hasListeners(): boolean;
+```
+
+Defined in: [packages/query-core/src/subscribable.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L43)
+
+Returns `true` while at least one listener is registered, `false` once they have all unsubscribed.
+
+#### Returns
+
+`boolean`
+
+`true` if at least one listener is registered.
+
+#### Inherited from
+
+[`QueryObserver`](QueryObserver.md).[`hasListeners`](QueryObserver.md#haslisteners)
+
+***
+
+### refetch()
+
+```ts
+refetch(options?: RefetchOptions): Promise>;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:387](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L387)
+
+Refetches the observed query and returns a promise that resolves with
+the resulting `QueryObserverResult`.
+
+#### Parameters
+
+##### options?
+
+[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}`
+
+Set `cancelRefetch` to `false` to keep a running fetch instead of cancelling
+it, and `throwOnError` to `true` to reject when the refetch fails.
+
+#### Returns
+
+`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\>
+
+A promise that resolves with the result after the refetch.
+
+#### Example
+
+```ts
+const result = await observer.refetch({ cancelRefetch: false })
+console.log(result.data)
+```
+
+#### Inherited from
+
+[`QueryObserver`](QueryObserver.md).[`refetch`](QueryObserver.md#refetch)
+
+***
+
+### setOptions()
+
+```ts
+setOptions(options: InfiniteQueryObserverOptions): void;
+```
+
+Defined in: [packages/query-core/src/infiniteQueryObserver.ts:108](https://github.com/TanStack/query/blob/main/packages/query-core/src/infiniteQueryObserver.ts#L108)
+
+Updates the observer's options. Behaves the same as
+`QueryObserver.setOptions`, additionally marking the options as
+belonging to an infinite query before delegating to the base
+implementation.
+
+#### Parameters
+
+##### options
+
+[`InfiniteQueryObserverOptions`](../interfaces/InfiniteQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
+
+The new infinite query observer options.
+
+#### Returns
+
+`void`
+
+#### Overrides
+
+[`QueryObserver`](QueryObserver.md).[`setOptions`](QueryObserver.md#setoptions)
+
+***
+
+### shouldFetchOnReconnect()
+
+```ts
+shouldFetchOnReconnect(): boolean;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:139](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L139)
+
+Returns whether the observed query is currently stale and configured
+(via the `refetchOnReconnect` option) to refetch when the network
+reconnects.
+
+#### Returns
+
+`boolean`
+
+`true` if the observer should refetch the query on reconnect.
+
+#### Inherited from
+
+[`QueryObserver`](QueryObserver.md).[`shouldFetchOnReconnect`](QueryObserver.md#shouldfetchonreconnect)
+
+***
+
+### shouldFetchOnWindowFocus()
+
+```ts
+shouldFetchOnWindowFocus(): boolean;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:153](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L153)
+
+Returns whether the observed query is currently stale and configured
+(via the `refetchOnWindowFocus` option) to refetch when the window
+regains focus.
+
+#### Returns
+
+`boolean`
+
+`true` if the observer should refetch the query on window focus.
+
+#### Inherited from
+
+[`QueryObserver`](QueryObserver.md).[`shouldFetchOnWindowFocus`](QueryObserver.md#shouldfetchonwindowfocus)
+
+***
+
+### trackProp()
+
+```ts
+trackProp(key:
+ | "error"
+ | "data"
+ | "isError"
+ | "isPending"
+ | "isLoading"
+ | "isLoadingError"
+ | "isRefetchError"
+ | "isSuccess"
+ | "isPlaceholderData"
+ | "status"
+ | "dataUpdatedAt"
+ | "errorUpdatedAt"
+ | "failureCount"
+ | "failureReason"
+ | "errorUpdateCount"
+ | "isFetched"
+ | "isFetchedAfterMount"
+ | "isFetching"
+ | "isInitialLoading"
+ | "isPaused"
+ | "isRefetching"
+ | "isStale"
+ | "isEnabled"
+ | "refetch"
+ | "fetchStatus"): void;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:363](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L363)
+
+Records that the given `QueryObserverResult` property was read, so a subsequent update only
+notifies this observer if a tracked property actually changed. Normally called indirectly via
+[QueryObserver#trackResult](QueryObserver.md#trackresult)'s proxy; exposed directly for adapters that track property
+access themselves (e.g. through their own reactivity system) instead of via the proxy.
+
+#### Parameters
+
+##### key
+
+ \| `"error"`
+ \| `"data"`
+ \| `"isError"`
+ \| `"isPending"`
+ \| `"isLoading"`
+ \| `"isLoadingError"`
+ \| `"isRefetchError"`
+ \| `"isSuccess"`
+ \| `"isPlaceholderData"`
+ \| `"status"`
+ \| `"dataUpdatedAt"`
+ \| `"errorUpdatedAt"`
+ \| `"failureCount"`
+ \| `"failureReason"`
+ \| `"errorUpdateCount"`
+ \| `"isFetched"`
+ \| `"isFetchedAfterMount"`
+ \| `"isFetching"`
+ \| `"isInitialLoading"`
+ \| `"isPaused"`
+ \| `"isRefetching"`
+ \| `"isStale"`
+ \| `"isEnabled"`
+ \| `"refetch"`
+ \| `"fetchStatus"`
+
+The name of the property that was read.
+
+#### Returns
+
+`void`
+
+#### Inherited from
+
+[`QueryObserver`](QueryObserver.md).[`trackProp`](QueryObserver.md#trackprop)
+
+***
+
+### trackResult()
+
+```ts
+trackResult(result: QueryObserverResult, onPropTracked?: (key:
+ | "error"
+ | "data"
+ | "isError"
+ | "isPending"
+ | "isLoading"
+ | "isLoadingError"
+ | "isRefetchError"
+ | "isSuccess"
+ | "isPlaceholderData"
+ | "status"
+ | "dataUpdatedAt"
+ | "errorUpdatedAt"
+ | "failureCount"
+ | "failureReason"
+ | "errorUpdateCount"
+ | "isFetched"
+ | "isFetchedAfterMount"
+ | "isFetching"
+ | "isInitialLoading"
+ | "isPaused"
+ | "isRefetching"
+ | "isStale"
+ | "isEnabled"
+ | "refetch"
+| "fetchStatus") => void): QueryObserverResult;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L343)
+
+Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via
+[QueryObserver#trackProp](QueryObserver.md#trackprop) (and an optional `onPropTracked` callback). Used by framework
+adapters when `notifyOnChangeProps` is not set, to implement its default "only re-render on
+properties you actually read" behavior.
+
+#### Parameters
+
+##### result
+
+[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>
+
+The result to wrap.
+
+##### onPropTracked?
+
+(`key`:
+ \| `"error"`
+ \| `"data"`
+ \| `"isError"`
+ \| `"isPending"`
+ \| `"isLoading"`
+ \| `"isLoadingError"`
+ \| `"isRefetchError"`
+ \| `"isSuccess"`
+ \| `"isPlaceholderData"`
+ \| `"status"`
+ \| `"dataUpdatedAt"`
+ \| `"errorUpdatedAt"`
+ \| `"failureCount"`
+ \| `"failureReason"`
+ \| `"errorUpdateCount"`
+ \| `"isFetched"`
+ \| `"isFetchedAfterMount"`
+ \| `"isFetching"`
+ \| `"isInitialLoading"`
+ \| `"isPaused"`
+ \| `"isRefetching"`
+ \| `"isStale"`
+ \| `"isEnabled"`
+ \| `"refetch"`
+ \| `"fetchStatus"`) => `void`
+
+Called with the name of each property that is read.
+
+#### Returns
+
+[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>
+
+A proxy of `result` that tracks property reads.
+
+#### Inherited from
+
+[`QueryObserver`](QueryObserver.md).[`trackResult`](QueryObserver.md#trackresult)
+
+***
+
+### updateResult()
+
+```ts
+updateResult(): void;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:766](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L766)
+
+Recomputes and stores the current result from the current query/options, notifying listeners
+if it changed. Framework adapters call this right after subscribing to make sure no query
+update was missed in the gap between creating the observer and subscribing to it.
+
+#### Returns
+
+`void`
+
+#### Inherited from
+
+[`QueryObserver`](QueryObserver.md).[`updateResult`](QueryObserver.md#updateresult)
diff --git a/docs/framework/angular/reference/classes/Mutation.md b/docs/framework/angular/reference/classes/Mutation.md
new file mode 100644
index 00000000000..3f13574a7e7
--- /dev/null
+++ b/docs/framework/angular/reference/classes/Mutation.md
@@ -0,0 +1,259 @@
+---
+id: Mutation
+title: Mutation
+---
+
+
+
+Defined in: [packages/query-core/src/mutation.ts:138](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L138)
+
+Represents a single mutation attempt. A `Mutation` holds the mutation's
+options, state (data/error/status), and the `MutationObserver`s currently
+subscribed to it.
+
+Instances are created and managed internally by `MutationCache`; application
+code typically interacts with mutations indirectly through `QueryClient` or
+a framework hook like `useMutation`. Direct access to a `Mutation` instance
+is possible via `mutationCache.find()`/`getAll()` for inspecting cache state.
+
+## Example
+
+```ts
+const mutationCache = queryClient.getMutationCache()
+
+const mutation = mutationCache.find({ mutationKey: ['addPost'] })
+```
+
+## Extends
+
+- `Removable`
+
+## Type Parameters
+
+### TData
+
+`TData` = `unknown`
+
+### TError
+
+`TError` = [`DefaultError`](../type-aliases/DefaultError.md)
+
+### TVariables
+
+`TVariables` = `unknown`
+
+### TOnMutateResult
+
+`TOnMutateResult` = `unknown`
+
+## Constructors
+
+### Constructor
+
+```ts
+new Mutation(config: MutationConfig): Mutation;
+```
+
+Defined in: [packages/query-core/src/mutation.ts:155](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L155)
+
+#### Parameters
+
+##### config
+
+`MutationConfig`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>
+
+#### Returns
+
+`Mutation`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>
+
+#### Overrides
+
+```ts
+Removable.constructor
+```
+
+## Properties
+
+### gcTime
+
+```ts
+gcTime: number;
+```
+
+Defined in: [packages/query-core/src/removable.ts:11](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L11)
+
+#### Inherited from
+
+```ts
+Removable.gcTime
+```
+
+***
+
+### mutationId
+
+```ts
+readonly mutationId: number;
+```
+
+Defined in: [packages/query-core/src/mutation.ts:146](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L146)
+
+***
+
+### options
+
+```ts
+options: MutationOptions;
+```
+
+Defined in: [packages/query-core/src/mutation.ts:145](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L145)
+
+***
+
+### state
+
+```ts
+state: MutationState;
+```
+
+Defined in: [packages/query-core/src/mutation.ts:144](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L144)
+
+## Accessors
+
+### meta
+
+#### Get Signature
+
+```ts
+get meta(): Record | undefined;
+```
+
+Defined in: [packages/query-core/src/mutation.ts:187](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L187)
+
+The `meta` object passed in the mutation's options, if any.
+
+##### Returns
+
+`Record`\<`string`, `unknown`\> \| `undefined`
+
+The mutation's `meta`, or `undefined` if none was set.
+
+## Methods
+
+### continue()
+
+```ts
+continue(): Promise;
+```
+
+Defined in: [packages/query-core/src/mutation.ts:260](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L260)
+
+Resumes a mutation that is currently paused or was restored from a
+dehydrated, still-`pending` state.
+
+- If this mutation has an active retryer (it paused mid-attempt, e.g. due
+ to the network mode or scope-based queuing), its retryer is resumed.
+- Otherwise, if the mutation's status is still `pending` (e.g. it was
+ dehydrated while an attempt was in flight and never got a retryer in
+ this instance), `execute` is called again with the last known variables.
+- Otherwise the mutation has already settled and this resolves immediately
+ without running anything again.
+
+#### Returns
+
+`Promise`\<`unknown`\>
+
+A promise that settles with the resumed mutation: it rejects if the mutation fails.
+It resolves immediately if the mutation has already settled.
+
+#### See
+
+[Mutation#execute](#execute)
+
+#### Example
+
+```ts
+// typically driven by reconnect handling, e.g. queryClient.resumePausedMutations()
+const mutation = mutationCache.find({ mutationKey: ['addPost'] })
+await mutation?.continue()
+```
+
+***
+
+### destroy()
+
+```ts
+destroy(): void;
+```
+
+Defined in: [packages/query-core/src/removable.ts:19](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L19)
+
+Clears the pending garbage collection timeout, so the entry is no longer scheduled for removal.
+A subclass may override this to release what it holds on to as well โ `Query` also cancels any
+in-flight fetch.
+
+#### Returns
+
+`void`
+
+#### Inherited from
+
+```ts
+Removable.destroy
+```
+
+***
+
+### execute()
+
+```ts
+execute(variables: TVariables): Promise;
+```
+
+Defined in: [packages/query-core/src/mutation.ts:301](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L301)
+
+Runs the mutation function for the given variables through a retryer, and
+drives the mutation's state and lifecycle callbacks through to settlement.
+
+If this mutation's state is already `pending` when `execute` is called
+(i.e. it was restored, still in-flight, from a dehydrated state), the
+`onMutate` step is skipped and a `continue` action is dispatched to
+unpause it; otherwise a `pending` action is dispatched first, then the
+mutation cache's `onMutate` and the mutation's own `onMutate` option are
+awaited in that order, and the resulting context is stored.
+
+The mutation function is then run (subject to `retry`/`retryDelay`/
+`networkMode`, and to the mutation cache's scope-based serialization).
+On success, the cache's `onSuccess`/`onSettled` callbacks run before the
+mutation's own `onSuccess`/`onSettled` options, a `success` action is
+dispatched, and the resolved data is returned. On failure, the same
+cache-then-option ordering is used for `onError`/`onSettled`, but each of
+those four callbacks is individually caught so that a throwing callback
+cannot mask the original error; an `error` action is then dispatched and
+the original error is re-thrown.
+
+#### Parameters
+
+##### variables
+
+`TVariables`
+
+The variables passed to the `mutationFn`.
+
+#### Returns
+
+`Promise`\<`TData`\>
+
+A promise that resolves with the mutation's data, or rejects with its error.
+
+#### See
+
+[Mutation#continue](#continue)
+
+#### Example
+
+```ts
+// Called internally by `MutationObserver.mutate` and `Mutation.continue` โ
+// applications normally trigger mutations through those, not this method.
+const data = await mutation.execute(variables)
+```
diff --git a/docs/framework/angular/reference/classes/MutationCache.md b/docs/framework/angular/reference/classes/MutationCache.md
new file mode 100644
index 00000000000..3b25d47f2a5
--- /dev/null
+++ b/docs/framework/angular/reference/classes/MutationCache.md
@@ -0,0 +1,288 @@
+---
+id: MutationCache
+title: MutationCache
+---
+
+
+
+Defined in: [packages/query-core/src/mutationCache.ts:123](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L123)
+
+The `MutationCache` is the storage for mutations.
+
+Normally, you will not interact with the `MutationCache` directly and instead use a
+`QueryClient`. You can subscribe to it (inherited from `Subscribable`) to be informed of
+safe/known updates to the cache, such as mutations being added, removed, or updated.
+
+## Example
+
+```ts
+const unsubscribe = mutationCache.subscribe((event) => {
+ console.log(event.type, event.mutation)
+})
+```
+
+## Extends
+
+- `Subscribable`\<`MutationCacheListener`\>
+
+## Constructors
+
+### Constructor
+
+```ts
+new MutationCache(config?: MutationCacheConfig): MutationCache;
+```
+
+Defined in: [packages/query-core/src/mutationCache.ts:128](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L128)
+
+#### Parameters
+
+##### config?
+
+[`MutationCacheConfig`](../interfaces/MutationCacheConfig.md) = `{}`
+
+#### Returns
+
+`MutationCache`
+
+#### Overrides
+
+```ts
+Subscribable.constructor
+```
+
+## Properties
+
+### config
+
+```ts
+config: MutationCacheConfig = {};
+```
+
+Defined in: [packages/query-core/src/mutationCache.ts:128](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L128)
+
+## Methods
+
+### clear()
+
+```ts
+clear(): void;
+```
+
+Defined in: [packages/query-core/src/mutationCache.ts:262](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L262)
+
+Removes all mutations from the cache.
+
+#### Returns
+
+`void`
+
+#### Example
+
+```ts
+const mutationCache = queryClient.getMutationCache()
+
+mutationCache.clear()
+```
+
+***
+
+### find()
+
+```ts
+find(filters: MutationFilters):
+ | Mutation
+ | undefined;
+```
+
+Defined in: [packages/query-core/src/mutationCache.ts:306](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L306)
+
+A slightly more advanced method that can be used to get an existing mutation instance from
+the cache. If the mutation does not exist, `undefined` is returned.
+
+This is not typically needed for most applications, but can come in handy when needing more
+information about a mutation in rare scenarios.
+
+#### Type Parameters
+
+##### TData
+
+`TData` = `unknown`
+
+##### TError
+
+`TError` = `Error`
+
+##### TVariables
+
+`TVariables` = `any`
+
+##### TOnMutateResult
+
+`TOnMutateResult` = `unknown`
+
+#### Parameters
+
+##### filters
+
+[`MutationFilters`](../interfaces/MutationFilters.md)
+
+The filters to match. `exact` defaults to `true`.
+
+#### Returns
+
+ \| [`Mutation`](Mutation.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>
+ \| `undefined`
+
+The first matching mutation, or `undefined`.
+
+#### See
+
+[MutationCache#findAll](#findall)
+
+#### Example
+
+```ts
+const mutationCache = queryClient.getMutationCache()
+
+const mutation = mutationCache.find({ mutationKey: ['addPost'] })
+```
+
+***
+
+### findAll()
+
+```ts
+findAll(filters?: MutationFilters): Mutation[];
+```
+
+Defined in: [packages/query-core/src/mutationCache.ts:337](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L337)
+
+An even more advanced method that can be used to get existing mutation instances from the
+cache that match the given filters. If no mutations match, an empty array is returned.
+
+This is not typically needed for most applications, but can come in handy when needing more
+information about mutations in rare scenarios.
+
+#### Parameters
+
+##### filters?
+
+[`MutationFilters`](../interfaces/MutationFilters.md) = `{}`
+
+The filters to match. Without filters, every mutation is returned.
+
+#### Returns
+
+[`Mutation`](Mutation.md)\<`unknown`, `Error`, `unknown`, `unknown`\>[]
+
+The matching mutations.
+
+#### See
+
+[MutationCache#find](#find)
+
+#### Example
+
+```ts
+const mutationCache = queryClient.getMutationCache()
+
+const mutations = mutationCache.findAll({ mutationKey: ['addPost'] })
+```
+
+***
+
+### getAll()
+
+```ts
+getAll(): Mutation[];
+```
+
+Defined in: [packages/query-core/src/mutationCache.ts:286](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationCache.ts#L286)
+
+Returns all mutations within the cache.
+
+This is not typically needed for most applications, but can come in handy when needing more
+information about a mutation in rare scenarios.
+
+#### Returns
+
+[`Mutation`](Mutation.md)\<`unknown`, `Error`, `unknown`, `unknown`\>[]
+
+Every mutation in the cache.
+
+#### Example
+
+```ts
+const mutationCache = queryClient.getMutationCache()
+
+const mutations = mutationCache.getAll()
+```
+
+***
+
+### hasListeners()
+
+```ts
+hasListeners(): boolean;
+```
+
+Defined in: [packages/query-core/src/subscribable.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L43)
+
+Returns `true` while at least one listener is registered, `false` once they have all unsubscribed.
+
+#### Returns
+
+`boolean`
+
+`true` if at least one listener is registered.
+
+#### Inherited from
+
+```ts
+Subscribable.hasListeners
+```
+
+***
+
+### subscribe()
+
+```ts
+subscribe(listener: MutationCacheListener): () => void;
+```
+
+Defined in: [packages/query-core/src/subscribable.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L28)
+
+Registers a listener to be called on every update this object notifies about. Returns a function
+that removes the listener again โ call it to stop listening. The base class never drops a listener
+on its own, though some subclasses clear all of theirs in `destroy()`.
+
+#### Parameters
+
+##### listener
+
+`MutationCacheListener`
+
+Called on each update, with whatever the subclass passes to its subscribers.
+
+#### Returns
+
+A function that removes the listener.
+
+() => `void`
+
+#### Example
+
+```ts
+const unsubscribe = subscribable.subscribe(() => {
+ // react to the update
+})
+
+unsubscribe()
+```
+
+#### Inherited from
+
+```ts
+Subscribable.subscribe
+```
diff --git a/docs/framework/angular/reference/classes/MutationObserver.md b/docs/framework/angular/reference/classes/MutationObserver.md
new file mode 100644
index 00000000000..3034a4ac62b
--- /dev/null
+++ b/docs/framework/angular/reference/classes/MutationObserver.md
@@ -0,0 +1,293 @@
+---
+id: MutationObserver
+title: MutationObserver
+---
+
+
+
+Defined in: [packages/query-core/src/mutationObserver.ts:37](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L37)
+
+Observes a single mutation and derives a `MutationObserverResult` from it.
+A framework hook like `useMutation` creates one `MutationObserver` per hook
+call, keeps it stable across re-renders, calls `setOptions` when the options
+passed to the hook change, subscribes to it to re-render on updates, and
+reads `getCurrentResult()` for the value to return. Calling `mutate()`
+builds a new underlying `Mutation` in the `MutationCache` and executes it.
+
+## Example
+
+```ts
+const observer = new MutationObserver(queryClient, {
+ mutationFn: (variables: { title: string }) => addPost(variables),
+})
+```
+
+## Extends
+
+- `Subscribable`\<`MutationObserverListener`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>\>
+
+## Type Parameters
+
+### TData
+
+`TData` = `unknown`
+
+### TError
+
+`TError` = [`DefaultError`](../type-aliases/DefaultError.md)
+
+### TVariables
+
+`TVariables` = `void`
+
+### TOnMutateResult
+
+`TOnMutateResult` = `unknown`
+
+## Constructors
+
+### Constructor
+
+```ts
+new MutationObserver(client: QueryClient, options: MutationObserverOptions): MutationObserver;
+```
+
+Defined in: [packages/query-core/src/mutationObserver.ts:57](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L57)
+
+#### Parameters
+
+##### client
+
+[`QueryClient`](QueryClient.md)
+
+##### options
+
+[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>
+
+#### Returns
+
+`MutationObserver`\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>
+
+#### Overrides
+
+```ts
+Subscribable<
+ MutationObserverListener
+>.constructor
+```
+
+## Properties
+
+### options
+
+```ts
+options: MutationObserverOptions;
+```
+
+Defined in: [packages/query-core/src/mutationObserver.ts:45](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L45)
+
+## Methods
+
+### getCurrentResult()
+
+```ts
+getCurrentResult(): MutationObserverResult;
+```
+
+Defined in: [packages/query-core/src/mutationObserver.ts:165](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L165)
+
+Returns the observer's current result, derived from the observed
+mutation's state (or the default, `idle` state if no mutation has been
+built yet, e.g. before the first `mutate()` call or after `reset()`).
+
+#### Returns
+
+[`MutationObserverResult`](../type-aliases/MutationObserverResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>
+
+The observer's latest result.
+
+***
+
+### hasListeners()
+
+```ts
+hasListeners(): boolean;
+```
+
+Defined in: [packages/query-core/src/subscribable.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L43)
+
+Returns `true` while at least one listener is registered, `false` once they have all unsubscribed.
+
+#### Returns
+
+`boolean`
+
+`true` if at least one listener is registered.
+
+#### Inherited from
+
+```ts
+Subscribable.hasListeners
+```
+
+***
+
+### mutate()
+
+```ts
+mutate(variables: TVariables, options?: MutateOptions): Promise;
+```
+
+Defined in: [packages/query-core/src/mutationObserver.ts:217](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L217)
+
+Builds a new `Mutation` in the `MutationCache` using the observer's
+current options, detaches this observer from any previously observed
+mutation, attaches it to the new one, and executes it with the given
+variables.
+
+The optional per-call `options` (`onSuccess`/`onError`/`onSettled`) are
+invoked once the mutation settles, in addition to any callbacks defined
+on the observer's own options.
+
+#### Parameters
+
+##### variables
+
+`TVariables`
+
+The variables passed to the `mutationFn`.
+
+##### options?
+
+[`MutateOptions`](../interfaces/MutateOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>
+
+Per-call `onSuccess`, `onError`, and `onSettled` callbacks.
+
+#### Returns
+
+`Promise`\<`TData`\>
+
+A promise that resolves with the mutation's data, or rejects with its error.
+
+#### Example
+
+```ts
+await observer.mutate(
+ { title: 'New post' },
+ { onSuccess: (data) => console.log(data) },
+)
+```
+
+***
+
+### reset()
+
+```ts
+reset(): void;
+```
+
+Defined in: [packages/query-core/src/mutationObserver.ts:188](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L188)
+
+Detaches the observer from the mutation it is currently observing (if
+any) and resets the observed result back to its default, `idle` state.
+
+This does not cancel an in-flight mutation; the mutation itself keeps
+running to completion and its own callbacks still fire, but this
+observer stops reflecting its state and a subsequent `mutate()` call
+will build a brand new mutation.
+
+#### Returns
+
+`void`
+
+#### See
+
+[MutationObserver#mutate](#mutate)
+
+#### Example
+
+```ts
+observer.reset()
+```
+
+***
+
+### setOptions()
+
+```ts
+setOptions(options: MutationObserverOptions): void;
+```
+
+Defined in: [packages/query-core/src/mutationObserver.ts:100](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutationObserver.ts#L100)
+
+Updates the observer's options.
+
+If the new `mutationKey` differs from the previous one (and both were
+defined), the observer is reset, detaching it from the mutation it was
+observing. Otherwise, if the currently observed mutation is still
+`pending`, its options are updated in place as well.
+
+#### Parameters
+
+##### options
+
+[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>
+
+The new mutation observer options. They are defaulted with [QueryClient#defaultMutationOptions](QueryClient.md#defaultmutationoptions) before being applied.
+
+#### Returns
+
+`void`
+
+#### Example
+
+```ts
+observer.setOptions({
+ mutationFn: (variables: { title: string }) => addPost(variables),
+ onSuccess: (data) => console.log(data),
+})
+```
+
+***
+
+### subscribe()
+
+```ts
+subscribe(listener: MutationObserverListener): () => void;
+```
+
+Defined in: [packages/query-core/src/subscribable.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L28)
+
+Registers a listener to be called on every update this object notifies about. Returns a function
+that removes the listener again โ call it to stop listening. The base class never drops a listener
+on its own, though some subclasses clear all of theirs in `destroy()`.
+
+#### Parameters
+
+##### listener
+
+`MutationObserverListener`
+
+Called on each update, with whatever the subclass passes to its subscribers.
+
+#### Returns
+
+A function that removes the listener.
+
+() => `void`
+
+#### Example
+
+```ts
+const unsubscribe = subscribable.subscribe(() => {
+ // react to the update
+})
+
+unsubscribe()
+```
+
+#### Inherited from
+
+```ts
+Subscribable.subscribe
+```
diff --git a/docs/framework/angular/reference/classes/QueriesObserver.md b/docs/framework/angular/reference/classes/QueriesObserver.md
new file mode 100644
index 00000000000..865496990da
--- /dev/null
+++ b/docs/framework/angular/reference/classes/QueriesObserver.md
@@ -0,0 +1,305 @@
+---
+id: QueriesObserver
+title: QueriesObserver
+---
+
+
+
+Defined in: [packages/query-core/src/queriesObserver.ts:64](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L64)
+
+A `QueriesObserver` watches an array of queries at once, exposing them as
+a single array of `QueryObserverResult`s (or, when a `combine` option is
+given, as a combined value derived from that array). It manages one
+internal `QueryObserver` per query, and is the primitive that framework
+adapters (e.g. `useQueries`) build their hooks on top of.
+
+## Example
+
+```ts
+const observer = new QueriesObserver(queryClient, [
+ { queryKey: ['post', 1], queryFn: fetchPost },
+ { queryKey: ['post', 2], queryFn: fetchPost },
+])
+
+const unsubscribe = observer.subscribe((result) => {
+ console.log(result)
+})
+```
+
+## Extends
+
+- `Subscribable`\<`QueriesObserverListener`\>
+
+## Type Parameters
+
+### TCombinedResult
+
+`TCombinedResult` = [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[]
+
+## Constructors
+
+### Constructor
+
+```ts
+new QueriesObserver(
+ client: QueryClient,
+ queries: QueryObserverOptions[],
+ options?: QueriesObserverOptions
+): QueriesObserver;
+```
+
+Defined in: [packages/query-core/src/queriesObserver.ts:78](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L78)
+
+#### Parameters
+
+##### client
+
+[`QueryClient`](QueryClient.md)
+
+##### queries
+
+[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`any`, `any`, `any`, `any`, `any`, `never`\>[]
+
+##### options?
+
+[`QueriesObserverOptions`](../interfaces/QueriesObserverOptions.md)\<`TCombinedResult`\>
+
+#### Returns
+
+`QueriesObserver`\<`TCombinedResult`\>
+
+#### Overrides
+
+```ts
+Subscribable.constructor
+```
+
+## Methods
+
+### destroy()
+
+```ts
+destroy(): void;
+```
+
+Defined in: [packages/query-core/src/queriesObserver.ts:114](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L114)
+
+Stops observing all queries: clears all listeners and destroys every
+underlying `QueryObserver` this observer manages.
+
+#### Returns
+
+`void`
+
+***
+
+### getCurrentResult()
+
+```ts
+getCurrentResult(): QueryObserverResult[];
+```
+
+Defined in: [packages/query-core/src/queriesObserver.ts:219](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L219)
+
+Returns the most recently computed array of `QueryObserverResult`s, one
+per observed query, in the same order as the queries passed to the
+constructor or `setQueries`.
+
+#### Returns
+
+[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[]
+
+The current results.
+
+#### Example
+
+```ts
+const results = observer.getCurrentResult()
+const data = results.map((result) => result.data)
+```
+
+***
+
+### getObservers()
+
+```ts
+getObservers(): QueryObserver[];
+```
+
+Defined in: [packages/query-core/src/queriesObserver.ts:238](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L238)
+
+Returns the underlying `QueryObserver` instances this observer manages,
+in the same order as the queries passed to the constructor or
+`setQueries`.
+
+#### Returns
+
+[`QueryObserver`](QueryObserver.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[]\>[]
+
+The managed query observers.
+
+***
+
+### getOptimisticResult()
+
+```ts
+getOptimisticResult(queries: QueryObserverOptions[], combine: CombineFn | undefined): [rawResult: QueryObserverResult[], combineResult: (r?: QueryObserverResult[]) => TCombinedResult, trackResult: () => QueryObserverResult[]];
+```
+
+Defined in: [packages/query-core/src/queriesObserver.ts:253](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L253)
+
+The `QueriesObserver` counterpart of [QueryObserver#getOptimisticResult](QueryObserver.md#getoptimisticresult) โ computes
+the result for the given (already-defaulted) queries right now, synchronously. Called by
+framework adapters (e.g. `useQueries`) ahead of subscribing, returning a tuple of the raw
+per-query results, a function to compute the combined result from them, and a function to
+wrap the results for property-access tracking.
+
+#### Parameters
+
+##### queries
+
+[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[], `never`\>[]
+
+The defaulted options of the queries to compute the result for.
+
+##### combine
+
+`CombineFn`\<`TCombinedResult`\> \| `undefined`
+
+The `combine` function used by the returned `combineResult`, if any.
+
+#### Returns
+
+\[`rawResult`: [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[], `combineResult`: (`r?`: [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[]) => `TCombinedResult`, `trackResult`: () => [`QueryObserverResult`](../type-aliases/QueryObserverResult.md)[]\]
+
+A tuple of the per-query results, a function that computes the combined result, and a
+function that returns the results wrapped for property-access tracking.
+
+***
+
+### getQueries()
+
+```ts
+getQueries(): Query[];
+```
+
+Defined in: [packages/query-core/src/queriesObserver.ts:228](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L228)
+
+Returns the underlying `Query` instances currently being observed, in
+the same order as the queries passed to the constructor or `setQueries`.
+
+#### Returns
+
+[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[]
+
+The observed queries.
+
+***
+
+### hasListeners()
+
+```ts
+hasListeners(): boolean;
+```
+
+Defined in: [packages/query-core/src/subscribable.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L43)
+
+Returns `true` while at least one listener is registered, `false` once they have all unsubscribed.
+
+#### Returns
+
+`boolean`
+
+`true` if at least one listener is registered.
+
+#### Inherited from
+
+```ts
+Subscribable.hasListeners
+```
+
+***
+
+### setQueries()
+
+```ts
+setQueries(queries: QueryObserverOptions[], options?: QueriesObserverOptions): void;
+```
+
+Defined in: [packages/query-core/src/queriesObserver.ts:136](https://github.com/TanStack/query/blob/main/packages/query-core/src/queriesObserver.ts#L136)
+
+Replaces the set of queries being observed. Existing `QueryObserver`s
+are reused for queries that match an already-observed query hash;
+observers for queries that are no longer present are destroyed, and new
+observers are created and subscribed to for newly added queries.
+
+#### Parameters
+
+##### queries
+
+[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`unknown`, `Error`, `unknown`, `unknown`, readonly `unknown`[], `never`\>[]
+
+The options of the queries to observe.
+
+##### options?
+
+[`QueriesObserverOptions`](../interfaces/QueriesObserverOptions.md)\<`TCombinedResult`\>
+
+Replaces the observer's options, e.g. its `combine` function.
+
+#### Returns
+
+`void`
+
+#### Example
+
+```ts
+observer.setQueries([
+ { queryKey: ['post', 1], queryFn: fetchPost },
+ { queryKey: ['post', 3], queryFn: fetchPost },
+])
+```
+
+***
+
+### subscribe()
+
+```ts
+subscribe(listener: QueriesObserverListener): () => void;
+```
+
+Defined in: [packages/query-core/src/subscribable.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L28)
+
+Registers a listener to be called on every update this object notifies about. Returns a function
+that removes the listener again โ call it to stop listening. The base class never drops a listener
+on its own, though some subclasses clear all of theirs in `destroy()`.
+
+#### Parameters
+
+##### listener
+
+`QueriesObserverListener`
+
+Called on each update, with whatever the subclass passes to its subscribers.
+
+#### Returns
+
+A function that removes the listener.
+
+() => `void`
+
+#### Example
+
+```ts
+const unsubscribe = subscribable.subscribe(() => {
+ // react to the update
+})
+
+unsubscribe()
+```
+
+#### Inherited from
+
+```ts
+Subscribable.subscribe
+```
diff --git a/docs/framework/angular/reference/classes/Query.md b/docs/framework/angular/reference/classes/Query.md
new file mode 100644
index 00000000000..0f7e54a173c
--- /dev/null
+++ b/docs/framework/angular/reference/classes/Query.md
@@ -0,0 +1,539 @@
+---
+id: Query
+title: Query
+---
+
+
+
+Defined in: [packages/query-core/src/query.ts:284](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L284)
+
+Represents a single cached query. A `Query` holds the query's key, options,
+state (data/error/status), and the observers currently subscribed to it.
+
+Instances are created and managed internally by `QueryCache`; application
+code typically interacts with queries indirectly through `QueryClient` or
+a framework hook like `useQuery`. Direct access to a `Query` instance is
+possible via `queryCache.find()`/`findAll()` for inspecting cache state.
+
+## Example
+
+```ts
+const queryCache = queryClient.getQueryCache()
+const query = queryCache.find({ queryKey: ['posts'] })
+
+if (query) {
+ console.log(query.state.dataUpdatedAt)
+}
+```
+
+## Extends
+
+- `Removable`
+
+## Type Parameters
+
+### TQueryFnData
+
+`TQueryFnData` = `unknown`
+
+### TError
+
+`TError` = [`DefaultError`](../type-aliases/DefaultError.md)
+
+### TData
+
+`TData` = `TQueryFnData`
+
+### TQueryKey
+
+`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md)
+
+## Constructors
+
+### Constructor
+
+```ts
+new Query(config: QueryConfig): Query;
+```
+
+Defined in: [packages/query-core/src/query.ts:306](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L306)
+
+#### Parameters
+
+##### config
+
+`QueryConfig`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\>
+
+#### Returns
+
+`Query`\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\>
+
+#### Overrides
+
+```ts
+Removable.constructor
+```
+
+## Properties
+
+### gcTime
+
+```ts
+gcTime: number;
+```
+
+Defined in: [packages/query-core/src/removable.ts:11](https://github.com/TanStack/query/blob/main/packages/query-core/src/removable.ts#L11)
+
+#### Inherited from
+
+```ts
+Removable.gcTime
+```
+
+***
+
+### observers
+
+```ts
+observers: QueryObserver[];
+```
+
+Defined in: [packages/query-core/src/query.ts:302](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L302)
+
+***
+
+### options
+
+```ts
+options: QueryOptions;
+```
+
+Defined in: [packages/query-core/src/query.ts:292](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L292)
+
+***
+
+### queryHash
+
+```ts
+queryHash: string;
+```
+
+Defined in: [packages/query-core/src/query.ts:291](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L291)
+
+***
+
+### queryKey
+
+```ts
+queryKey: TQueryKey;
+```
+
+Defined in: [packages/query-core/src/query.ts:290](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L290)
+
+***
+
+### state
+
+```ts
+state: QueryState;
+```
+
+Defined in: [packages/query-core/src/query.ts:293](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L293)
+
+## Accessors
+
+### meta
+
+#### Get Signature
+
+```ts
+get meta(): Record | undefined;
+```
+
+Defined in: [packages/query-core/src/query.ts:325](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L325)
+
+The `meta` object passed in the query's options, if any.
+
+##### Returns
+
+`Record`\<`string`, `unknown`\> \| `undefined`
+
+The query's `meta`, or `undefined` if none was set.
+
+***
+
+### promise
+
+#### Get Signature
+
+```ts
+get promise(): Promise | undefined;
+```
+
+Defined in: [packages/query-core/src/query.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L343)
+
+The promise for the currently in-flight fetch, if the query is fetching.
+`undefined` when the query is not fetching.
+
+##### Returns
+
+`Promise`\<`TData`\> \| `undefined`
+
+The promise of the in-flight fetch, or `undefined`.
+
+## Methods
+
+### cancel()
+
+```ts
+cancel(options?: CancelOptions): Promise;
+```
+
+Defined in: [packages/query-core/src/query.ts:429](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L429)
+
+Cancels the query's currently in-flight fetch, if any.
+- Returns a promise that resolves once the cancellation has settled.
+- If no fetch is in progress, resolves immediately.
+
+#### Parameters
+
+##### options?
+
+[`CancelOptions`](../interfaces/CancelOptions.md)
+
+Set `revert` to restore the state from before the fetch started, and `silent`
+to suppress the cancellation error when a new fetch replaces the cancelled one.
+
+#### Returns
+
+`Promise`\<`void`\>
+
+A promise that resolves once the cancellation has settled.
+
+#### Example
+
+```ts
+await query.cancel()
+```
+
+***
+
+### destroy()
+
+```ts
+destroy(): void;
+```
+
+Defined in: [packages/query-core/src/query.ts:441](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L441)
+
+Clears the query's garbage collection timeout and silently cancels any
+in-flight fetch. Called by `QueryCache` when the query is removed from
+the cache.
+
+#### Returns
+
+`void`
+
+#### See
+
+[Query#cancel](#cancel)
+
+#### Overrides
+
+```ts
+Removable.destroy
+```
+
+***
+
+### fetch()
+
+```ts
+fetch(options?: QueryOptions, fetchOptions?: FetchOptions): Promise;
+```
+
+Defined in: [packages/query-core/src/query.ts:709](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L709)
+
+Fetches the query, i.e. runs its `queryFn` (through any configured
+retryer/behavior) and updates the query's state with the result.
+- If a fetch is already in flight, returns its promise instead of
+ starting a new one, unless `fetchOptions.cancelRefetch` is set and the
+ query already has data, in which case the current fetch is silently
+ cancelled first.
+- If `options` is passed, it replaces the query's current options
+ before fetching.
+
+#### Parameters
+
+##### options?
+
+[`QueryOptions`](../interfaces/QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\>
+
+Query options that replace the query's current options before fetching. They
+are not applied when an in-flight fetch is reused.
+
+##### fetchOptions?
+
+`FetchOptions`\<`TQueryFnData`\>
+
+Set `cancelRefetch` to cancel an in-flight fetch first (only if the query
+already has data), and `meta` to pass extra information to the query's behavior.
+
+#### Returns
+
+`Promise`\<`TData`\>
+
+A promise that resolves with the fetched data, or rejects with the fetch error. If the
+fetch is cancelled with `revert` while the query has data, it resolves with the restored data
+instead.
+
+***
+
+### getObserversCount()
+
+```ts
+getObserversCount(): number;
+```
+
+Defined in: [packages/query-core/src/query.ts:673](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L673)
+
+Returns the number of observers currently subscribed to this query.
+
+#### Returns
+
+`number`
+
+The number of observers.
+
+#### Example
+
+```ts
+if (query.getObserversCount() === 0) {
+ // no component is currently watching this query
+}
+```
+
+***
+
+### invalidate()
+
+```ts
+invalidate(): void;
+```
+
+Defined in: [packages/query-core/src/query.ts:686](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L686)
+
+Marks the query as invalidated, unless it is already invalidated. This
+updates `state.isInvalidated` and notifies observers, but does not by
+itself trigger a refetch.
+
+#### Returns
+
+`void`
+
+#### Example
+
+```ts
+query.invalidate()
+```
+
+***
+
+### isActive()
+
+```ts
+isActive(): boolean;
+```
+
+Defined in: [packages/query-core/src/query.ts:471](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L471)
+
+Returns `true` if the query has at least one observer for which `enabled`
+does not resolve to `false`.
+
+#### Returns
+
+`boolean`
+
+`true` if the query has an enabled observer.
+
+***
+
+### isDisabled()
+
+```ts
+isDisabled(): boolean;
+```
+
+Defined in: [packages/query-core/src/query.ts:486](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L486)
+
+Returns `true` if the query is disabled, meaning it will not fetch
+automatically.
+- If the query has observers, it is disabled when none of them are active
+ (see `isActive`).
+- If the query has no observers, it is disabled when its `queryFn` is
+ `skipToken` or it has never been fetched.
+
+#### Returns
+
+`boolean`
+
+`true` if the query is disabled.
+
+***
+
+### isFetched()
+
+```ts
+isFetched(): boolean;
+```
+
+Defined in: [packages/query-core/src/query.ts:499](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L499)
+
+Returns `true` if the query has been fetched, i.e. it has resolved with
+either data or an error at least once.
+
+#### Returns
+
+`boolean`
+
+`true` if the query has been fetched.
+
+***
+
+### isStale()
+
+```ts
+isStale(): boolean;
+```
+
+Defined in: [packages/query-core/src/query.ts:539](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L539)
+
+Returns `true` if the query is stale.
+- If the query has observers, defers to whether any observer's current
+ result reports `isStale` (which accounts for each observer's own
+ `staleTime` and `enabled` state).
+- If the query has no observers, it is considered stale when it has no
+ data or has been invalidated.
+
+#### Returns
+
+`boolean`
+
+`true` if the query is stale.
+
+#### See
+
+[Query#isStaleByTime](#isstalebytime)
+
+#### Example
+
+```ts
+if (query.isStale()) {
+ // refetch or otherwise treat the cached data as outdated
+}
+```
+
+***
+
+### isStaleByTime()
+
+```ts
+isStaleByTime(staleTime?: number | "static"): boolean;
+```
+
+Defined in: [packages/query-core/src/query.ts:567](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L567)
+
+Returns `true` if the query's data is stale relative to the given
+`staleTime` (defaults to `0`).
+- A query with no data is always stale.
+- `staleTime: 'static'` is never stale.
+- An invalidated query is always stale.
+- Otherwise, staleness is based on elapsed time since `dataUpdatedAt`.
+
+#### Parameters
+
+##### staleTime?
+
+`number` \| `"static"` = `0`
+
+The time, in milliseconds, after which data is considered stale, or
+`'static'` to never treat existing data as stale. A query without data is stale either way.
+
+#### Returns
+
+`boolean`
+
+`true` if the query's data is stale.
+
+#### See
+
+[Query#isStale](#isstale)
+
+#### Example
+
+```ts
+const isStale = query.isStaleByTime(60 * 1000)
+```
+
+***
+
+### isStatic()
+
+```ts
+isStatic(): boolean;
+```
+
+Defined in: [packages/query-core/src/query.ts:508](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L508)
+
+Returns `true` if the query has data and at least one observer configured with
+`staleTime: 'static'`, meaning it is treated as never stale.
+
+#### Returns
+
+`boolean`
+
+`true` if the query is static.
+
+***
+
+### reset()
+
+```ts
+reset(): void;
+```
+
+Defined in: [packages/query-core/src/query.ts:461](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L461)
+
+Resets the query back to its initial state (the state it had when it was
+first created, e.g. any `initialData`), destroying it first to cancel any
+in-flight fetch.
+
+#### Returns
+
+`void`
+
+***
+
+### setState()
+
+```ts
+setState(state: Partial>): void;
+```
+
+Defined in: [packages/query-core/src/query.ts:413](https://github.com/TanStack/query/blob/main/packages/query-core/src/query.ts#L413)
+
+Merges the given partial state directly into this query's state, notifying observers. Used
+by persistence and broadcast plugins to restore a state snapshot, and by devtools to let a
+user manually trigger a loading/error state or edit the cached data.
+
+#### Parameters
+
+##### state
+
+`Partial`\<[`QueryState`](../interfaces/QueryState.md)\<`TData`, `TError`\>\>
+
+The partial state to merge into the query's state.
+
+#### Returns
+
+`void`
diff --git a/docs/framework/angular/reference/classes/QueryCache.md b/docs/framework/angular/reference/classes/QueryCache.md
new file mode 100644
index 00000000000..7ccd4632803
--- /dev/null
+++ b/docs/framework/angular/reference/classes/QueryCache.md
@@ -0,0 +1,461 @@
+---
+id: QueryCache
+title: QueryCache
+---
+
+
+
+Defined in: [packages/query-core/src/queryCache.ts:140](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L140)
+
+The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta
+information, and state of the queries it contains.
+
+Normally, you will not interact with the `QueryCache` directly and instead use a `QueryClient`
+for a specific cache. You can subscribe to it (inherited from `Subscribable`) to be informed of
+safe/known updates to the cache, such as queries being added, removed, or updated โ updates made
+outside of the cache's own tracked mechanisms (e.g. mutating a query's state object directly) do
+not notify subscribers.
+
+## Example
+
+```ts
+const unsubscribe = queryCache.subscribe((event) => {
+ console.log(event.type, event.query)
+})
+```
+
+## Extends
+
+- `Subscribable`\<`QueryCacheListener`\>
+
+## Constructors
+
+### Constructor
+
+```ts
+new QueryCache(config?: QueryCacheConfig): QueryCache;
+```
+
+Defined in: [packages/query-core/src/queryCache.ts:143](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L143)
+
+#### Parameters
+
+##### config?
+
+[`QueryCacheConfig`](../interfaces/QueryCacheConfig.md) = `{}`
+
+#### Returns
+
+`QueryCache`
+
+#### Overrides
+
+```ts
+Subscribable.constructor
+```
+
+## Properties
+
+### config
+
+```ts
+config: QueryCacheConfig = {};
+```
+
+Defined in: [packages/query-core/src/queryCache.ts:143](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L143)
+
+## Methods
+
+### build()
+
+```ts
+build(
+ client: QueryClient,
+ options: WithRequired, "queryKey">,
+ state?: QueryState
+): Query;
+```
+
+Defined in: [packages/query-core/src/queryCache.ts:169](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L169)
+
+Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or
+builds and adds a new one to the cache if none exists yet. Used by framework adapters and
+plugins (e.g. broadcast/persistence) that need to get-or-create a `Query` directly, bypassing
+the reactive `QueryObserver` machinery.
+
+#### Type Parameters
+
+##### TQueryFnData
+
+`TQueryFnData` = `unknown`
+
+##### TError
+
+`TError` = `Error`
+
+##### TData
+
+`TData` = `TQueryFnData`
+
+##### TQueryKey
+
+`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+#### Parameters
+
+##### client
+
+[`QueryClient`](QueryClient.md)
+
+The client the query belongs to, used to default its options.
+
+##### options
+
+[`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryOptions`](../interfaces/QueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `never`\>, `"queryKey"`\>
+
+The query options, including the `queryKey`. A new query is created with the
+options defaulted by [QueryClient#defaultQueryOptions](QueryClient.md#defaultqueryoptions).
+
+##### state?
+
+[`QueryState`](../interfaces/QueryState.md)\<`TData`, `TError`\>
+
+The initial state of a newly created query, e.g. when hydrating. Ignored if the
+query already exists.
+
+#### Returns
+
+[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\>
+
+The existing or newly created query.
+
+#### Example
+
+```ts
+const queryCache = queryClient.getQueryCache()
+
+const query = queryCache.build(queryClient, {
+ queryKey: ['posts'],
+ queryFn: fetchPosts,
+})
+```
+
+***
+
+### clear()
+
+```ts
+clear(): void;
+```
+
+Defined in: [packages/query-core/src/queryCache.ts:254](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L254)
+
+Removes all queries from the cache.
+
+#### Returns
+
+`void`
+
+#### Example
+
+```ts
+const queryCache = queryClient.getQueryCache()
+
+queryCache.clear()
+```
+
+***
+
+### find()
+
+```ts
+find(filters: WithRequired, "queryKey">):
+ | Query
+ | undefined;
+```
+
+Defined in: [packages/query-core/src/queryCache.ts:324](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L324)
+
+A slightly more advanced method that can be used to get an existing query instance from the
+cache. This instance not only contains all the state for the query, but all of the instances,
+and underlying guts of the query as well. If the query does not exist, `undefined` is
+returned.
+
+This is not typically needed for most applications, but can come in handy when needing more
+information about a query in rare scenarios (e.g. looking at `query.state.dataUpdatedAt` to
+decide whether a query is fresh enough to be used as an initial value).
+
+#### Type Parameters
+
+##### TQueryFnData
+
+`TQueryFnData` = `unknown`
+
+##### TError
+
+`TError` = `Error`
+
+##### TData
+
+`TData` = `TQueryFnData`
+
+#### Parameters
+
+##### filters
+
+[`WithRequired`](../type-aliases/WithRequired.md)\<[`QueryFilters`](../interfaces/QueryFilters.md)\, `"queryKey"`\>
+
+The filters to match, including the required `queryKey`. `exact` defaults to
+`true`.
+
+#### Returns
+
+ \| [`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, readonly `unknown`[]\>
+ \| `undefined`
+
+The first matching query, or `undefined`.
+
+#### See
+
+[QueryCache#findAll](#findall)
+
+#### Example
+
+```ts
+const queryCache = queryClient.getQueryCache()
+
+const query = queryCache.find({ queryKey: ['posts'] })
+```
+
+***
+
+### findAll()
+
+```ts
+findAll(filters?: QueryFilters): Query[];
+```
+
+Defined in: [packages/query-core/src/queryCache.ts:350](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L350)
+
+An even more advanced method that can be used to get existing query instances from the cache
+that partially match a query key. If no queries match, an empty array is returned.
+
+This is not typically needed for most applications, but can come in handy when needing more
+information about queries in rare scenarios.
+
+#### Parameters
+
+##### filters?
+
+[`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = `{}`
+
+The filters to match. Without filters, every query is returned.
+
+#### Returns
+
+[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[]
+
+The matching queries.
+
+#### See
+
+[QueryCache#find](#find)
+
+#### Example
+
+```ts
+const queryCache = queryClient.getQueryCache()
+
+const queries = queryCache.findAll({ queryKey: ['posts'] })
+```
+
+***
+
+### get()
+
+```ts
+get(queryHash: string):
+ | Query
+ | undefined;
+```
+
+Defined in: [packages/query-core/src/queryCache.ts:277](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L277)
+
+Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none
+exists. Unlike [QueryCache#find](#find), this looks up by the already-computed hash rather
+than by `QueryFilters`. Used by plugins (e.g. broadcast/hydration) that already have a hash
+to look up directly.
+
+#### Type Parameters
+
+##### TQueryFnData
+
+`TQueryFnData` = `unknown`
+
+##### TError
+
+`TError` = `Error`
+
+##### TData
+
+`TData` = `TQueryFnData`
+
+##### TQueryKey
+
+`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+#### Parameters
+
+##### queryHash
+
+`string`
+
+The hash of the query to look up.
+
+#### Returns
+
+ \| [`Query`](Query.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\>
+ \| `undefined`
+
+The query stored under the hash, or `undefined`.
+
+#### Example
+
+```ts
+const queryCache = queryClient.getQueryCache()
+const queryHash = hashKey(['posts'])
+
+const query = queryCache.get(queryHash)
+```
+
+***
+
+### getAll()
+
+```ts
+getAll(): Query[];
+```
+
+Defined in: [packages/query-core/src/queryCache.ts:300](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L300)
+
+Returns all queries within the cache.
+
+#### Returns
+
+[`Query`](Query.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[]\>[]
+
+Every query in the cache.
+
+#### Example
+
+```ts
+const queryCache = queryClient.getQueryCache()
+
+const queries = queryCache.getAll()
+```
+
+***
+
+### hasListeners()
+
+```ts
+hasListeners(): boolean;
+```
+
+Defined in: [packages/query-core/src/subscribable.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L43)
+
+Returns `true` while at least one listener is registered, `false` once they have all unsubscribed.
+
+#### Returns
+
+`boolean`
+
+`true` if at least one listener is registered.
+
+#### Inherited from
+
+```ts
+Subscribable.hasListeners
+```
+
+***
+
+### remove()
+
+```ts
+remove(query: Query): void;
+```
+
+Defined in: [packages/query-core/src/queryCache.ts:235](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryCache.ts#L235)
+
+Destroys the given `Query` and removes it from the cache, notifying subscribers with a
+`'removed'` event. A no-op if the query is no longer the one currently stored under its hash
+(e.g. it was already replaced). Used by plugins (e.g. the broadcast client) that mirror
+removals across `QueryCache` instances.
+
+#### Parameters
+
+##### query
+
+[`Query`](Query.md)\<`any`, `any`, `any`, `any`\>
+
+The query to remove.
+
+#### Returns
+
+`void`
+
+#### Example
+
+```ts
+const queryCache = queryClient.getQueryCache()
+const query = queryCache.find({ queryKey: ['posts'] })
+
+if (query) {
+ queryCache.remove(query)
+}
+```
+
+***
+
+### subscribe()
+
+```ts
+subscribe(listener: QueryCacheListener): () => void;
+```
+
+Defined in: [packages/query-core/src/subscribable.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L28)
+
+Registers a listener to be called on every update this object notifies about. Returns a function
+that removes the listener again โ call it to stop listening. The base class never drops a listener
+on its own, though some subclasses clear all of theirs in `destroy()`.
+
+#### Parameters
+
+##### listener
+
+`QueryCacheListener`
+
+Called on each update, with whatever the subclass passes to its subscribers.
+
+#### Returns
+
+A function that removes the listener.
+
+() => `void`
+
+#### Example
+
+```ts
+const unsubscribe = subscribable.subscribe(() => {
+ // react to the update
+})
+
+unsubscribe()
+```
+
+#### Inherited from
+
+```ts
+Subscribable.subscribe
+```
diff --git a/docs/framework/angular/reference/classes/QueryClient.md b/docs/framework/angular/reference/classes/QueryClient.md
new file mode 100644
index 00000000000..eb1c6a65693
--- /dev/null
+++ b/docs/framework/angular/reference/classes/QueryClient.md
@@ -0,0 +1,1648 @@
+---
+id: QueryClient
+title: QueryClient
+---
+
+
+
+Defined in: [packages/query-core/src/queryClient.ts:78](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L78)
+
+`QueryClient` is used to interact with a cache of queries and mutations. It owns a
+`QueryCache` and a `MutationCache` (creating default ones if none are passed in) and holds
+the default options that are applied to queries and mutations created through it.
+
+## Example
+
+```ts
+const queryClient = new QueryClient({
+ defaultOptions: {
+ queries: {
+ staleTime: Infinity,
+ },
+ },
+})
+
+await queryClient.query({ queryKey: ['posts'], queryFn: fetchPosts })
+```
+
+## Constructors
+
+### Constructor
+
+```ts
+new QueryClient(config?: QueryClientConfig): QueryClient;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:88](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L88)
+
+#### Parameters
+
+##### config?
+
+[`QueryClientConfig`](../interfaces/QueryClientConfig.md) = `{}`
+
+#### Returns
+
+`QueryClient`
+
+## Methods
+
+### cancelQueries()
+
+```ts
+cancelQueries(filters?: QueryFilters, cancelOptions?: CancelOptions): Promise;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:462](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L462)
+
+Cancels outgoing fetches for queries matching the given filters. Most useful when performing
+optimistic updates, since any outgoing refetch that resolves afterwards would otherwise
+overwrite the optimistic update. By default (`revert: true`), a cancelled query's data is
+reverted to its state before the outgoing fetch started.
+
+The returned promise never rejects, even if individual cancellations fail.
+
+#### Type Parameters
+
+##### TTaggedQueryKey
+
+`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+#### Parameters
+
+##### filters?
+
+[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\>
+
+The filters that select which queries to cancel. Without filters, every query
+is cancelled.
+
+##### cancelOptions?
+
+[`CancelOptions`](../interfaces/CancelOptions.md) = `{}`
+
+Passed to each matched query's cancellation. `revert` defaults to
+`true`.
+
+#### Returns
+
+`Promise`\<`void`\>
+
+A promise that resolves once every cancellation has settled.
+
+#### Example
+
+```ts
+await queryClient.cancelQueries({ queryKey: ['posts'], exact: true })
+```
+
+***
+
+### clear()
+
+```ts
+clear(): void;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:1172](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1172)
+
+Clears both the query cache and the mutation cache this client is connected to.
+
+#### Returns
+
+`void`
+
+#### Example
+
+```ts
+import { QueryClient } from '@tanstack/query-core'
+
+const queryClient = new QueryClient()
+queryClient.clear()
+```
+
+***
+
+### defaultMutationOptions()
+
+```ts
+defaultMutationOptions>(options?: T): T;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:1147](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1147)
+
+The mutation counterpart of [QueryClient#defaultQueryOptions](#defaultqueryoptions). Called by framework
+adapters (e.g. inside `useMutation`) to merge the client's `defaultOptions.mutations`, then
+`queryClient.setMutationDefaults` for the given `mutationKey`, then the caller's options on
+top. A no-op if the options are already defaulted (`_defaulted: true`).
+
+#### Type Parameters
+
+##### T
+
+`T` *extends* [`MutationOptions`](../interfaces/MutationOptions.md)\<`any`, `any`, `any`, `any`\>
+
+#### Parameters
+
+##### options?
+
+`T`
+
+The mutation options passed by the caller.
+
+#### Returns
+
+`T`
+
+The defaulted options.
+
+***
+
+### defaultQueryOptions()
+
+```ts
+defaultQueryOptions(options:
+ | QueryObserverOptions
+| DefaultedQueryObserverOptions): DefaultedQueryObserverOptions;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:1058](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1058)
+
+Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the
+caller into their final, defaulted form: merging the client's own `defaultOptions.queries`,
+then `queryClient.setQueryDefaults` for the given `queryKey`, then the caller's options on
+top. A no-op if the options are already defaulted (`_defaulted: true`).
+
+#### Type Parameters
+
+##### TQueryFnData
+
+`TQueryFnData` = `unknown`
+
+##### TError
+
+`TError` = `Error`
+
+##### TData
+
+`TData` = `TQueryFnData`
+
+##### TQueryData
+
+`TQueryData` = `TQueryFnData`
+
+##### TQueryKey
+
+`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+##### TPageParam
+
+`TPageParam` = `never`
+
+#### Parameters
+
+##### options
+
+ \| [`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\>
+ \| [`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\>
+
+The query options passed by the caller.
+
+#### Returns
+
+[`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\>
+
+The defaulted options, with `queryHash` and dependent defaults (e.g.
+`refetchOnReconnect`) filled in.
+
+***
+
+### ~~ensureInfiniteQueryData()~~
+
+```ts
+ensureInfiniteQueryData(options: EnsureInfiniteQueryDataOptions): Promise>;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:813](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L813)
+
+Returns the cached data of an infinite query, or fetches it if there is none. With
+`revalidateIfStale`, stale cached data is also refetched in the background.
+
+#### Type Parameters
+
+##### TQueryFnData
+
+`TQueryFnData`
+
+##### TError
+
+`TError` = `Error`
+
+##### TData
+
+`TData` = `TQueryFnData`
+
+##### TQueryKey
+
+`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+##### TPageParam
+
+`TPageParam` = `unknown`
+
+#### Parameters
+
+##### options
+
+[`EnsureInfiniteQueryDataOptions`](../type-aliases/EnsureInfiniteQueryDataOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
+
+The infinite query options. If the query has no cached data yet, it is fetched
+with these options.
+
+#### Returns
+
+`Promise`\<[`InfiniteData`](../interfaces/InfiniteData.md)\<`TData`, `TPageParam`\>\>
+
+A promise that resolves to the cached [InfiniteData](../interfaces/InfiniteData.md), or to the fetched data if
+nothing was cached yet.
+
+#### Deprecated
+
+Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version.
+
+***
+
+### ~~ensureQueryData()~~
+
+```ts
+ensureQueryData(options: EnsureQueryDataOptions): Promise;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:208](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L208)
+
+Returns the cached data of a query, or fetches it if there is none. With `revalidateIfStale`,
+stale cached data is also refetched in the background.
+
+#### Type Parameters
+
+##### TQueryFnData
+
+`TQueryFnData`
+
+##### TError
+
+`TError` = `Error`
+
+##### TData
+
+`TData` = `TQueryFnData`
+
+##### TQueryKey
+
+`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+#### Parameters
+
+##### options
+
+[`EnsureQueryDataOptions`](../interfaces/EnsureQueryDataOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\>
+
+The query options. If the query has no cached data yet, it is fetched with
+these options.
+
+#### Returns
+
+`Promise`\<`TData`\>
+
+A promise that resolves to the cached data, or to the fetched data if nothing was
+cached yet.
+
+#### Deprecated
+
+Use queryClient.query({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version.
+
+***
+
+### ~~fetchInfiniteQuery()~~
+
+```ts
+fetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise>;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:757](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L757)
+
+Fetches and caches an infinite query, or returns its cached data if it isn't stale.
+
+#### Type Parameters
+
+##### TQueryFnData
+
+`TQueryFnData`
+
+##### TError
+
+`TError` = `Error`
+
+##### TData
+
+`TData` = `TQueryFnData`
+
+##### TQueryKey
+
+`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+##### TPageParam
+
+`TPageParam` = `unknown`
+
+#### Parameters
+
+##### options
+
+[`FetchInfiniteQueryOptions`](../type-aliases/FetchInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
+
+The infinite query options, including the `queryKey`, the `queryFn`, and the
+`initialPageParam`.
+
+#### Returns
+
+`Promise`\<[`InfiniteData`](../interfaces/InfiniteData.md)\<`TData`, `TPageParam`\>\>
+
+A promise that resolves to the cached or fetched [InfiniteData](../interfaces/InfiniteData.md), or rejects with
+the fetch error.
+
+#### Deprecated
+
+Use queryClient.infiniteQuery(options) instead. This method will be removed in the next major version.
+
+***
+
+### ~~fetchQuery()~~
+
+```ts
+fetchQuery(options: FetchQueryOptions): Promise;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:651](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L651)
+
+Fetches and caches a query, or returns its cached data if it isn't stale. Unlike in observers,
+the fetch isn't retried unless `retry` is set.
+
+#### Type Parameters
+
+##### TQueryFnData
+
+`TQueryFnData`
+
+##### TError
+
+`TError` = `Error`
+
+##### TData
+
+`TData` = `TQueryFnData`
+
+##### TQueryKey
+
+`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+##### TPageParam
+
+`TPageParam` = `never`
+
+#### Parameters
+
+##### options
+
+[`FetchQueryOptions`](../interfaces/FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
+
+The query options, including the `queryKey` and the `queryFn` used if the
+query needs to fetch.
+
+#### Returns
+
+`Promise`\<`TData`\>
+
+A promise that resolves to the cached or fetched data, or rejects with the fetch
+error.
+
+#### Deprecated
+
+Use queryClient.query(options) instead. This method will be removed in the next major version.
+
+***
+
+### getDefaultOptions()
+
+```ts
+getDefaultOptions(): DefaultOptions;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:897](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L897)
+
+Returns the default options that were set when creating the client, or via
+[QueryClient#setDefaultOptions](#setdefaultoptions).
+
+#### Returns
+
+[`DefaultOptions`](../interfaces/DefaultOptions.md)
+
+The client's current default options.
+
+#### Example
+
+```ts
+import { QueryClient } from '@tanstack/query-core'
+
+const queryClient = new QueryClient()
+const defaultOptions = queryClient.getDefaultOptions()
+```
+
+***
+
+### getMutationCache()
+
+```ts
+getMutationCache(): MutationCache;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:881](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L881)
+
+Returns the mutation cache this client is connected to.
+
+#### Returns
+
+[`MutationCache`](MutationCache.md)
+
+The [MutationCache](MutationCache.md) instance.
+
+#### Example
+
+```ts
+import { QueryClient } from '@tanstack/query-core'
+
+const queryClient = new QueryClient()
+const mutationCache = queryClient.getMutationCache()
+const mutations = mutationCache.findAll({ status: 'pending' })
+```
+
+***
+
+### getMutationDefaults()
+
+```ts
+getMutationDefaults(mutationKey: readonly unknown[]): OmitKeyof, "mutationKey">;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:1030](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1030)
+
+Returns the default options registered for mutations whose mutation key partially matches
+the given `mutationKey`, via [QueryClient#setMutationDefaults](#setmutationdefaults). If multiple registered
+defaults match, they are merged together in registration order.
+
+#### Parameters
+
+##### mutationKey
+
+readonly `unknown`[]
+
+The mutation key to look up registered defaults for.
+
+#### Returns
+
+[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`any`, `any`, `any`, `any`\>, `"mutationKey"`\>
+
+The merged default options of every registration that matches, or an empty object if
+none match.
+
+#### Example
+
+```ts
+const defaultOptions = queryClient.getMutationDefaults(['addPost'])
+```
+
+***
+
+### getQueriesData()
+
+```ts
+getQueriesData = QueryFilters>(filters: TQueryFilters): [readonly unknown[], TQueryFnData | undefined][];
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:254](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L254)
+
+Imperative (non-reactive) way to retrieve the cached data of multiple queries at once.
+Only queries matching the given filters are returned; if none match, an empty array is
+returned.
+
+Because the matched queries can hold data of different shapes (e.g. a broad filter can match
+queries with unrelated data types), the `TQueryFnData` generic defaults to `unknown` rather
+than being inferred. Passing a more specific type is a convenience for call sites that know
+every matched query holds the same shape โ it is not checked against the actual cache
+contents.
+
+#### Type Parameters
+
+##### TQueryFnData
+
+`TQueryFnData` = `unknown`
+
+##### TQueryFilters
+
+`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\
+
+#### Parameters
+
+##### filters
+
+`TQueryFilters`
+
+The filters that select which queries to read.
+
+#### Returns
+
+\[readonly `unknown`[], `TQueryFnData` \| `undefined`\][]
+
+An array of query key and data pairs. The data is `undefined` for a query with no cached data.
+
+#### See
+
+[QueryClient#getQueryData](#getquerydata)
+
+#### Example
+
+```ts
+const data = queryClient.getQueriesData({ queryKey: ['posts'] })
+```
+
+***
+
+### getQueryCache()
+
+```ts
+getQueryCache(): QueryCache;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:865](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L865)
+
+Returns the query cache this client is connected to.
+
+#### Returns
+
+[`QueryCache`](QueryCache.md)
+
+The [QueryCache](QueryCache.md) instance.
+
+#### Example
+
+```ts
+import { QueryClient } from '@tanstack/query-core'
+
+const queryClient = new QueryClient()
+const queryCache = queryClient.getQueryCache()
+const queries = queryCache.findAll({ queryKey: ['posts'] })
+```
+
+***
+
+### getQueryData()
+
+```ts
+getQueryData>(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:188](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L188)
+
+Imperative (non-reactive) way to retrieve data for a QueryKey.
+Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
+
+Hint: Do not use this function inside a component, because it won't receive updates.
+Use `useQuery` to create a `QueryObserver` that subscribes to changes.
+
+#### Type Parameters
+
+##### TQueryFnData
+
+`TQueryFnData` = `unknown`
+
+##### TTaggedQueryKey
+
+`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+##### TInferredQueryFnData
+
+`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\>
+
+#### Parameters
+
+##### queryKey
+
+`TTaggedQueryKey`
+
+The query key of the query to read.
+
+#### Returns
+
+`TInferredQueryFnData` \| `undefined`
+
+The cached data for the query, or `undefined` if no query with this key has been observed yet.
+
+#### See
+
+[QueryClient#getQueriesData](#getqueriesdata)
+
+***
+
+### getQueryDefaults()
+
+```ts
+getQueryDefaults(queryKey: readonly unknown[]): OmitKeyof, "queryKey">;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:970](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L970)
+
+Returns the default options registered for queries whose query key partially matches the
+given `queryKey`, via [QueryClient#setQueryDefaults](#setquerydefaults). If multiple registered defaults
+match, they are merged together in registration order.
+
+#### Parameters
+
+##### queryKey
+
+readonly `unknown`[]
+
+The query key to look up registered defaults for.
+
+#### Returns
+
+[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`any`, `any`, `any`, `any`, `any`\>, `"queryKey"`\>
+
+The merged default options of every registration that matches, or an empty object if
+none match.
+
+#### Example
+
+```ts
+const defaultOptions = queryClient.getQueryDefaults(['posts'])
+```
+
+***
+
+### getQueryState()
+
+```ts
+getQueryState, TInferredError = InferErrorFromTag>(queryKey: TTaggedQueryKey):
+ | QueryState
+ | undefined;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:371](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L371)
+
+Imperative (non-reactive) way to retrieve an existing query's state. If the query does not
+exist, `undefined` is returned.
+
+#### Type Parameters
+
+##### TQueryFnData
+
+`TQueryFnData` = `unknown`
+
+##### TError
+
+`TError` = `Error`
+
+##### TTaggedQueryKey
+
+`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+##### TInferredQueryFnData
+
+`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\>
+
+##### TInferredError
+
+`TInferredError` = [`InferErrorFromTag`](../type-aliases/InferErrorFromTag.md)\<`TError`, `TTaggedQueryKey`\>
+
+#### Parameters
+
+##### queryKey
+
+`TTaggedQueryKey`
+
+The query key of the query to read.
+
+#### Returns
+
+ \| [`QueryState`](../interfaces/QueryState.md)\<`TInferredQueryFnData`, `TInferredError`\>
+ \| `undefined`
+
+The query's state, or `undefined` if no query with this key exists.
+
+#### Example
+
+```ts
+const state = queryClient.getQueryState(['posts'])
+console.log(state?.dataUpdatedAt)
+```
+
+***
+
+### infiniteQuery()
+
+```ts
+infiniteQuery, TQueryKey extends readonly unknown[] = readonly unknown[], TPageParam = unknown>(options: InfiniteQueryExecuteOptions): Promise[] ? InfiniteData : TData>;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:726](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L726)
+
+Asynchronous method to fetch and cache an infinite query, resolving with an
+[InfiniteData](../interfaces/InfiniteData.md) object or throwing with the error.
+
+Behaves like [QueryClient#query](#query), accepting the same options (minus
+`initialPageParam`), plus the required `initialPageParam`, and an optional `pages` /
+`getNextPageParam` pair used to refetch a fixed number of pages from the start.
+
+This method replaces the deprecated `fetchInfiniteQuery`, and โ combined with
+`{ staleTime: 'static' }` โ the deprecated `ensureInfiniteQueryData`.
+
+#### Type Parameters
+
+##### TQueryFnData
+
+`TQueryFnData`
+
+##### TError
+
+`TError` = `Error`
+
+##### TData
+
+`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>
+
+##### TQueryKey
+
+`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+##### TPageParam
+
+`TPageParam` = `unknown`
+
+#### Parameters
+
+##### options
+
+[`InfiniteQueryExecuteOptions`](../type-aliases/InfiniteQueryExecuteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
+
+The infinite query options, including the `queryKey`, the `queryFn`, and the
+`initialPageParam`.
+
+#### Returns
+
+`Promise`\<`TData`[] *extends* [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>[] ? [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\> : `TData`\>
+
+A promise that resolves to the [InfiniteData](../interfaces/InfiniteData.md), or to the result of `select` if
+provided. It rejects with the error from the fetch or from `select`.
+
+#### Example
+
+```ts
+try {
+ const data = await queryClient.infiniteQuery({ queryKey, queryFn, initialPageParam: 0 })
+ console.log(data.pages)
+} catch (error) {
+ console.log(error)
+}
+```
+
+***
+
+### invalidateQueries()
+
+```ts
+invalidateQueries(filters?: InvalidateQueryFilters, options?: InvalidateOptions): Promise;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:495](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L495)
+
+Marks queries matching the given filters as invalidated. Unlike
+[QueryClient#removeQueries](#removequeries), invalidated queries stay in the cache.
+
+Unless `filters.refetchType` is `'none'`, matching queries are then refetched via
+[QueryClient#refetchQueries](#refetchqueries), using `filters.refetchType` if set, otherwise
+`filters.type`, otherwise `'active'`.
+
+#### Type Parameters
+
+##### TTaggedQueryKey
+
+`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+#### Parameters
+
+##### filters?
+
+[`InvalidateQueryFilters`](../interfaces/InvalidateQueryFilters.md)\<`TTaggedQueryKey`\>
+
+The filters that select which queries to invalidate, plus `refetchType` to
+control which of them to refetch afterwards. Without filters, every query is invalidated.
+
+##### options?
+
+[`InvalidateOptions`](../interfaces/InvalidateOptions.md) = `{}`
+
+Passed to [QueryClient#refetchQueries](#refetchqueries), e.g. `cancelRefetch` and
+`throwOnError`.
+
+#### Returns
+
+`Promise`\<`void`\>
+
+A promise that resolves once the refetch settles, or immediately if `refetchType` is
+`'none'`.
+
+#### Example
+
+```ts
+await queryClient.invalidateQueries({ queryKey: ['posts'], refetchType: 'active' })
+```
+
+***
+
+### isFetching()
+
+```ts
+isFetching(filters?: Omit, "fetchStatus">): number;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:151](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L151)
+
+Returns the number of queries in the cache that are currently fetching, optionally
+matching a set of filters. This includes background-fetching, loading new pages, and
+loading more infinite query results.
+
+#### Parameters
+
+##### filters?
+
+`Omit`\<[`QueryFilters`](../interfaces/QueryFilters.md)\, `"fetchStatus"`\>
+
+Narrows down which fetching queries are counted. Without filters, every
+fetching query is counted.
+
+#### Returns
+
+`number`
+
+The number of matching queries whose `fetchStatus` is `'fetching'`.
+
+#### Example
+
+```ts
+if (queryClient.isFetching()) {
+ console.log('At least one query is fetching!')
+}
+```
+
+***
+
+### isMutating()
+
+```ts
+isMutating = MutationFilters>(filters?: NoInfer>): number;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:169](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L169)
+
+Returns the number of mutations in the cache that are currently pending, optionally
+matching a set of filters.
+
+#### Type Parameters
+
+##### TMutationFilters
+
+`TMutationFilters` *extends* [`MutationFilters`](../interfaces/MutationFilters.md)\<`any`, `any`, `unknown`, `unknown`\> = [`MutationFilters`](../interfaces/MutationFilters.md)\<`any`, `any`, `unknown`, `unknown`\>
+
+#### Parameters
+
+##### filters?
+
+`NoInfer`\<`Omit`\<`TMutationFilters`, `"status"`\>\>
+
+Narrows down which pending mutations are counted. Without filters, every
+pending mutation is counted.
+
+#### Returns
+
+`number`
+
+The number of matching mutations whose `status` is `'pending'`.
+
+#### Example
+
+```ts
+if (queryClient.isMutating()) {
+ console.log('At least one mutation is pending!')
+}
+```
+
+***
+
+### mount()
+
+```ts
+mount(): void;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:103](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L103)
+
+Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start
+listening for focus/online events and resume paused mutations. Ref-counted via an internal
+mount count, so nested or multiple providers sharing the same `QueryClient` don't tear down
+the shared listeners until the last one unmounts.
+
+#### Returns
+
+`void`
+
+***
+
+### ~~prefetchInfiniteQuery()~~
+
+```ts
+prefetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:785](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L785)
+
+Fetches and caches an infinite query like [QueryClient#fetchInfiniteQuery](#fetchinfinitequery), but ignores
+the result and any error.
+
+#### Type Parameters
+
+##### TQueryFnData
+
+`TQueryFnData`
+
+##### TError
+
+`TError` = `Error`
+
+##### TData
+
+`TData` = `TQueryFnData`
+
+##### TQueryKey
+
+`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+##### TPageParam
+
+`TPageParam` = `unknown`
+
+#### Parameters
+
+##### options
+
+[`FetchInfiniteQueryOptions`](../type-aliases/FetchInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
+
+The infinite query options, including the `queryKey`, the `queryFn`, and the
+`initialPageParam`.
+
+#### Returns
+
+`Promise`\<`void`\>
+
+A promise that resolves once the fetch settles. It never rejects.
+
+#### Deprecated
+
+Use queryClient.infiniteQuery(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version.
+
+***
+
+### ~~prefetchQuery()~~
+
+```ts
+prefetchQuery(options: FetchQueryOptions): Promise;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:690](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L690)
+
+Fetches and caches a query like [QueryClient#fetchQuery](#fetchquery), but ignores the result and any
+error.
+
+#### Type Parameters
+
+##### TQueryFnData
+
+`TQueryFnData` = `unknown`
+
+##### TError
+
+`TError` = `Error`
+
+##### TData
+
+`TData` = `TQueryFnData`
+
+##### TQueryKey
+
+`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+#### Parameters
+
+##### options
+
+[`FetchQueryOptions`](../interfaces/FetchQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`\>
+
+The query options, including the `queryKey` and the `queryFn` used if the
+query needs to fetch.
+
+#### Returns
+
+`Promise`\<`void`\>
+
+A promise that resolves once the fetch settles. It never rejects.
+
+#### Deprecated
+
+Use queryClient.query(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version.
+
+***
+
+### query()
+
+```ts
+query(options: QueryExecuteOptions): Promise;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:599](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L599)
+
+Asynchronous method to fetch and cache a query, resolving with the data or throwing with
+the error.
+
+If the query already exists in the cache and its data is not stale (per the given
+`staleTime`), the cached data is returned without fetching. Otherwise, the query is fetched
+and the promise resolves once the fetch settles. If a `select` function is provided, it is
+applied to the data in both cases (cached or freshly fetched) before it is returned.
+
+Unlike a reactive observer, retries are disabled by default here (`retry: false`) unless
+explicitly configured, since there is no component to catch a thrown error and retry through
+re-render.
+
+The accepted options are `QueryObserverOptions` minus the fields that only make sense for a
+reactive observer โ `enabled`, `refetchInterval`, `refetchIntervalInBackground`,
+`refetchOnWindowFocus`, `refetchOnReconnect`, `refetchOnMount`, `retryOnMount`,
+`notifyOnChangeProps`, `throwOnError`, `suspense`, and `placeholderData` are not part of this
+method's options.
+
+This method replaces the deprecated `fetchQuery`, and โ combined with
+`{ staleTime: 'static' }` โ the deprecated `ensureQueryData`.
+
+#### Type Parameters
+
+##### TQueryFnData
+
+`TQueryFnData`
+
+##### TError
+
+`TError` = `Error`
+
+##### TData
+
+`TData` = `TQueryFnData`
+
+##### TQueryData
+
+`TQueryData` = `TQueryFnData`
+
+##### TQueryKey
+
+`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+##### TPageParam
+
+`TPageParam` = `never`
+
+#### Parameters
+
+##### options
+
+[`QueryExecuteOptions`](../interfaces/QueryExecuteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`, `TPageParam`\>
+
+The query options, including the `queryKey` and the `queryFn` used if the
+query needs to fetch.
+
+#### Returns
+
+`Promise`\<`TData`\>
+
+A promise that resolves to the data, or to the result of `select` if provided. It
+rejects with the error from the fetch or from `select`.
+
+#### Example
+
+```ts
+try {
+ const data = await queryClient.query({ queryKey, queryFn, staleTime: 10000 })
+} catch (error) {
+ console.log(error)
+}
+```
+
+***
+
+### refetchQueries()
+
+```ts
+refetchQueries(filters?: RefetchQueryFilters, options?: RefetchOptions): Promise;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:540](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L540)
+
+Refetches queries matching the given filters, regardless of whether they are stale. Without
+filters, every query in the cache is refetched. Queries that are disabled, or static (only
+have observers with a static `staleTime`), are never refetched.
+
+By default (`cancelRefetch: true`), a currently running fetch is cancelled before the new
+one starts. The returned promise does not reject on individual query failures unless
+`throwOnError` is `true`.
+
+Initially paused fetches do not delay the returned promise. Their later errors are handled
+even when `throwOnError` is `true`.
+
+#### Type Parameters
+
+##### TTaggedQueryKey
+
+`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+#### Parameters
+
+##### filters?
+
+[`RefetchQueryFilters`](../interfaces/RefetchQueryFilters.md)\<`TTaggedQueryKey`\>
+
+The filters that select which queries to refetch. Without filters, every query
+in the cache is included.
+
+##### options?
+
+[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}`
+
+Set `cancelRefetch` to `false` to keep a running fetch instead of cancelling
+it, and `throwOnError` to `true` to reject when a refetch that was not initially paused fails.
+
+#### Returns
+
+`Promise`\<`void`\>
+
+A promise that resolves once all matching refetches that were not initially paused
+have settled.
+
+#### Example
+
+```ts
+// refetch all active queries partially matching a query key:
+await queryClient.refetchQueries({ queryKey: ['posts'], type: 'active' })
+```
+
+***
+
+### removeQueries()
+
+```ts
+removeQueries(filters?: QueryFilters): void;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:398](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L398)
+
+Removes queries from the cache that match the given filters. Unlike
+[QueryClient#invalidateQueries](#invalidatequeries) or [QueryClient#refetchQueries](#refetchqueries), this removes
+matching queries from the cache instead of refetching them. Without filters, every query in
+the cache is removed.
+
+#### Type Parameters
+
+##### TTaggedQueryKey
+
+`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+#### Parameters
+
+##### filters?
+
+[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\>
+
+The filters that select which queries to remove. Without filters, every query
+is removed.
+
+#### Returns
+
+`void`
+
+#### Example
+
+```ts
+queryClient.removeQueries({ queryKey: ['posts'], exact: true })
+```
+
+***
+
+### resetQueries()
+
+```ts
+resetQueries(filters?: QueryFilters, options?: ResetOptions): Promise;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:423](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L423)
+
+Resets queries matching the given filters back to their initial state (e.g. any
+`initialData`), notifying subscribers rather than removing them. Active queries among the
+matched set are then refetched, and the returned promise resolves once that refetch settles.
+
+#### Type Parameters
+
+##### TTaggedQueryKey
+
+`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+#### Parameters
+
+##### filters?
+
+[`QueryFilters`](../interfaces/QueryFilters.md)\<`TTaggedQueryKey`\>
+
+The filters that select which queries to reset. Without filters, every query
+is reset.
+
+##### options?
+
+[`ResetOptions`](../interfaces/ResetOptions.md)
+
+Passed to the refetch of the active matched queries, e.g. `cancelRefetch` and
+`throwOnError`.
+
+#### Returns
+
+`Promise`\<`void`\>
+
+A promise that resolves once the refetch of the active matched queries settles.
+
+#### Example
+
+```ts
+await queryClient.resetQueries({ queryKey: ['posts'], exact: true })
+```
+
+***
+
+### resumePausedMutations()
+
+```ts
+resumePausedMutations(): Promise;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:846](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L846)
+
+Resumes mutations that were paused because there was no network connection. Does nothing
+(resolving immediately) if the client is currently offline.
+
+#### Returns
+
+`Promise`\<`unknown`\>
+
+A promise that resolves once the resumed mutations have settled.
+
+#### Example
+
+```ts
+import { QueryClient } from '@tanstack/query-core'
+
+const queryClient = new QueryClient()
+await queryClient.resumePausedMutations()
+```
+
+***
+
+### setDefaultOptions()
+
+```ts
+setDefaultOptions(options: DefaultOptions): void;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:918](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L918)
+
+Dynamically sets the default options for this client, overwriting any previously defined
+default options.
+
+#### Parameters
+
+##### options
+
+[`DefaultOptions`](../interfaces/DefaultOptions.md)
+
+The new default options for queries and mutations.
+
+#### Returns
+
+`void`
+
+#### See
+
+[QueryClient#getDefaultOptions](#getdefaultoptions)
+
+#### Example
+
+```ts
+import { QueryClient } from '@tanstack/query-core'
+
+const queryClient = new QueryClient()
+queryClient.setDefaultOptions({
+ queries: {
+ staleTime: Infinity,
+ },
+})
+```
+
+***
+
+### setMutationDefaults()
+
+```ts
+setMutationDefaults(mutationKey: readonly unknown[], options: OmitKeyof, "mutationKey">): void;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:1000](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L1000)
+
+Sets default options for mutations whose mutation key partially matches the given
+`mutationKey`. As with [QueryClient#setQueryDefaults](#setquerydefaults), the order of registration
+matters when several registered defaults match the same mutation key.
+
+#### Type Parameters
+
+##### TData
+
+`TData` = `unknown`
+
+##### TError
+
+`TError` = `Error`
+
+##### TVariables
+
+`TVariables` = `void`
+
+##### TOnMutateResult
+
+`TOnMutateResult` = `unknown`
+
+#### Parameters
+
+##### mutationKey
+
+readonly `unknown`[]
+
+The mutation key that mutation keys are partially matched against.
+
+##### options
+
+[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`MutationObserverOptions`](../interfaces/MutationObserverOptions.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>, `"mutationKey"`\>
+
+The default options applied to matching mutations.
+
+#### Returns
+
+`void`
+
+#### See
+
+[QueryClient#getMutationDefaults](#getmutationdefaults)
+
+#### Example
+
+```ts
+queryClient.setMutationDefaults(['addPost'], { mutationFn: addPost })
+```
+
+***
+
+### setQueriesData()
+
+```ts
+setQueriesData = QueryFilters>(
+ filters: TQueryFilters,
+ updater: Updater | undefined, NoInfer | undefined>,
+ options?: SetDataOptions
+): [readonly unknown[], TQueryFnData | undefined][];
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:339](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L339)
+
+Synchronous way to immediately update the cached data of multiple queries at once, using
+filters or partial query key matching. Only queries that already exist and match the given
+filters are updated; no new cache entries are created. Internally this calls
+[QueryClient#setQueryData](#setquerydata) for each matching query.
+
+#### Type Parameters
+
+##### TQueryFnData
+
+`TQueryFnData`
+
+##### TQueryFilters
+
+`TQueryFilters` *extends* [`QueryFilters`](../interfaces/QueryFilters.md)\<`any`\> = [`QueryFilters`](../interfaces/QueryFilters.md)\
+
+#### Parameters
+
+##### filters
+
+`TQueryFilters`
+
+The filters that select which existing queries to update.
+
+##### updater
+
+[`Updater`](../type-aliases/Updater.md)\<`NoInfer`\<`TQueryFnData`\> \| `undefined`, `NoInfer`\<`TQueryFnData`\> \| `undefined`\>
+
+Either the new data, or a function that receives each matched query's current
+data (which may be `undefined`) and returns the new data.
+
+##### options?
+
+[`SetDataOptions`](../interfaces/SetDataOptions.md)
+
+Set `updatedAt` to override the timestamp the written data is recorded with.
+
+#### Returns
+
+\[readonly `unknown`[], `TQueryFnData` \| `undefined`\][]
+
+One `[queryKey, data]` tuple per matched query, in the same shape and with the same
+`undefined` case as [QueryClient#setQueryData](#setquerydata).
+
+#### Example
+
+```ts
+queryClient.setQueriesData({ queryKey: ['posts'] }, (oldPosts) =>
+ oldPosts ? oldPosts.filter((post) => post.id !== deletedId) : oldPosts,
+)
+```
+
+***
+
+### setQueryData()
+
+```ts
+setQueryData>(
+ queryKey: TTaggedQueryKey,
+ updater: Updater<
+ | InferDataFromTag, TTaggedQueryKey>
+ | undefined, NoInfer | undefined>,
+ options?: SetDataOptions
+): NoInfer | undefined;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:286](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L286)
+
+Synchronous way to immediately update a query's cached data. If the updater (or the value
+passed) resolves to `undefined`, the cache is left untouched and no query is created;
+otherwise, if the query does not exist yet, it will be created. To update multiple queries
+at once by partially matching query keys, use [QueryClient#setQueriesData](#setqueriesdata) instead.
+
+Updates must be performed immutably: do not mutate `oldData`, or data previously retrieved
+via [QueryClient#getQueryData](#getquerydata), in place.
+
+#### Type Parameters
+
+##### TQueryFnData
+
+`TQueryFnData` = `unknown`
+
+##### TTaggedQueryKey
+
+`TTaggedQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+##### TInferredQueryFnData
+
+`TInferredQueryFnData` = [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`TQueryFnData`, `TTaggedQueryKey`\>
+
+#### Parameters
+
+##### queryKey
+
+`TTaggedQueryKey`
+
+The query key to set data for.
+
+##### updater
+
+[`Updater`](../type-aliases/Updater.md)\<
+ \| [`InferDataFromTag`](../type-aliases/InferDataFromTag.md)\<`NoInfer`\<`TQueryFnData`\>, `TTaggedQueryKey`\>
+ \| `undefined`, `NoInfer`\<`TInferredQueryFnData`\> \| `undefined`\>
+
+Either the new data, or a function that receives the current data (which
+may be `undefined`) and returns the new data.
+
+##### options?
+
+[`SetDataOptions`](../interfaces/SetDataOptions.md)
+
+Set `updatedAt` to override the timestamp the written data is recorded with.
+
+#### Returns
+
+`NoInfer`\<`TInferredQueryFnData`\> \| `undefined`
+
+The data that was written, or `undefined` if the updater returned `undefined` โ in that case
+the write is skipped and the cache is left unchanged.
+
+#### Example
+
+```ts
+queryClient.setQueryData(['posts'], newPosts)
+
+// Or, using an updater function that receives the current data:
+queryClient.setQueryData(['posts'], (oldPosts) => [...oldPosts, newPost])
+```
+
+***
+
+### setQueryDefaults()
+
+```ts
+setQueryDefaults(queryKey: readonly unknown[], options: Partial, "queryKey">>): void;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:938](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L938)
+
+Sets default options for queries whose query key partially matches the given `queryKey`.
+
+If several registered query defaults match a given query key, they are merged together in
+registration order by [QueryClient#getQueryDefaults](#getquerydefaults), so register defaults from the
+most generic key to the least generic one โ more specific defaults should be registered
+after more generic ones so they take precedence.
+
+#### Type Parameters
+
+##### TQueryFnData
+
+`TQueryFnData` = `unknown`
+
+##### TError
+
+`TError` = `Error`
+
+##### TData
+
+`TData` = `TQueryFnData`
+
+##### TQueryData
+
+`TQueryData` = `TQueryFnData`
+
+#### Parameters
+
+##### queryKey
+
+readonly `unknown`[]
+
+The query key that query keys are partially matched against.
+
+##### options
+
+`Partial`\<[`OmitKeyof`](../type-aliases/OmitKeyof.md)\<[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`\>, `"queryKey"`\>\>
+
+The default options applied to matching queries.
+
+#### Returns
+
+`void`
+
+#### Example
+
+```ts
+queryClient.setQueryDefaults(['posts'], { queryFn: fetchPosts })
+
+await queryClient.query({ queryKey: ['posts'] })
+```
+
+***
+
+### unmount()
+
+```ts
+unmount(): void;
+```
+
+Defined in: [packages/query-core/src/queryClient.ts:126](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryClient.ts#L126)
+
+The inverse of [QueryClient#mount](#mount) โ called by a framework adapter's
+`QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online
+listeners once the mount count returns to `0`.
+
+#### Returns
+
+`void`
diff --git a/docs/framework/angular/reference/classes/QueryObserver.md b/docs/framework/angular/reference/classes/QueryObserver.md
new file mode 100644
index 00000000000..22fb88d6d71
--- /dev/null
+++ b/docs/framework/angular/reference/classes/QueryObserver.md
@@ -0,0 +1,593 @@
+---
+id: QueryObserver
+title: QueryObserver
+---
+
+
+
+Defined in: [packages/query-core/src/queryObserver.ts:56](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L56)
+
+A `QueryObserver` watches a single query in the `QueryCache` and computes a
+`QueryObserverResult` from its state, recomputing and notifying subscribers
+whenever the underlying query (or the observer's options) changes. It is
+the primitive that framework adapters (e.g. `useQuery`) build their hooks
+on top of, but it can also be used directly to observe and switch between
+queries outside of any framework.
+
+## Example
+
+```ts
+const observer = new QueryObserver(queryClient, {
+ queryKey: ['posts'],
+ queryFn: fetchPosts,
+})
+
+const unsubscribe = observer.subscribe((result) => {
+ console.log(result.data)
+})
+```
+
+## Extends
+
+- `Subscribable`\<`QueryObserverListener`\<`TData`, `TError`\>\>
+
+## Extended by
+
+- [`InfiniteQueryObserver`](InfiniteQueryObserver.md)
+
+## Type Parameters
+
+### TQueryFnData
+
+`TQueryFnData` = `unknown`
+
+### TError
+
+`TError` = [`DefaultError`](../type-aliases/DefaultError.md)
+
+### TData
+
+`TData` = `TQueryFnData`
+
+### TQueryData
+
+`TQueryData` = `TQueryFnData`
+
+### TQueryKey
+
+`TQueryKey` *extends* [`QueryKey`](../type-aliases/QueryKey.md) = [`QueryKey`](../type-aliases/QueryKey.md)
+
+## Constructors
+
+### Constructor
+
+```ts
+new QueryObserver(client: QueryClient, options: QueryObserverOptions): QueryObserver;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:86](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L86)
+
+#### Parameters
+
+##### client
+
+[`QueryClient`](QueryClient.md)
+
+##### options
+
+[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\>
+
+#### Returns
+
+`QueryObserver`\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\>
+
+#### Overrides
+
+```ts
+Subscribable>.constructor
+```
+
+## Properties
+
+### options
+
+```ts
+options: QueryObserverOptions;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:88](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L88)
+
+## Methods
+
+### destroy()
+
+```ts
+destroy(): void;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:166](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L166)
+
+Stops observing the current query: clears all listeners, cancels the
+stale and refetch-interval timers, and removes this observer from the
+query it was observing.
+
+#### Returns
+
+`void`
+
+***
+
+### fetchOptimistic()
+
+```ts
+fetchOptimistic(options: QueryObserverOptions): Promise>;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:412](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L412)
+
+Fetches a query defined by the given options without affecting this
+observer's own tracked query or result, and returns a promise that
+resolves with the `QueryObserverResult` for that fetch. This is useful
+for prefetching data that another observer (e.g. a query about to be
+navigated to) will need, ahead of time.
+
+#### Parameters
+
+##### options
+
+[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\>
+
+The observer options of the query to fetch.
+
+#### Returns
+
+`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\>
+
+A promise that resolves with the result for the fetched query.
+
+#### Example
+
+```ts
+const result = await observer.fetchOptimistic({
+ queryKey: ['posts', 2],
+ queryFn: () => fetchPost(2),
+})
+console.log(result.data)
+```
+
+***
+
+### getCurrentQuery()
+
+```ts
+getCurrentQuery(): Query;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:371](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L371)
+
+Returns the `Query` instance this observer is currently observing.
+
+#### Returns
+
+[`Query`](Query.md)\<`TQueryFnData`, `TError`, `TQueryData`, `TQueryKey`\>
+
+The observed query.
+
+***
+
+### getCurrentResult()
+
+```ts
+getCurrentResult(): QueryObserverResult;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:330](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L330)
+
+Returns the most recently computed `QueryObserverResult` for the
+observed query. This is a point-in-time read; to be notified of updates
+as they happen, subscribe to the observer instead (its inherited
+`subscribe` method).
+
+#### Returns
+
+[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>
+
+The observer's latest result.
+
+#### Example
+
+```ts
+const result = observer.getCurrentResult()
+console.log(result.status, result.data)
+```
+
+***
+
+### getOptimisticResult()
+
+```ts
+getOptimisticResult(options: DefaultedQueryObserverOptions): QueryObserverResult;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:281](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L281)
+
+Computes the result the observer would produce for the given (already-defaulted) options
+right now, building the underlying `Query` if it doesn't exist yet, without waiting for a
+subscription callback. Called by framework adapters on every render (e.g. `useQuery`) so the
+returned value is available synchronously, ahead of `setOptions` triggering an actual fetch.
+
+#### Parameters
+
+##### options
+
+[`DefaultedQueryObserverOptions`](../type-aliases/DefaultedQueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\>
+
+The defaulted observer options to compute the result for.
+
+#### Returns
+
+[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>
+
+The result for the given options.
+
+***
+
+### hasListeners()
+
+```ts
+hasListeners(): boolean;
+```
+
+Defined in: [packages/query-core/src/subscribable.ts:43](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L43)
+
+Returns `true` while at least one listener is registered, `false` once they have all unsubscribed.
+
+#### Returns
+
+`boolean`
+
+`true` if at least one listener is registered.
+
+#### Inherited from
+
+```ts
+Subscribable.hasListeners
+```
+
+***
+
+### refetch()
+
+```ts
+refetch(options?: RefetchOptions): Promise>;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:387](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L387)
+
+Refetches the observed query and returns a promise that resolves with
+the resulting `QueryObserverResult`.
+
+#### Parameters
+
+##### options?
+
+[`RefetchOptions`](../interfaces/RefetchOptions.md) = `{}`
+
+Set `cancelRefetch` to `false` to keep a running fetch instead of cancelling
+it, and `throwOnError` to `true` to reject when the refetch fails.
+
+#### Returns
+
+`Promise`\<[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>\>
+
+A promise that resolves with the result after the refetch.
+
+#### Example
+
+```ts
+const result = await observer.refetch({ cancelRefetch: false })
+console.log(result.data)
+```
+
+***
+
+### setOptions()
+
+```ts
+setOptions(options: QueryObserverOptions): void;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:189](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L189)
+
+Updates the observer's options. This will re-resolve the query being
+observed (switching to a different query if the `queryKey` changed),
+trigger a fetch if the new options require one and the observer has
+subscribers, recompute the current result, and reschedule the stale and
+refetch-interval timers as needed.
+
+#### Parameters
+
+##### options
+
+[`QueryObserverOptions`](../interfaces/QueryObserverOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryData`, `TQueryKey`\>
+
+The new observer options. They are defaulted with [QueryClient#defaultQueryOptions](QueryClient.md#defaultqueryoptions) before being applied.
+
+#### Returns
+
+`void`
+
+#### Throws
+
+If `enabled` is neither a boolean nor a function.
+
+#### Example
+
+```ts
+observer.setOptions({ queryKey: ['posts', 1], queryFn: () => fetchPost(1) })
+// later: switch to a different query, reusing the same observer
+observer.setOptions({ queryKey: ['posts', 2], queryFn: () => fetchPost(2) })
+```
+
+***
+
+### shouldFetchOnReconnect()
+
+```ts
+shouldFetchOnReconnect(): boolean;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:139](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L139)
+
+Returns whether the observed query is currently stale and configured
+(via the `refetchOnReconnect` option) to refetch when the network
+reconnects.
+
+#### Returns
+
+`boolean`
+
+`true` if the observer should refetch the query on reconnect.
+
+***
+
+### shouldFetchOnWindowFocus()
+
+```ts
+shouldFetchOnWindowFocus(): boolean;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:153](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L153)
+
+Returns whether the observed query is currently stale and configured
+(via the `refetchOnWindowFocus` option) to refetch when the window
+regains focus.
+
+#### Returns
+
+`boolean`
+
+`true` if the observer should refetch the query on window focus.
+
+***
+
+### subscribe()
+
+```ts
+subscribe(listener: QueryObserverListener): () => void;
+```
+
+Defined in: [packages/query-core/src/subscribable.ts:28](https://github.com/TanStack/query/blob/main/packages/query-core/src/subscribable.ts#L28)
+
+Registers a listener to be called on every update this object notifies about. Returns a function
+that removes the listener again โ call it to stop listening. The base class never drops a listener
+on its own, though some subclasses clear all of theirs in `destroy()`.
+
+#### Parameters
+
+##### listener
+
+`QueryObserverListener`
+
+Called on each update, with whatever the subclass passes to its subscribers.
+
+#### Returns
+
+A function that removes the listener.
+
+() => `void`
+
+#### Example
+
+```ts
+const unsubscribe = subscribable.subscribe(() => {
+ // react to the update
+})
+
+unsubscribe()
+```
+
+#### Inherited from
+
+```ts
+Subscribable.subscribe
+```
+
+***
+
+### trackProp()
+
+```ts
+trackProp(key:
+ | "error"
+ | "data"
+ | "isError"
+ | "isPending"
+ | "isLoading"
+ | "isLoadingError"
+ | "isRefetchError"
+ | "isSuccess"
+ | "isPlaceholderData"
+ | "status"
+ | "dataUpdatedAt"
+ | "errorUpdatedAt"
+ | "failureCount"
+ | "failureReason"
+ | "errorUpdateCount"
+ | "isFetched"
+ | "isFetchedAfterMount"
+ | "isFetching"
+ | "isInitialLoading"
+ | "isPaused"
+ | "isRefetching"
+ | "isStale"
+ | "isEnabled"
+ | "refetch"
+ | "fetchStatus"): void;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:363](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L363)
+
+Records that the given `QueryObserverResult` property was read, so a subsequent update only
+notifies this observer if a tracked property actually changed. Normally called indirectly via
+[QueryObserver#trackResult](#trackresult)'s proxy; exposed directly for adapters that track property
+access themselves (e.g. through their own reactivity system) instead of via the proxy.
+
+#### Parameters
+
+##### key
+
+ \| `"error"`
+ \| `"data"`
+ \| `"isError"`
+ \| `"isPending"`
+ \| `"isLoading"`
+ \| `"isLoadingError"`
+ \| `"isRefetchError"`
+ \| `"isSuccess"`
+ \| `"isPlaceholderData"`
+ \| `"status"`
+ \| `"dataUpdatedAt"`
+ \| `"errorUpdatedAt"`
+ \| `"failureCount"`
+ \| `"failureReason"`
+ \| `"errorUpdateCount"`
+ \| `"isFetched"`
+ \| `"isFetchedAfterMount"`
+ \| `"isFetching"`
+ \| `"isInitialLoading"`
+ \| `"isPaused"`
+ \| `"isRefetching"`
+ \| `"isStale"`
+ \| `"isEnabled"`
+ \| `"refetch"`
+ \| `"fetchStatus"`
+
+The name of the property that was read.
+
+#### Returns
+
+`void`
+
+***
+
+### trackResult()
+
+```ts
+trackResult(result: QueryObserverResult, onPropTracked?: (key:
+ | "error"
+ | "data"
+ | "isError"
+ | "isPending"
+ | "isLoading"
+ | "isLoadingError"
+ | "isRefetchError"
+ | "isSuccess"
+ | "isPlaceholderData"
+ | "status"
+ | "dataUpdatedAt"
+ | "errorUpdatedAt"
+ | "failureCount"
+ | "failureReason"
+ | "errorUpdateCount"
+ | "isFetched"
+ | "isFetchedAfterMount"
+ | "isFetching"
+ | "isInitialLoading"
+ | "isPaused"
+ | "isRefetching"
+ | "isStale"
+ | "isEnabled"
+ | "refetch"
+| "fetchStatus") => void): QueryObserverResult;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L343)
+
+Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via
+[QueryObserver#trackProp](#trackprop) (and an optional `onPropTracked` callback). Used by framework
+adapters when `notifyOnChangeProps` is not set, to implement its default "only re-render on
+properties you actually read" behavior.
+
+#### Parameters
+
+##### result
+
+[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>
+
+The result to wrap.
+
+##### onPropTracked?
+
+(`key`:
+ \| `"error"`
+ \| `"data"`
+ \| `"isError"`
+ \| `"isPending"`
+ \| `"isLoading"`
+ \| `"isLoadingError"`
+ \| `"isRefetchError"`
+ \| `"isSuccess"`
+ \| `"isPlaceholderData"`
+ \| `"status"`
+ \| `"dataUpdatedAt"`
+ \| `"errorUpdatedAt"`
+ \| `"failureCount"`
+ \| `"failureReason"`
+ \| `"errorUpdateCount"`
+ \| `"isFetched"`
+ \| `"isFetchedAfterMount"`
+ \| `"isFetching"`
+ \| `"isInitialLoading"`
+ \| `"isPaused"`
+ \| `"isRefetching"`
+ \| `"isStale"`
+ \| `"isEnabled"`
+ \| `"refetch"`
+ \| `"fetchStatus"`) => `void`
+
+Called with the name of each property that is read.
+
+#### Returns
+
+[`QueryObserverResult`](../type-aliases/QueryObserverResult.md)\<`TData`, `TError`\>
+
+A proxy of `result` that tracks property reads.
+
+***
+
+### updateResult()
+
+```ts
+updateResult(): void;
+```
+
+Defined in: [packages/query-core/src/queryObserver.ts:766](https://github.com/TanStack/query/blob/main/packages/query-core/src/queryObserver.ts#L766)
+
+Recomputes and stores the current result from the current query/options, notifying listeners
+if it changed. Framework adapters call this right after subscribing to make sure no query
+update was missed in the gap between creating the observer and subscribing to it.
+
+#### Returns
+
+`void`
diff --git a/docs/framework/angular/reference/functions/defaultShouldDehydrateMutation.md b/docs/framework/angular/reference/functions/defaultShouldDehydrateMutation.md
new file mode 100644
index 00000000000..40d2f4a36db
--- /dev/null
+++ b/docs/framework/angular/reference/functions/defaultShouldDehydrateMutation.md
@@ -0,0 +1,29 @@
+---
+id: defaultShouldDehydrateMutation
+title: defaultShouldDehydrateMutation
+---
+
+
+
+```ts
+function defaultShouldDehydrateMutation(mutation: Mutation): boolean;
+```
+
+Defined in: [packages/query-core/src/hydration.ts:209](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L209)
+
+The default `shouldDehydrateMutation` predicate used by `dehydrate`. Only dehydrates mutations that are
+currently paused (e.g. paused by `networkMode` while offline).
+
+## Parameters
+
+### mutation
+
+[`Mutation`](../classes/Mutation.md)
+
+The mutation to check.
+
+## Returns
+
+`boolean`
+
+`true` if the mutation is paused.
diff --git a/docs/framework/angular/reference/functions/defaultShouldDehydrateQuery.md b/docs/framework/angular/reference/functions/defaultShouldDehydrateQuery.md
new file mode 100644
index 00000000000..92f3beb9e1a
--- /dev/null
+++ b/docs/framework/angular/reference/functions/defaultShouldDehydrateQuery.md
@@ -0,0 +1,29 @@
+---
+id: defaultShouldDehydrateQuery
+title: defaultShouldDehydrateQuery
+---
+
+
+
+```ts
+function defaultShouldDehydrateQuery(query: Query): boolean;
+```
+
+Defined in: [packages/query-core/src/hydration.ts:219](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L219)
+
+The default `shouldDehydrateQuery` predicate used by `dehydrate`. Only dehydrates queries whose status is
+`'success'`.
+
+## Parameters
+
+### query
+
+[`Query`](../classes/Query.md)
+
+The query to check.
+
+## Returns
+
+`boolean`
+
+`true` if the query's status is `'success'`.
diff --git a/docs/framework/angular/reference/functions/dehydrate.md b/docs/framework/angular/reference/functions/dehydrate.md
new file mode 100644
index 00000000000..15c73ae471f
--- /dev/null
+++ b/docs/framework/angular/reference/functions/dehydrate.md
@@ -0,0 +1,72 @@
+---
+id: dehydrate
+title: dehydrate
+---
+
+
+
+```ts
+function dehydrate(client: QueryClient, options?: DehydrateOptions): DehydratedState;
+```
+
+Defined in: [packages/query-core/src/hydration.ts:245](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L245)
+
+Dehydrates a `QueryClient`'s cache (queries and mutations) into a plain, serializable `DehydratedState`,
+typically to embed in server-rendered markup and later restore into a client-side `QueryClient` via `hydrate`.
+Which queries/mutations are included, and how their data/errors are transformed, is controlled by `options`,
+falling back to the client's `dehydrate` default options, and finally to `defaultShouldDehydrateQuery` /
+`defaultShouldDehydrateMutation`.
+
+## Parameters
+
+### client
+
+[`QueryClient`](../classes/QueryClient.md)
+
+The client whose cache is dehydrated.
+
+### options?
+
+[`DehydrateOptions`](../interfaces/DehydrateOptions.md) = `{}`
+
+Controls which queries and mutations are included and how their data and errors
+are transformed. Each option falls back to the client's `defaultOptions.dehydrate`.
+
+
+
+#### `options` properties
+
+| Property | Type | Description |
+| ------ | ------ | ------ |
+| `serializeData?` | `TransformerFn` | Transforms a query's `data` before it is dehydrated. Useful for non-JSON-serializable data. |
+| `shouldDehydrateMutation?` | (`mutation`: [`Mutation`](../classes/Mutation.md)) => `boolean` | Predicate to decide whether a given `Mutation` should be dehydrated. Defaults to `defaultShouldDehydrateMutation`. |
+| `shouldDehydrateQuery?` | (`query`: [`Query`](../classes/Query.md)) => `boolean` | Predicate to decide whether a given `Query` should be dehydrated. Defaults to `defaultShouldDehydrateQuery`. |
+| `shouldRedactErrors?` | (`error`: `unknown`) => `boolean` | Predicate to decide whether a query's error should be redacted before dehydration. Errors are redacted (replaced with a generic `Error('redacted')`) unless this function is provided and returns `false` for the given error, in which case the original error is kept. |
+
+## Returns
+
+[`DehydratedState`](../interfaces/DehydratedState.md)
+
+The dehydrated state, with the included `queries` and `mutations`.
+
+
+
+### Result properties
+
+| Property | Type | Description |
+| ------ | ------ | ------ |
+| `mutations` | `DehydratedMutation`[] | The dehydrated mutations, by default only the paused ones. |
+| `queries` | `DehydratedQuery`[] | The dehydrated queries, by default only the successful ones. |
+
+## Example
+
+```ts
+const queryClient = new QueryClient()
+
+await queryClient.prefetchQuery({
+ queryKey: ['posts'],
+ queryFn: getPosts,
+})
+
+const dehydratedState = dehydrate(queryClient)
+```
diff --git a/docs/framework/angular/reference/functions/dehydrateQuery.md b/docs/framework/angular/reference/functions/dehydrateQuery.md
new file mode 100644
index 00000000000..ca6ca865bad
--- /dev/null
+++ b/docs/framework/angular/reference/functions/dehydrateQuery.md
@@ -0,0 +1,48 @@
+---
+id: dehydrateQuery
+title: dehydrateQuery
+---
+
+
+
+```ts
+function dehydrateQuery(
+ query: Query,
+ serializeData?: TransformerFn,
+ shouldRedactErrors?: (error: unknown) => boolean
+): DehydratedQuery;
+```
+
+Defined in: [packages/query-core/src/hydration.ts:178](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L178)
+
+Dehydrates a single `Query` into a serializable `DehydratedQuery` snapshot. Note that most query config (e.g.
+`queryFn`, `staleTime`) is not dehydrated but instead meant to be configured again when consuming the
+de/rehydrated data, typically with `useQuery` on the client. If the query is still `pending`, its in-flight
+promise is dehydrated too so it can be resumed on the other side instead of re-fetched.
+
+## Parameters
+
+### query
+
+[`Query`](../classes/Query.md)
+
+The query to dehydrate.
+
+### serializeData?
+
+`TransformerFn`
+
+Optional transform applied to `query.state.data` before it is included in the snapshot.
+
+### shouldRedactErrors?
+
+(`error`: `unknown`) => `boolean`
+
+Optional predicate; if it returns `false` for the promise's rejection error, that
+error is kept as-is instead of being redacted.
+
+## Returns
+
+`DehydratedQuery`
+
+The dehydrated query.
diff --git a/docs/framework/angular/reference/functions/experimental_streamedQuery.md b/docs/framework/angular/reference/functions/experimental_streamedQuery.md
new file mode 100644
index 00000000000..a76213c3b3d
--- /dev/null
+++ b/docs/framework/angular/reference/functions/experimental_streamedQuery.md
@@ -0,0 +1,59 @@
+---
+id: experimental_streamedQuery
+title: experimental_streamedQuery
+---
+
+
+
+```ts
+function experimental_streamedQuery(options: StreamedQueryParams): (context: object) => TData | Promise;
+```
+
+Defined in: [packages/query-core/src/streamedQuery.ts:73](https://github.com/TanStack/query/blob/main/packages/query-core/src/streamedQuery.ts#L73)
+
+This is a helper function to create a query function that streams data from an AsyncIterable.
+Data will be an Array of all the chunks received.
+The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that.
+The query will stay in fetchStatus 'fetching' until the stream ends.
+Explicit cancellation stops further cache updates, even if `streamFn` does not read `signal`.
+If `streamFn` does not read `signal`, the stream continues after the last observer unsubscribes.
+
+## Type Parameters
+
+### TQueryFnData
+
+`TQueryFnData` = `unknown`
+
+### TData
+
+`TData` = `TQueryFnData`[]
+
+### TQueryKey
+
+`TQueryKey` *extends* readonly `unknown`[] = readonly `unknown`[]
+
+## Parameters
+
+### options
+
+`StreamedQueryParams`\<`TQueryFnData`, `TData`, `TQueryKey`\>
+
+The `streamFn` that returns an AsyncIterable to stream data from, and the optional
+`refetchMode`, `reducer`, and `initialValue` options.
+
+## Returns
+
+A query function to pass as `queryFn`.
+
+(`context`: `object`) => `TData` \| `Promise`\<`TData`\>
+
+## Example
+
+```ts
+await queryClient.query({
+ queryKey: ['data'],
+ queryFn: streamedQuery({
+ streamFn: fetchDataInChunks,
+ }),
+})
+```
diff --git a/docs/framework/angular/reference/functions/hashKey.md b/docs/framework/angular/reference/functions/hashKey.md
new file mode 100644
index 00000000000..afe964345ed
--- /dev/null
+++ b/docs/framework/angular/reference/functions/hashKey.md
@@ -0,0 +1,36 @@
+---
+id: hashKey
+title: hashKey
+---
+
+
+
+```ts
+function hashKey(queryKey: readonly unknown[]): string;
+```
+
+Defined in: [packages/query-core/src/utils.ts:323](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L323)
+
+Default query & mutation keys hash function.
+Hashes the value into a stable hash.
+
+## Parameters
+
+### queryKey
+
+readonly `unknown`[]
+
+The query or mutation key to hash.
+
+## Returns
+
+`string`
+
+The stable hash of the key, as a JSON string.
+
+## Example
+
+```ts
+// Object keys are sorted, so key order doesn't affect the hash:
+hashKey(['todos', { page: 1, filter: 'done' }]) // === '["todos",{"filter":"done","page":1}]'
+```
diff --git a/docs/framework/angular/reference/functions/hydrate.md b/docs/framework/angular/reference/functions/hydrate.md
new file mode 100644
index 00000000000..411978a70f8
--- /dev/null
+++ b/docs/framework/angular/reference/functions/hydrate.md
@@ -0,0 +1,76 @@
+---
+id: hydrate
+title: hydrate
+---
+
+
+
+```ts
+function hydrate(
+ client: QueryClient,
+ dehydratedState: Partial,
+ options?: HydrateOptions
+): void;
+```
+
+Defined in: [packages/query-core/src/hydration.ts:306](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L306)
+
+Restores a `DehydratedState` (as produced by `dehydrate`) into a `QueryClient`'s cache, typically to seed the
+client with data already fetched on the server. `mutations` and `queries` are each optional on `dehydratedState`.
+Queries not yet in the cache are built from the dehydrated snapshot; queries that already exist are only updated
+when the dehydrated data is newer than what's already cached. Newly built queries have their `fetchStatus` reset
+to `'idle'` so they don't hydrate stuck in a fetching state. If a dehydrated query still had an in-flight
+promise, it is resumed via `query.fetch()` (reusing that promise as `initialPromise`) rather than re-invoking
+`queryFn`.
+
+## Parameters
+
+### client
+
+[`QueryClient`](../classes/QueryClient.md)
+
+The client whose cache is restored into.
+
+### dehydratedState
+
+`Partial`\<[`DehydratedState`](../interfaces/DehydratedState.md)\>
+
+The dehydrated state, e.g. produced by `dehydrate` on the server.
+
+
+
+#### `dehydratedState` properties
+
+Built from [`DehydratedState`](../interfaces/DehydratedState.md#properties). See the type above for what it changes.
+
+### options?
+
+[`HydrateOptions`](../interfaces/HydrateOptions.md)
+
+`defaultOptions` merged into every restored query and mutation (on top of the
+client's `defaultOptions.hydrate`), and `deserializeData` to reverse `serializeData`.
+
+
+
+#### `options` properties
+
+| Property | Type | Description |
+| ------ | ------ | ------ |
+| `defaultOptions?` | `object` | Options applied to the queries and mutations restored from the dehydrated state. |
+| `defaultOptions.deserializeData?` | `TransformerFn` | Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. |
+| `defaultOptions.mutations?` | [`MutationOptions`](../interfaces/MutationOptions.md)\<`unknown`, `Error`, `unknown`, `unknown`\> | Default options merged into every mutation restored from the dehydrated state. |
+| `defaultOptions.queries?` | [`QueryOptions`](../interfaces/QueryOptions.md)\<`unknown`, `Error`, `unknown`, readonly `unknown`[], `never`\> | Default options merged into every query restored from the dehydrated state. |
+
+## Returns
+
+`void`
+
+## Example
+
+```ts
+// dehydratedState was produced by `dehydrate` on the server
+// and sent to the client, e.g. embedded in server-rendered markup.
+const queryClient = new QueryClient()
+
+hydrate(queryClient, dehydratedState)
+```
diff --git a/docs/framework/angular/reference/functions/infiniteQueryOptions.md b/docs/framework/angular/reference/functions/infiniteQueryOptions.md
index 95b72f4206f..7af14e4ab67 100644
--- a/docs/framework/angular/reference/functions/infiniteQueryOptions.md
+++ b/docs/framework/angular/reference/functions/infiniteQueryOptions.md
@@ -3,27 +3,38 @@ id: infiniteQueryOptions
title: infiniteQueryOptions
---
-# Function: infiniteQueryOptions()
+
-Allows to share and re-use infinite query options in a type-safe way.
+## Overview
-The `queryKey` will be tagged with the type from `queryFn`.
+```ts
+function infiniteQueryOptions, TQueryKey extends readonly unknown[] = readonly unknown[], TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions): DefinedInitialDataInfiniteOptions & QueryKeyWithDataTag, TError>;
+function infiniteQueryOptions, TQueryKey extends readonly unknown[] = readonly unknown[], TPageParam = unknown>(options: UnusedSkipTokenInfiniteOptions): UnusedSkipTokenInfiniteOptions & QueryKeyWithDataTag, TError>;
+function infiniteQueryOptions, TQueryKey extends readonly unknown[] = readonly unknown[], TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions): UndefinedInitialDataInfiniteOptions & QueryKeyWithDataTag, TError>;
+```
+
+- [`DefinedInitialDataInfiniteOptions` โ `DefinedInitialDataInfiniteOptions & QueryKeyWithDataTag`](#call-signature-1): You can generally pass everything to `infiniteQueryOptions` that you can also pass to `injectInfiniteQuery`. These options can be shared across functions and imperative APIs such as `queryClient.fetchInfiniteQuery`. `options.queryKey` is required and is the query key to generate options for.
+- [`UnusedSkipTokenInfiniteOptions` โ `UnusedSkipTokenInfiniteOptions & QueryKeyWithDataTag`](#call-signature-2): You can generally pass everything to `infiniteQueryOptions` that you can also pass to `injectInfiniteQuery`. These options can be shared across functions and imperative APIs such as `queryClient.fetchInfiniteQuery`. `options.queryKey` is required and is the query key to generate options for.
+- [`UndefinedInitialDataInfiniteOptions` โ `UndefinedInitialDataInfiniteOptions & QueryKeyWithDataTag`](#call-signature-3): You can generally pass everything to `infiniteQueryOptions` that you can also pass to `injectInfiniteQuery`. These options can be shared across functions and imperative APIs such as `queryClient.fetchInfiniteQuery`. `options.queryKey` is required and is the query key to generate options for.
-## Param
+See also: [Parameters](#parameters-summary) ยท [Returns](#returns-summary)
-The infinite query options to tag with the type from `queryFn`.
+
## Call Signature
```ts
-function infiniteQueryOptions(options): CreateInfiniteQueryOptions & object & object;
+function infiniteQueryOptions, TQueryKey extends readonly unknown[] = readonly unknown[], TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions): DefinedInitialDataInfiniteOptions & QueryKeyWithDataTag, TError>;
```
-Defined in: [infinite-query-options.ts:88](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/infinite-query-options.ts#L88)
+Defined in: [packages/angular-query-experimental/src/infinite-query-options.ts:177](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/infinite-query-options.ts#L177)
-Allows to share and re-use infinite query options in a type-safe way.
+You can generally pass everything to `infiniteQueryOptions` that you can also pass to
+`injectInfiniteQuery`. These options can be shared across functions and imperative APIs such as
+`queryClient.fetchInfiniteQuery`. `options.queryKey` is required and is the query key to generate options
+for.
-The `queryKey` will be tagged with the type from `queryFn`.
+This overload is selected when `initialData` is known to be defined.
### Type Parameters
@@ -37,7 +48,7 @@ The `queryKey` will be tagged with the type from `queryFn`.
#### TData
-`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\>
+`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>
#### TQueryKey
@@ -53,25 +64,70 @@ The `queryKey` will be tagged with the type from `queryFn`.
[`DefinedInitialDataInfiniteOptions`](../type-aliases/DefinedInitialDataInfiniteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
-The infinite query options to tag with the type from `queryFn`.
+The [DefinedInitialDataInfiniteOptions](../type-aliases/DefinedInitialDataInfiniteOptions.md) to use โ everything you can pass to
+`injectInfiniteQuery`, with `initialData` known to be defined.
### Returns
-[`CreateInfiniteQueryOptions`](../interfaces/CreateInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & `object` & `object`
+[`DefinedInitialDataInfiniteOptions`](../type-aliases/DefinedInitialDataInfiniteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & [`QueryKeyWithDataTag`](../type-aliases/QueryKeyWithDataTag.md)\<`TQueryKey`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\>, `TError`\>
+
+The same options object, typed so that `queryKey` carries the inferred data type.
+
+### Remarks
+
+See [injectInfiniteQuery](injectInfiniteQuery.md) for examples that fetch further pages, from a button click or
+automatically as the user scrolls.
+
+### See
+
+[injectInfiniteQuery](injectInfiniteQuery.md) to run an infinite query with these options.
+
+### Example
+
+```angular-ts
+import { infiniteQueryOptions, injectInfiniteQuery } from '@tanstack/angular-query-experimental'
+
+export const projectsOptions = infiniteQueryOptions({
+ queryKey: ['projects'],
+ queryFn: ({ pageParam }) => fetchProjects(pageParam),
+ initialPageParam: 0,
+ getNextPageParam: (lastPage) => lastPage.nextId,
+ initialData: { pages: [], pageParams: [] },
+})
+
+@Component({
+ selector: 'projects',
+ template: `
+
+
+ @for (page of projectsQuery.data().pages; track $index) {
+ @for (project of page.projects; track project.id) {
+
{{ project.name }}
+ }
+ }
+
+ `,
+})
+export class Projects {
+ readonly projectsQuery = injectInfiniteQuery(() => projectsOptions)
+}
+```
-The tagged infinite query options.
+
## Call Signature
```ts
-function infiniteQueryOptions(options): OmitKeyof, "queryFn"> & object & object;
+function infiniteQueryOptions, TQueryKey extends readonly unknown[] = readonly unknown[], TPageParam = unknown>(options: UnusedSkipTokenInfiniteOptions): UnusedSkipTokenInfiniteOptions & QueryKeyWithDataTag, TError>;
```
-Defined in: [infinite-query-options.ts:119](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/infinite-query-options.ts#L119)
-
-Allows to share and re-use infinite query options in a type-safe way.
+Defined in: [packages/angular-query-experimental/src/infinite-query-options.ts:248](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/infinite-query-options.ts#L248)
-The `queryKey` will be tagged with the type from `queryFn`.
+You can generally pass everything to `infiniteQueryOptions` that you can also pass to
+`injectInfiniteQuery`. These options can be shared across functions and imperative APIs such as
+`queryClient.fetchInfiniteQuery`. `options.queryKey` is required and is the query key to generate options
+for.
### Type Parameters
@@ -85,7 +141,7 @@ The `queryKey` will be tagged with the type from `queryFn`.
#### TData
-`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\>
+`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>
#### TQueryKey
@@ -101,25 +157,76 @@ The `queryKey` will be tagged with the type from `queryFn`.
[`UnusedSkipTokenInfiniteOptions`](../type-aliases/UnusedSkipTokenInfiniteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
-The infinite query options to tag with the type from `queryFn`.
+The [UnusedSkipTokenInfiniteOptions](../type-aliases/UnusedSkipTokenInfiniteOptions.md) to use โ everything you can pass to
+`injectInfiniteQuery`.
### Returns
-`OmitKeyof`\<[`CreateInfiniteQueryOptions`](../interfaces/CreateInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>, `"queryFn"`\> & `object` & `object`
+[`UnusedSkipTokenInfiniteOptions`](../type-aliases/UnusedSkipTokenInfiniteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & [`QueryKeyWithDataTag`](../type-aliases/QueryKeyWithDataTag.md)\<`TQueryKey`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\>, `TError`\>
+
+The same options object, typed so that `queryKey` carries the inferred data type.
+
+### Remarks
+
+See [injectInfiniteQuery](injectInfiniteQuery.md) for examples that fetch further pages, from a button click or
+automatically as the user scrolls.
+
+### See
+
+[injectInfiniteQuery](injectInfiniteQuery.md) to run an infinite query with these options.
+
+### Example
+
+A parameterized factory, so the same options object can be reused per `postId`:
+```angular-ts
+import { infiniteQueryOptions, injectInfiniteQuery } from '@tanstack/angular-query-experimental'
+
+export const commentsOptions = (postId: string) =>
+ infiniteQueryOptions({
+ queryKey: ['post', postId, 'comments'],
+ queryFn: ({ pageParam }) => fetchComments(postId, pageParam),
+ initialPageParam: 0,
+ getNextPageParam: (lastPage) => lastPage.nextId,
+ })
+
+@Component({
+ selector: 'comments',
+ template: `
+ @if (commentsQuery.isPending()) {
+ Loading...
+ } @else if (commentsQuery.isError()) {
+ Error: {{ commentsQuery.error()?.message }}
+ } @else {
+
+ @for (page of commentsQuery.data().pages; track $index) {
+ @for (comment of page.comments; track comment.id) {
+
{{ comment.text }}
+ }
+ }
+
+ }
+ `,
+})
+export class Comments {
+ readonly postId = signal('1')
+ readonly commentsQuery = injectInfiniteQuery(() => commentsOptions(this.postId()))
+}
+```
-The tagged infinite query options.
+
## Call Signature
```ts
-function infiniteQueryOptions(options): CreateInfiniteQueryOptions & object & object;
+function infiniteQueryOptions, TQueryKey extends readonly unknown[] = readonly unknown[], TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions): UndefinedInitialDataInfiniteOptions & QueryKeyWithDataTag, TError>;
```
-Defined in: [infinite-query-options.ts:150](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/infinite-query-options.ts#L150)
+Defined in: [packages/angular-query-experimental/src/infinite-query-options.ts:319](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/infinite-query-options.ts#L319)
-Allows to share and re-use infinite query options in a type-safe way.
-
-The `queryKey` will be tagged with the type from `queryFn`.
+You can generally pass everything to `infiniteQueryOptions` that you can also pass to
+`injectInfiniteQuery`. These options can be shared across functions and imperative APIs such as
+`queryClient.fetchInfiniteQuery`. `options.queryKey` is required and is the query key to generate options
+for.
### Type Parameters
@@ -133,7 +240,7 @@ The `queryKey` will be tagged with the type from `queryFn`.
#### TData
-`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\>
+`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>
#### TQueryKey
@@ -149,10 +256,89 @@ The `queryKey` will be tagged with the type from `queryFn`.
[`UndefinedInitialDataInfiniteOptions`](../type-aliases/UndefinedInitialDataInfiniteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
-The infinite query options to tag with the type from `queryFn`.
+The [UndefinedInitialDataInfiniteOptions](../type-aliases/UndefinedInitialDataInfiniteOptions.md) to use โ everything you can pass to
+`injectInfiniteQuery`.
### Returns
-[`CreateInfiniteQueryOptions`](../interfaces/CreateInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & `object` & `object`
+[`UndefinedInitialDataInfiniteOptions`](../type-aliases/UndefinedInitialDataInfiniteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & [`QueryKeyWithDataTag`](../type-aliases/QueryKeyWithDataTag.md)\<`TQueryKey`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\>, `TError`\>
+
+The same options object, typed so that `queryKey` carries the inferred data type.
+
+### Remarks
+
+See [injectInfiniteQuery](injectInfiniteQuery.md) for examples that fetch further pages (from a button click or
+automatically as the user scrolls) and that use `skipToken` to disable the query until `postId` is set.
+
+### See
+
+[injectInfiniteQuery](injectInfiniteQuery.md) to run an infinite query with these options.
+
+### Example
+
+A parameterized factory, so the same options object can be reused per `postId`:
+```angular-ts
+import { infiniteQueryOptions, injectInfiniteQuery } from '@tanstack/angular-query-experimental'
+
+export const commentsOptions = (postId: string) =>
+ infiniteQueryOptions({
+ queryKey: ['post', postId, 'comments'],
+ queryFn: ({ pageParam }) => fetchComments(postId, pageParam),
+ initialPageParam: 0,
+ getNextPageParam: (lastPage) => lastPage.nextId,
+ })
+
+@Component({
+ selector: 'comments',
+ template: `
+ @if (commentsQuery.isPending()) {
+ Loading...
+ } @else if (commentsQuery.isError()) {
+ Error: {{ commentsQuery.error()?.message }}
+ } @else {
+
+ @for (page of commentsQuery.data().pages; track $index) {
+ @for (comment of page.comments; track comment.id) {
+
{{ comment.text }}
+ }
+ }
+
+ }
+ `,
+})
+export class Comments {
+ readonly postId = signal('1')
+ readonly commentsQuery = injectInfiniteQuery(() => commentsOptions(this.postId()))
+}
+```
+
+
+
+## Parameters
+
+### options
+
+[`UndefinedInitialDataInfiniteOptions`](../type-aliases/UndefinedInitialDataInfiniteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
+
+The [UndefinedInitialDataInfiniteOptions](../type-aliases/UndefinedInitialDataInfiniteOptions.md) to use โ everything you can pass to
+`injectInfiniteQuery`.
+
+
+
+#### `options` properties
+
+Built from [`CreateInfiniteQueryOptions`](../interfaces/CreateInfiniteQueryOptions.md#properties). See the type above for what it changes.
+
+
+
+## Returns
+
+[`UndefinedInitialDataInfiniteOptions`](../type-aliases/UndefinedInitialDataInfiniteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & [`QueryKeyWithDataTag`](../type-aliases/QueryKeyWithDataTag.md)\<`TQueryKey`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`\>, `TError`\>
+
+The same options object, typed so that `queryKey` carries the inferred data type.
+
+
+
+### Result properties
-The tagged infinite query options.
+Built from [`CreateInfiniteQueryOptions`](../interfaces/CreateInfiniteQueryOptions.md#properties), [`QueryKeyWithDataTag`](../type-aliases/QueryKeyWithDataTag.md#properties). See the type above for what it changes.
diff --git a/docs/framework/angular/reference/functions/injectInfiniteQuery.md b/docs/framework/angular/reference/functions/injectInfiniteQuery.md
index 020ef039fa5..1916a7ebc20 100644
--- a/docs/framework/angular/reference/functions/injectInfiniteQuery.md
+++ b/docs/framework/angular/reference/functions/injectInfiniteQuery.md
@@ -3,29 +3,39 @@ id: injectInfiniteQuery
title: injectInfiniteQuery
---
-# Function: injectInfiniteQuery()
+
-Injects an infinite query: a declarative dependency on an asynchronous source of data that is tied to a unique key.
-Infinite queries can additively "load more" data onto an existing set of data or "infinite scroll"
+## Overview
-## Param
+```ts
+function injectInfiniteQuery, TQueryKey extends readonly unknown[] = readonly unknown[], TPageParam = unknown>(injectInfiniteQueryFn: () => DefinedInitialDataInfiniteOptions, options?: InjectInfiniteQueryOptions): DefinedCreateInfiniteQueryResult;
+function injectInfiniteQuery, TQueryKey extends readonly unknown[] = readonly unknown[], TPageParam = unknown>(injectInfiniteQueryFn: () => UndefinedInitialDataInfiniteOptions, options?: InjectInfiniteQueryOptions): CreateInfiniteQueryResult;
+function injectInfiniteQuery, TQueryKey extends readonly unknown[] = readonly unknown[], TPageParam = unknown>(injectInfiniteQueryFn: () => CreateInfiniteQueryOptions, options?: InjectInfiniteQueryOptions): CreateInfiniteQueryResult;
+```
-A function that returns infinite query options.
+- [`() => DefinedInitialDataInfiniteOptions` โ `DefinedCreateInfiniteQueryResult`](#call-signature-1): The options for `injectInfiniteQuery` are identical to `injectQuery`, with the addition of `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`. Infinite queries can additively "load more" data onto an existing set of data, or "infinite scroll".
+- [`() => UndefinedInitialDataInfiniteOptions` โ `CreateInfiniteQueryResult`](#call-signature-2): Injects an infinite query: a declarative dependency on an asynchronous source of data that is tied to a unique key. Infinite queries can additively "load more" data onto an existing set of data, or "infinite scroll".
+- [`() => CreateInfiniteQueryOptions` โ `CreateInfiniteQueryResult`](#call-signature-3): This overload accepts the general [CreateInfiniteQueryOptions](../interfaces/CreateInfiniteQueryOptions.md) shape rather than the `initialData`-aware overloads above, so whether `data` is defined can't be inferred from the call site โ useful when wrapping `injectInfiniteQuery` in your own helper function that forwards caller-provided options.
-## Param
+See also: [Parameters](#parameters-summary) ยท [Returns](#returns-summary)
-Additional configuration.
+
## Call Signature
```ts
-function injectInfiniteQuery(injectInfiniteQueryFn, options?): DefinedCreateInfiniteQueryResult;
+function injectInfiniteQuery, TQueryKey extends readonly unknown[] = readonly unknown[], TPageParam = unknown>(injectInfiniteQueryFn: () => DefinedInitialDataInfiniteOptions, options?: InjectInfiniteQueryOptions): DefinedCreateInfiniteQueryResult;
```
-Defined in: [inject-infinite-query.ts:41](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-infinite-query.ts#L41)
+Defined in: [packages/angular-query-experimental/src/inject-infinite-query.ts:87](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-infinite-query.ts#L87)
-Injects an infinite query: a declarative dependency on an asynchronous source of data that is tied to a unique key.
-Infinite queries can additively "load more" data onto an existing set of data or "infinite scroll"
+The options for `injectInfiniteQuery` are identical to `injectQuery`, with the addition of
+`initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`. Infinite queries can
+additively "load more" data onto an existing set of data, or "infinite scroll".
+
+This overload is selected when `initialData` is known to be defined on the options returned by
+`injectInfiniteQueryFn`, so the resulting `data` signal is never `undefined` (unless a `select` changes
+`TData` to include `undefined`).
### Type Parameters
@@ -39,7 +49,7 @@ Infinite queries can additively "load more" data onto an existing set of data or
#### TData
-`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\>
+`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>
#### TQueryKey
@@ -55,7 +65,10 @@ Infinite queries can additively "load more" data onto an existing set of data or
() => [`DefinedInitialDataInfiniteOptions`](../type-aliases/DefinedInitialDataInfiniteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
-A function that returns infinite query options.
+A function returning the [DefinedInitialDataInfiniteOptions](../type-aliases/DefinedInitialDataInfiniteOptions.md) to use โ
+everything you can pass to `injectInfiniteQuery`, with `initialData` known to be defined. Similar to
+`computed` from Angular, this function runs in the reactive context, so signals read inside it drive the
+query.
#### options?
@@ -67,18 +80,63 @@ Additional configuration.
[`DefinedCreateInfiniteQueryResult`](../type-aliases/DefinedCreateInfiniteQueryResult.md)\<`TData`, `TError`\>
-The infinite query result.
+The same signals as `injectQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,
+`hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data().pages` and
+`data().pageParams` are also added, as long as a `select` doesn't change `TData` away from its default
+`InfiniteData` shape.
+
+### Remarks
+
+Keep in mind that imperative fetch calls, such as `fetchNextPage`, may interfere with the default
+refetch behavior, resulting in outdated data. Make sure to call these functions only in response to user
+actions, or add conditions like `hasNextPage() && !isFetching()`.
+
+### See
+
+[infiniteQueryOptions](infiniteQueryOptions.md) to share these options between `injectInfiniteQuery` and imperative APIs
+like `queryClient.fetchInfiniteQuery`.
+
+### Example
+
+```angular-ts
+@Component({
+ selector: 'projects',
+ template: `
+
+
+ @for (page of projectsQuery.data().pages; track $index) {
+ @for (project of page.projects; track project.id) {
+
{{ project.name }}
+ }
+ }
+
+ `,
+})
+export class Projects {
+ readonly projectsQuery = injectInfiniteQuery(() => ({
+ queryKey: ['projects'],
+ queryFn: ({ pageParam }) => fetchProjects(pageParam),
+ initialPageParam: 0,
+ getNextPageParam: (lastPage) => lastPage.nextId,
+ initialData: { pages: [], pageParams: [] },
+ }))
+}
+```
+
+
## Call Signature
```ts
-function injectInfiniteQuery(injectInfiniteQueryFn, options?): CreateInfiniteQueryResult;
+function injectInfiniteQuery, TQueryKey extends readonly unknown[] = readonly unknown[], TPageParam = unknown>(injectInfiniteQueryFn: () => UndefinedInitialDataInfiniteOptions, options?: InjectInfiniteQueryOptions): CreateInfiniteQueryResult;
```
-Defined in: [inject-infinite-query.ts:65](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-infinite-query.ts#L65)
+Defined in: [packages/angular-query-experimental/src/inject-infinite-query.ts:239](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-infinite-query.ts#L239)
-Injects an infinite query: a declarative dependency on an asynchronous source of data that is tied to a unique key.
-Infinite queries can additively "load more" data onto an existing set of data or "infinite scroll"
+Injects an infinite query: a declarative dependency on an asynchronous source of data that is tied to a
+unique key. Infinite queries can additively "load more" data onto an existing set of data, or
+"infinite scroll".
### Type Parameters
@@ -92,7 +150,7 @@ Infinite queries can additively "load more" data onto an existing set of data or
#### TData
-`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\>
+`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>
#### TQueryKey
@@ -108,7 +166,9 @@ Infinite queries can additively "load more" data onto an existing set of data or
() => [`UndefinedInitialDataInfiniteOptions`](../type-aliases/UndefinedInitialDataInfiniteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
-A function that returns infinite query options.
+A function returning the [UndefinedInitialDataInfiniteOptions](../type-aliases/UndefinedInitialDataInfiniteOptions.md) to use
+โ everything you can pass to `injectInfiniteQuery`. Similar to `computed` from Angular, this function runs
+in the reactive context, so signals read inside it drive the query.
#### options?
@@ -120,18 +180,155 @@ Additional configuration.
[`CreateInfiniteQueryResult`](../type-aliases/CreateInfiniteQueryResult.md)\<`TData`, `TError`\>
-The infinite query result.
+The same signals as `injectQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,
+`hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data().pages` and
+`data().pageParams` are also added, as long as a `select` doesn't change `TData` away from its default
+`InfiniteData` shape.
+
+### Remarks
+
+Keep in mind that imperative fetch calls, such as `fetchNextPage`, may interfere with the default
+refetch behavior, resulting in outdated data. Make sure to call these functions only in response to user
+actions, or add conditions like `hasNextPage() && !isFetching()`. This is the only overload that accepts
+`queryFn: skipToken`, shown below.
+
+### See
+
+[infiniteQueryOptions](infiniteQueryOptions.md) to share these options between `injectInfiniteQuery` and imperative APIs
+like `queryClient.fetchInfiniteQuery`.
+
+### Examples
+
+Fetching the next page from a button click:
+```angular-ts
+@Component({
+ selector: 'projects-list',
+ template: `
+
+ @for (page of projectsQuery.data()?.pages; track $index) {
+ @for (project of page.projects; track project.id) {
+
{{ project.name }}
+ }
+ }
+
+
+ Load More
+
+ `,
+})
+export class ProjectsList {
+ readonly projectsQuery = injectInfiniteQuery(() => ({
+ queryKey: ['projects'],
+ queryFn: ({ pageParam }) => fetchProjects(pageParam),
+ initialPageParam: 0,
+ getNextPageParam: (lastPage) => lastPage.nextId,
+ }))
+}
+```
+
+Fetching the next page automatically as the user scrolls, using an `IntersectionObserver` on a sentinel
+element after the list:
+```angular-ts
+@Component({
+ selector: 'projects-list',
+ template: `
+
+ @for (page of projectsQuery.data()?.pages; track $index) {
+ @for (project of page.projects; track project.id) {
+
+ @for (page of commentsQuery.data().pages; track $index) {
+ @for (comment of page.comments; track comment.id) {
+
{{ comment.text }}
+ }
+ }
+
+ }
+ `,
+})
+export class Comments {
+ readonly postId = signal(undefined)
+
+ readonly commentsQuery = injectInfiniteQuery(() => ({
+ queryKey: ['post', this.postId(), 'comments'],
+ queryFn:
+ this.postId() != null
+ ? ({ pageParam }) => fetchComments(this.postId()!, pageParam)
+ : skipToken,
+ initialPageParam: 0,
+ getNextPageParam: (lastPage) => lastPage.nextId,
+ }))
+}
+```
+
+
## Call Signature
```ts
-function injectInfiniteQuery(injectInfiniteQueryFn, options?): CreateInfiniteQueryResult;
+function injectInfiniteQuery, TQueryKey extends readonly unknown[] = readonly unknown[], TPageParam = unknown>(injectInfiniteQueryFn: () => CreateInfiniteQueryOptions, options?: InjectInfiniteQueryOptions): CreateInfiniteQueryResult;
```
-Defined in: [inject-infinite-query.ts:89](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-infinite-query.ts#L89)
+Defined in: [packages/angular-query-experimental/src/inject-infinite-query.ts:266](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-infinite-query.ts#L266)
-Injects an infinite query: a declarative dependency on an asynchronous source of data that is tied to a unique key.
-Infinite queries can additively "load more" data onto an existing set of data or "infinite scroll"
+This overload accepts the general [CreateInfiniteQueryOptions](../interfaces/CreateInfiniteQueryOptions.md) shape rather than the
+`initialData`-aware overloads above, so whether `data` is defined can't be inferred from the call site โ
+useful when wrapping `injectInfiniteQuery` in your own helper function that forwards caller-provided
+options.
### Type Parameters
@@ -145,7 +342,7 @@ Infinite queries can additively "load more" data onto an existing set of data or
#### TData
-`TData` = `InfiniteData`\<`TQueryFnData`, `unknown`\>
+`TData` = [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `unknown`\>
#### TQueryKey
@@ -161,7 +358,8 @@ Infinite queries can additively "load more" data onto an existing set of data or
() => [`CreateInfiniteQueryOptions`](../interfaces/CreateInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
-A function that returns infinite query options.
+A function that returns infinite query options. Similar to `computed` from
+Angular, this function runs in the reactive context, so signals read inside it drive the query.
#### options?
@@ -174,3 +372,78 @@ Additional configuration.
[`CreateInfiniteQueryResult`](../type-aliases/CreateInfiniteQueryResult.md)\<`TData`, `TError`\>
The infinite query result.
+
+
+
+## Parameters
+
+### injectInfiniteQueryFn
+
+() => [`CreateInfiniteQueryOptions`](../interfaces/CreateInfiniteQueryOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
+
+A function that returns infinite query options. Similar to `computed` from
+Angular, this function runs in the reactive context, so signals read inside it drive the query.
+
+
+
+#### `injectInfiniteQueryFn` properties
+
+| Property | Type | Default value | Description |
+| ------ | ------ | ------ | ------ |
+| `enabled?` | \| `false` \| `true` \| ((`query`: [`Query`](../classes/Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\>) => `boolean`) | `true` | Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the `refetch` method returned from the `useQuery` instance. Accepts a boolean or function that returns a boolean. |
+| `gcTime?` | `number` | `undefined` | The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to `Infinity` will disable garbage collection. Defaults to `5 * 60 * 1000` (5 minutes), or `Infinity` during SSR. Note: the maximum allowed time is about 24 days, imposed by `setTimeout`'s 32-bit signed integer delay โ see `timeoutManager.setTimeoutProvider` for a workaround. |
+| `getNextPageParam` | (`lastPage`: `TQueryFnData`, `allPages`: `TQueryFnData`[], `lastPageParam`: `TPageParam`, `allPageParams`: `TPageParam`[]) => `TPageParam` \| `null` \| `undefined` | `undefined` | This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of `hasNextPage`. |
+| `getPreviousPageParam?` | (`firstPage`: `TQueryFnData`, `allPages`: `TQueryFnData`[], `firstPageParam`: `TPageParam`, `allPageParams`: `TPageParam`[]) => `TPageParam` \| `null` \| `undefined` | `undefined` | This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of `hasPreviousPage`. |
+| `initialData?` | \| [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\> \| (() => \| [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\> \| `undefined`) | `undefined` | If set, this value will be used as the initial data for the query cache (as long as the query hasn't been created or cached yet). If set to a function, the function will be called **once** during the shared/root query initialization, and be expected to synchronously return the initial data. Initial data is considered stale by default unless a `staleTime` has been set. `initialData` **is persisted** to the cache. |
+| `initialDataUpdatedAt?` | `number` \| (() => `number` \| `undefined`) | `undefined` | If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated. |
+| `initialPageParam` | `TPageParam` | `undefined` | The page param to start from when an infinite query has no pages yet. It is passed to `queryFn` as `pageParam` for the first page; every page after that gets the value returned by `getNextPageParam` or `getPreviousPageParam`. It only applies while the query has no pages: once a first page exists, refetching starts from that page's own param instead. |
+| `maxPages?` | `number` | `undefined` | Maximum number of pages to store in the data of an infinite query. |
+| `meta?` | `Record`\<`string`, `unknown`\> | `undefined` | Additional payload to be stored on each query. Use this property to pass information that can be used in other places. |
+| `networkMode?` | `"online"` \| `"always"` \| `"offlineFirst"` | `'online'` | Controls whether a query is allowed to run based on the current network connectivity. **See** [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. |
+| `notifyOnChangeProps?` | \| ( \| `"error"` \| `"data"` \| `"isError"` \| `"isPending"` \| `"isLoading"` \| `"isLoadingError"` \| `"isRefetchError"` \| `"isSuccess"` \| `"isPlaceholderData"` \| `"status"` \| `"dataUpdatedAt"` \| `"errorUpdatedAt"` \| `"failureCount"` \| `"failureReason"` \| `"errorUpdateCount"` \| `"isFetched"` \| `"isFetchedAfterMount"` \| `"isFetching"` \| `"isInitialLoading"` \| `"isPaused"` \| `"isRefetching"` \| `"isStale"` \| `"isEnabled"` \| `"refetch"` \| `"fetchStatus"` \| `"fetchNextPage"` \| `"fetchPreviousPage"` \| `"hasNextPage"` \| `"hasPreviousPage"` \| `"isFetchNextPageError"` \| `"isFetchingNextPage"` \| `"isFetchPreviousPageError"` \| `"isFetchingPreviousPage"`)[] \| `"all"` \| (() => \| `"all"` \| ( \| `"error"` \| `"data"` \| `"isError"` \| `"isPending"` \| `"isLoading"` \| `"isLoadingError"` \| `"isRefetchError"` \| `"isSuccess"` \| `"isPlaceholderData"` \| `"status"` \| `"dataUpdatedAt"` \| `"errorUpdatedAt"` \| `"failureCount"` \| `"failureReason"` \| `"errorUpdateCount"` \| `"isFetched"` \| `"isFetchedAfterMount"` \| `"isFetching"` \| `"isInitialLoading"` \| `"isPaused"` \| `"isRefetching"` \| `"isStale"` \| `"isEnabled"` \| `"refetch"` \| `"fetchStatus"` \| `"fetchNextPage"` \| `"fetchPreviousPage"` \| `"hasNextPage"` \| `"hasPreviousPage"` \| `"isFetchNextPageError"` \| `"isFetchingNextPage"` \| `"isFetchPreviousPageError"` \| `"isFetchingPreviousPage"`)[] \| `undefined`) | `undefined` | If set, the component will only re-render if any of the listed properties change. When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. When set to `'all'`, the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. Defaults to `undefined`, in which case property access is tracked automatically, and the component only re-renders when one of the tracked properties changes. |
+| `persister?` | (`queryFn`: (`context`: [`QueryFunctionContext`](../type-aliases/QueryFunctionContext.md)\<`NoInfer`\<`TQueryKey`\>, `TPageParam`\>) => `TQueryFnData` \| `Promise`\<`TQueryFnData`\>, `context`: `object`, `query`: [`Query`](../classes/Query.md)) => `TQueryFnData` \| `Promise`\<`TQueryFnData`\> | `undefined` | This option can be used to persist the result of a query to an external storage, bypassing the need to actually call the `queryFn`. Useful for persisting a query's data across e.g. server/client boundaries. |
+| `placeholderData?` | \| [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\> \| ((`previousData`: \| [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\> \| `undefined`, `previousQuery`: \| [`Query`](../classes/Query.md)\<[`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\> \| `undefined`) => \| [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\> \| `undefined`) | `undefined` | If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. |
+| `queryFn?` | \| *typeof* [`skipToken`](../variables/skipToken.md) \| ((`context`: [`QueryFunctionContext`](../type-aliases/QueryFunctionContext.md)\<`TQueryKey`, `TPageParam`\>) => `TQueryFnData` \| `Promise`\<`TQueryFnData`\>) | `undefined` | The function that the query will use to request data. Required, unless a default query function has been set via `queryClient.setQueryDefaults` or `queryClient.setDefaultOptions`. Receives a [QueryFunctionContext](../type-aliases/QueryFunctionContext.md). Must return a promise that will either resolve data or throw an error. The data cannot be `undefined`. |
+| `queryHash?` | `string` | `undefined` | The hashed form of `queryKey`, computed with `queryKeyHashFn` (or the default hashing function otherwise). Used as the actual cache key internally. |
+| `queryKey` | `TQueryKey` & `object` | `undefined` | The query key to use for this query. The query key will be hashed into a stable hash. See [Query Keys](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) for more information. The query will automatically update when this key changes (as long as `enabled` is not set to `false`). |
+| `queryKeyHashFn?` | (`queryKey`: `TQueryKey`) => `string` | `undefined` | If specified, this function is used to hash the `queryKey` to a string. |
+| `refetchInterval?` | \| `number` \| `false` \| ((`query`: [`Query`](../classes/Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\>) => `number` \| `false` \| `undefined`) | `false` | If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency |
+| `refetchIntervalInBackground?` | `boolean` | `false` | If set to `true`, the query will continue to refetch while their tab/window is in the background. |
+| `refetchOnMount?` | \| `boolean` \| `"always"` \| ((`query`: [`Query`](../classes/Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\>) => `boolean` \| `"always"`) | `true` | If set to `true`, the query will refetch on mount if the data is stale. If set to `false`, will disable additional instances of a query to trigger background refetch. If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value |
+| `refetchOnReconnect?` | \| `boolean` \| `"always"` \| ((`query`: [`Query`](../classes/Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\>) => `boolean` \| `"always"`) | `undefined` | If set to `true`, the query will refetch on reconnect if the data is stale. If set to `false`, the query will not refetch on reconnect. If set to `'always'`, the query will always refetch on reconnect (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. Defaults to `true` unless `networkMode` is `'always'`. |
+| `refetchOnWindowFocus?` | \| `boolean` \| `"always"` \| ((`query`: [`Query`](../classes/Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\>) => `boolean` \| `"always"`) | `true` | If set to `true`, the query will refetch on window focus if the data is stale. If set to `false`, the query will not refetch on window focus. If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used). If set to a function, the function will be executed with the latest data and query to compute the value. |
+| `retry?` | \| `number` \| `false` \| `true` \| ((`failureCount`: `number`, `error`: `TError`) => `boolean`) | `undefined` | If `false`, failed queries will not retry by default. If `true`, failed queries will retry infinitely. If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. Defaults to `3` on the client and `0` on the server. |
+| `retryDelay?` | `number` \| ((`failureCount`: `number`, `error`: `TError`) => `number`) | `undefined` | This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds. A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential backoff. A function like `attempt => attempt * 1000` applies linear backoff. Defaults to a function that applies exponential backoff, capped at 30 seconds. |
+| `retryOnMount?` | \| `false` \| `true` \| ((`query`: [`Query`](../classes/Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\>) => `boolean`) | `true` | If set to `false`, the query will not be retried on mount if it contains an error. If set to a function, the function will be executed with the query to compute the value. |
+| `select?` | (`data`: [`InfiniteData`](../interfaces/InfiniteData.md)) => `TData` | `undefined` | This option can be used to transform or select a part of the data returned by the query function. It affects the returned `data` value, but does not affect what gets stored in the query cache. The `select` function will only run if `data` changed, or if the reference to the `select` function itself changes. To optimize, memoize the function so its reference stays stable across calls. |
+| `staleTime?` | \| `number` \| `"static"` \| ((`query`: [`Query`](../classes/Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\>) => `number` \| `"static"`) | `0` | The time in milliseconds after data is considered stale. If set to `Infinity`, the data will never be considered stale. If set to `'static'`, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a `staleTime`. |
+| `structuralSharing?` | `boolean` \| ((`oldData`: `unknown`, `newData`: `unknown`) => `unknown`) | `true` | Set this to `false` to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. |
+| `throwOnError?` | \| `false` \| `true` \| ((`error`: `TError`, `query`: [`Query`](../classes/Query.md)\<`TQueryFnData`, `TError`, [`InfiniteData`](../interfaces/InfiniteData.md)\<`TQueryFnData`, `TPageParam`\>, `TQueryKey`\>) => `boolean`) | `false` | Whether errors should be thrown instead of setting the `error` property. If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. If set to `false` and `suspense` is `false`, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). |
+
+### options?
+
+[`InjectInfiniteQueryOptions`](../interfaces/InjectInfiniteQueryOptions.md)
+
+Additional configuration.
+
+
+
+#### `options` properties
+
+| Property | Type | Description |
+| ------ | ------ | ------ |
+| `injector?` | `Injector` | The `Injector` in which to create the infinite query. If this is not provided, the current injection context will be used instead (via `inject`). |
+
+
+
+## Returns
+
+[`CreateInfiniteQueryResult`](../type-aliases/CreateInfiniteQueryResult.md)\<`TData`, `TError`\>
+
+The infinite query result.
+
+
+
+### Result properties
+
+Built from [`BaseQueryNarrowing`](../interfaces/BaseQueryNarrowing.md#properties), [`InfiniteQueryObserverBaseResult`](../interfaces/InfiniteQueryObserverBaseResult.md#properties). See the type above for what it changes.
diff --git a/docs/framework/angular/reference/functions/injectIsFetching.md b/docs/framework/angular/reference/functions/injectIsFetching.md
index c9943ca0c5f..e5f24ac5cb9 100644
--- a/docs/framework/angular/reference/functions/injectIsFetching.md
+++ b/docs/framework/angular/reference/functions/injectIsFetching.md
@@ -3,26 +3,30 @@ id: injectIsFetching
title: injectIsFetching
---
-# Function: injectIsFetching()
+
```ts
-function injectIsFetching(filters?, options?): Signal;
+function injectIsFetching(filters?: Omit, "fetchStatus">, options?: InjectIsFetchingOptions): Signal;
```
-Defined in: [inject-is-fetching.ts:31](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-fetching.ts#L31)
+Defined in: [packages/angular-query-experimental/src/inject-is-fetching.ts:63](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-fetching.ts#L63)
-Injects a signal that tracks the number of queries that your application is loading or
-fetching in the background.
-
-Can be used for app-wide loading indicators
+Injects a signal that tracks the number of queries that your application is loading or fetching in the
+background (useful for app-wide loading indicators).
## Parameters
### filters?
-`QueryFilters`\
+`Omit`\<[`QueryFilters`](../interfaces/QueryFilters.md)\, `"fetchStatus"`\>
+
+The [QueryFilters](../interfaces/QueryFilters.md) to narrow down the matched queries.
+
+
-The filters to apply to the query.
+#### `filters` properties
+
+Built from [`QueryFilters`](../interfaces/QueryFilters.md#properties). See the type above for what it changes.
### options?
@@ -30,8 +34,49 @@ The filters to apply to the query.
Additional configuration
+
+
+#### `options` properties
+
+| Property | Type | Description |
+| ------ | ------ | ------ |
+| `injector?` | `Injector` | The `Injector` in which to create the isFetching signal. If this is not provided, the current injection context will be used instead (via `inject`). |
+
## Returns
`Signal`\<`number`\>
-signal with number of loading or fetching queries.
+A `Signal` with the number of queries that your application is currently loading or fetching in
+the background.
+
+## Examples
+
+```angular-ts
+@Component({
+ selector: 'posts-fetching-indicator',
+ template: `
+ @if (isFetchingPosts()) {
+ Refreshing posts...
+ }
+ `,
+})
+export class PostsFetchingIndicator {
+ // How many queries matching the posts prefix are fetching?
+ readonly isFetchingPosts = injectIsFetching({ queryKey: ['posts'] })
+}
+```
+
+A global loading indicator for any query fetching in the background, not just the ones on screen:
+```angular-ts
+@Component({
+ selector: 'global-loading-indicator',
+ template: `
+ @if (isFetching()) {
+
Queries are fetching in the background...
+ }
+ `,
+})
+export class GlobalLoadingIndicator {
+ readonly isFetching = injectIsFetching()
+}
+```
diff --git a/docs/framework/angular/reference/functions/injectIsMutating.md b/docs/framework/angular/reference/functions/injectIsMutating.md
index 35d2ff4b828..960200eae60 100644
--- a/docs/framework/angular/reference/functions/injectIsMutating.md
+++ b/docs/framework/angular/reference/functions/injectIsMutating.md
@@ -3,25 +3,30 @@ id: injectIsMutating
title: injectIsMutating
---
-# Function: injectIsMutating()
+
```ts
-function injectIsMutating(filters?, options?): Signal;
+function injectIsMutating(filters?: Omit, "status">, options?: InjectIsMutatingOptions): Signal;
```
-Defined in: [inject-is-mutating.ts:30](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-mutating.ts#L30)
+Defined in: [packages/angular-query-experimental/src/inject-is-mutating.ts:47](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-mutating.ts#L47)
-Injects a signal that tracks the number of mutations that your application is fetching.
-
-Can be used for app-wide loading indicators
+Injects a signal that tracks the number of mutations that your application currently has `pending`
+(useful for app-wide loading indicators).
## Parameters
### filters?
-`MutationFilters`\<`unknown`, `Error`, `unknown`, `unknown`\>
+`Omit`\<[`MutationFilters`](../interfaces/MutationFilters.md)\<`unknown`, `Error`, `unknown`, `unknown`\>, `"status"`\>
+
+The [MutationFilters](../interfaces/MutationFilters.md) to narrow down the matched mutations.
+
+
-The filters to apply to the query.
+#### `filters` properties
+
+Built from [`MutationFilters`](../interfaces/MutationFilters.md#properties). See the type above for what it changes.
### options?
@@ -29,8 +34,33 @@ The filters to apply to the query.
Additional configuration
+
+
+#### `options` properties
+
+| Property | Type | Description |
+| ------ | ------ | ------ |
+| `injector?` | `Injector` | The `Injector` in which to create the isMutating signal. If this is not provided, the current injection context will be used instead (via `inject`). |
+
## Returns
`Signal`\<`number`\>
-A read-only signal with the number of fetching mutations.
+A `Signal` with the number of mutations that your application currently has `pending`.
+
+## Example
+
+```angular-ts
+@Component({
+ selector: 'posts-mutating-indicator',
+ template: `
+ @if (isMutatingPosts()) {
+ Saving posts...
+ }
+ `,
+})
+export class PostsMutatingIndicator {
+ // How many mutations matching the posts prefix are in progress?
+ readonly isMutatingPosts = injectIsMutating({ mutationKey: ['posts'] })
+}
+```
diff --git a/docs/framework/angular/reference/functions/injectIsRestoring.md b/docs/framework/angular/reference/functions/injectIsRestoring.md
index ad73d94c696..b225be8c414 100644
--- a/docs/framework/angular/reference/functions/injectIsRestoring.md
+++ b/docs/framework/angular/reference/functions/injectIsRestoring.md
@@ -3,15 +3,17 @@ id: injectIsRestoring
title: injectIsRestoring
---
-# Function: injectIsRestoring()
+
```ts
-function injectIsRestoring(options?): Signal;
+function injectIsRestoring(options?: InjectIsRestoringOptions): Signal;
```
-Defined in: [inject-is-restoring.ts:32](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-restoring.ts#L32)
+Defined in: [packages/angular-query-experimental/src/inject-is-restoring.ts:35](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/inject-is-restoring.ts#L35)
-Injects a signal that tracks whether a restore is currently in progress. [injectQuery](injectQuery.md) and friends also check this internally to avoid race conditions between the restore and initializing queries.
+Injects a signal that tracks whether a restore (e.g. from a persisted client, wired up via
+`provideIsRestoring`) is currently in progress. `injectQuery` and friends also check this internally to
+avoid race conditions between the restore and initializing queries.
## Parameters
@@ -19,10 +21,11 @@ Injects a signal that tracks whether a restore is currently in progress. [inject
`InjectIsRestoringOptions`
-Options for injectIsRestoring.
+Additional configuration
## Returns
`Signal`\<`boolean`\>
-readonly signal with boolean that indicates whether a restore is in progress.
+A readonly `Signal` โ `true` while a restore is in progress, `false` otherwise (the
+default when no `provideIsRestoring` provider is registered).
diff --git a/docs/framework/angular/reference/functions/injectMutation.md b/docs/framework/angular/reference/functions/injectMutation.md
index 5b4690eb464..1cc364b85e9 100644
--- a/docs/framework/angular/reference/functions/injectMutation.md
+++ b/docs/framework/angular/reference/functions/injectMutation.md
@@ -3,17 +3,16 @@ id: injectMutation
title: injectMutation
---
-# Function: injectMutation()
+
```ts
-function injectMutation(injectMutationFn, options?): CreateMutationResult;
+function injectMutation