MCPcopy Create free account
hub / github.com/TanStack/query / dehydrateMutation

Function dehydrateMutation

packages/query-core/src/hydration.ts:120–127  ·  view source on GitHub ↗

* Dehydrates a single `Mutation` into a serializable snapshot of its key, state, scope, and meta. * @param mutation - The mutation to dehydrate. * @returns The dehydrated mutation.

(mutation: Mutation)

Source from the content-addressed store, hash-verified

118 * @returns The dehydrated mutation.
119 */
120function dehydrateMutation(mutation: Mutation): DehydratedMutation {
121 return {
122 mutationKey: mutation.options.mutationKey,
123 state: mutation.state,
124 ...(mutation.options.scope && { scope: mutation.options.scope }),
125 ...(mutation.meta && { meta: mutation.meta }),
126 }
127}
128
129/**
130 * Prepares the in-flight promise of a pending query for dehydration: applies `serializeData` to its

Callers 1

dehydrateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected