Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/framework/angular/reference/functions/dehydrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,30 @@ falling back to the client's `dehydrate` default options, and finally to `defaul

[`DehydrateOptions`](../interfaces/DehydrateOptions.md) = `{}`

<a id="options-properties"></a>

#### `options` properties

| Property | Type | Description |
| ------ | ------ | ------ |
| <a id="options-serializedata"></a> `serializeData?` | `TransformerFn` | Transforms a query's `data` before it is dehydrated. Useful for non-JSON-serializable data. |
| <a id="options-shoulddehydratemutation"></a> `shouldDehydrateMutation?` | (`mutation`: [`Mutation`](../classes/Mutation.md)) => `boolean` | Predicate to decide whether a given `Mutation` should be dehydrated. Defaults to `defaultShouldDehydrateMutation`. |
| <a id="options-shoulddehydratequery"></a> `shouldDehydrateQuery?` | (`query`: [`Query`](../classes/Query.md)) => `boolean` | Predicate to decide whether a given `Query` should be dehydrated. Defaults to `defaultShouldDehydrateQuery`. |
| <a id="options-shouldredacterrors"></a> `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)

<a id="result-properties"></a>

### Result properties

| Property | Type |
| ------ | ------ |
| <a id="result-mutations"></a> `mutations` | `DehydratedMutation`[] |
| <a id="result-queries"></a> `queries` | `DehydratedQuery`[] |

## Example

```ts
Expand Down
17 changes: 17 additions & 0 deletions docs/framework/angular/reference/functions/hydrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,27 @@ promise, it is resumed via `query.fetch()` (reusing that promise as `initialProm

`Partial`\<[`DehydratedState`](../interfaces/DehydratedState.md)\>

<a id="dehydratedState-properties"></a>

#### `dehydratedState` properties

Built from [`DehydratedState`](../interfaces/DehydratedState.md#properties). See the type above for what it changes.

### options?

[`HydrateOptions`](../interfaces/HydrateOptions.md)

<a id="options-properties"></a>

#### `options` properties

| Property | Type | Description |
| ------ | ------ | ------ |
| <a id="options-defaultoptions"></a> `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`
Expand Down
43 changes: 43 additions & 0 deletions docs/framework/angular/reference/functions/infiniteQueryOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@ id: infiniteQueryOptions
title: infiniteQueryOptions
---

## Overview

```ts
function infiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>(options: DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>): CreateInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & object & QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData, unknown>, TError>;
function infiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>(options: UnusedSkipTokenInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>): OmitKeyof<CreateInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, "queryFn"> & object & QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData, unknown>, TError>;
function infiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>(options: UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>): CreateInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & object & QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData, unknown>, TError>;
```

- [`DefinedInitialDataInfiniteOptions` β†’ `CreateInfiniteQueryOptions`](#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` β†’ `OmitKeyof`](#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` β†’ `CreateInfiniteQueryOptions`](#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.

See also: [Parameters](#parameters-summary) Β· [Returns](#returns-summary)

<a id="call-signature-1"></a>

## Call Signature

```ts
Expand Down Expand Up @@ -94,6 +110,8 @@ export class Projects {
}
```

<a id="call-signature-2"></a>

## Call Signature

```ts
Expand Down Expand Up @@ -189,6 +207,8 @@ export class Comments {

[injectInfiniteQuery](injectInfiniteQuery.md) to run an infinite query with these options.

<a id="call-signature-3"></a>

## Call Signature

```ts
Expand Down Expand Up @@ -283,3 +303,26 @@ export class Comments {
### See

[injectInfiniteQuery](injectInfiniteQuery.md) to run an infinite query with these options.

<a id="parameters-summary"></a>

## 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`.

<a id="options-properties"></a>

#### `options` properties

Built from [`CreateInfiniteQueryOptions`](../interfaces/CreateInfiniteQueryOptions.md#properties). See the type above for what it changes.

<a id="returns-summary"></a>

## Returns

The same options object, typed so that `queryKey` carries the inferred data type.
Loading
Loading