Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

HydrateOptions.md

20 lines1.2 KB

1---
2id: HydrateOptions
3title: HydrateOptions
4---
5​
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7​
8Defined in: [packages/query-core/src/hydration.ts:68](https://github.com/TanStack/query/blob/main/packages/query-core/src/hydration.ts#L68)
9​
10Options for `hydrate`, controlling the default options applied to queries/mutations restored from a
11`DehydratedState`, and how to reverse any transformation applied by `DehydrateOptions.serializeData`.
12​
13## Properties
14​
15| Property | Type | Description |
16| ------ | ------ | ------ |
17| <a id="property-defaultoptions"></a> `defaultOptions?` | `object` | Options applied to the queries and mutations restored from the dehydrated state. |
18| `defaultOptions.deserializeData?` | `TransformerFn` | Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. |
19| `defaultOptions.mutations?` | `MutationOptions`\<`unknown`, `Error`, `unknown`, `unknown`\> | Default options merged into every mutation restored from the dehydrated state. |
20| `defaultOptions.queries?` | `QueryOptions`\<`unknown`, `Error`, `unknown`, readonly `unknown`[], `never`\> | Default options merged into every query restored from the dehydrated state. |