@tanstack/query-core 5.103.1 → 5.103.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/legacy/{classPrivateFieldSet2-CV7wyte-.js → classPrivateFieldSet2-CukOTU3U.js} +5 -5
- package/build/legacy/{classPrivateFieldSet2-Bo0ZyOIv.cjs → classPrivateFieldSet2-CvCEk6bM.cjs} +5 -5
- package/build/legacy/{classPrivateMethodInitSpec-CBwa_Y7C.js → classPrivateMethodInitSpec-CgB-WYk3.js} +2 -2
- package/build/legacy/{classPrivateMethodInitSpec-DVhcLejn.cjs → classPrivateMethodInitSpec-Nr6mgZRs.cjs} +2 -2
- package/build/legacy/focusManager.cjs +1 -1
- package/build/legacy/focusManager.d.cts +1 -1
- package/build/legacy/focusManager.d.ts +1 -1
- package/build/legacy/focusManager.js +1 -1
- package/build/legacy/{hydration-DwR10Hi-.d.cts → hydration-B9t5w6NC.d.ts} +167 -25
- package/build/legacy/hydration-B9t5w6NC.d.ts.map +1 -0
- package/build/legacy/{hydration-Cq7QYAzB.d.ts → hydration-Br9VIGXa.d.cts} +167 -25
- package/build/legacy/hydration-Br9VIGXa.d.cts.map +1 -0
- package/build/legacy/hydration.cjs.map +1 -1
- package/build/legacy/hydration.d.cts +1 -1
- package/build/legacy/hydration.d.ts +1 -1
- package/build/legacy/hydration.js.map +1 -1
- package/build/legacy/index.d.cts +1 -1
- package/build/legacy/index.d.ts +1 -1
- package/build/legacy/infiniteQueryBehavior.d.cts +1 -1
- package/build/legacy/infiniteQueryBehavior.d.ts +1 -1
- package/build/legacy/infiniteQueryObserver.d.cts +2 -2
- package/build/legacy/infiniteQueryObserver.d.ts +2 -2
- package/build/legacy/mutation.cjs +2 -2
- package/build/legacy/mutation.d.cts +1 -1
- package/build/legacy/mutation.d.ts +1 -1
- package/build/legacy/mutation.js +2 -2
- package/build/legacy/mutationCache.cjs +1 -1
- package/build/legacy/mutationCache.d.cts +1 -1
- package/build/legacy/mutationCache.d.ts +1 -1
- package/build/legacy/mutationCache.js +1 -1
- package/build/legacy/mutationObserver.cjs +2 -2
- package/build/legacy/mutationObserver.d.cts +1 -1
- package/build/legacy/mutationObserver.d.ts +1 -1
- package/build/legacy/mutationObserver.js +2 -2
- package/build/legacy/onlineManager.cjs +1 -1
- package/build/legacy/onlineManager.d.cts +1 -1
- package/build/legacy/onlineManager.d.ts +1 -1
- package/build/legacy/onlineManager.js +1 -1
- package/build/legacy/queriesObserver.cjs +2 -2
- package/build/legacy/queriesObserver.d.cts +2 -2
- package/build/legacy/queriesObserver.d.cts.map +1 -1
- package/build/legacy/queriesObserver.d.ts +2 -2
- package/build/legacy/queriesObserver.d.ts.map +1 -1
- package/build/legacy/queriesObserver.js +2 -2
- package/build/legacy/query.cjs +2 -2
- package/build/legacy/query.cjs.map +1 -1
- package/build/legacy/query.d.cts +1 -1
- package/build/legacy/query.d.ts +1 -1
- package/build/legacy/query.js +2 -2
- package/build/legacy/query.js.map +1 -1
- package/build/legacy/queryCache.cjs +3 -4
- package/build/legacy/queryCache.cjs.map +1 -1
- package/build/legacy/queryCache.d.cts +1 -1
- package/build/legacy/queryCache.d.ts +1 -1
- package/build/legacy/queryCache.js +3 -4
- package/build/legacy/queryCache.js.map +1 -1
- package/build/legacy/queryClient.cjs +8 -1
- package/build/legacy/queryClient.cjs.map +1 -1
- package/build/legacy/queryClient.d.cts +1 -1
- package/build/legacy/queryClient.d.ts +1 -1
- package/build/legacy/queryClient.js +8 -1
- package/build/legacy/queryClient.js.map +1 -1
- package/build/legacy/queryObserver.cjs +2 -2
- package/build/legacy/queryObserver.cjs.map +1 -1
- package/build/legacy/queryObserver.d.cts +1 -1
- package/build/legacy/queryObserver.d.ts +1 -1
- package/build/legacy/queryObserver.js +2 -2
- package/build/legacy/queryObserver.js.map +1 -1
- package/build/legacy/removable-0GzhW1PK.d.cts +22 -0
- package/build/legacy/removable-0GzhW1PK.d.cts.map +1 -0
- package/build/legacy/removable-0GzhW1PK.d.ts +22 -0
- package/build/legacy/removable-0GzhW1PK.d.ts.map +1 -0
- package/build/legacy/removable.cjs +10 -1
- package/build/legacy/removable.cjs.map +1 -1
- package/build/legacy/removable.d.cts +1 -1
- package/build/legacy/removable.d.ts +1 -1
- package/build/legacy/removable.js +10 -1
- package/build/legacy/removable.js.map +1 -1
- package/build/legacy/retryer.cjs.map +1 -1
- package/build/legacy/retryer.d.cts +1 -1
- package/build/legacy/retryer.d.ts +1 -1
- package/build/legacy/retryer.js.map +1 -1
- package/build/legacy/streamedQuery.cjs +0 -7
- package/build/legacy/streamedQuery.cjs.map +1 -1
- package/build/legacy/streamedQuery.d.cts +1 -8
- package/build/legacy/streamedQuery.d.cts.map +1 -1
- package/build/legacy/streamedQuery.d.ts +1 -8
- package/build/legacy/streamedQuery.d.ts.map +1 -1
- package/build/legacy/streamedQuery.js +0 -7
- package/build/legacy/streamedQuery.js.map +1 -1
- package/build/legacy/subscribable-CysQ0tne.d.cts +34 -0
- package/build/legacy/subscribable-CysQ0tne.d.cts.map +1 -0
- package/build/legacy/subscribable-CysQ0tne.d.ts +34 -0
- package/build/legacy/subscribable-CysQ0tne.d.ts.map +1 -0
- package/build/legacy/subscribable.cjs +22 -0
- package/build/legacy/subscribable.cjs.map +1 -1
- package/build/legacy/subscribable.d.cts +1 -1
- package/build/legacy/subscribable.d.ts +1 -1
- package/build/legacy/subscribable.js +22 -0
- package/build/legacy/subscribable.js.map +1 -1
- package/build/legacy/timeoutManager.cjs +1 -1
- package/build/legacy/timeoutManager.js +1 -1
- package/build/legacy/types.cjs.map +1 -1
- package/build/legacy/types.d.cts +1 -1
- package/build/legacy/types.d.ts +1 -1
- package/build/legacy/types.js.map +1 -1
- package/build/legacy/utils.cjs.map +1 -1
- package/build/legacy/utils.d.cts +1 -1
- package/build/legacy/utils.d.ts +1 -1
- package/build/legacy/utils.js.map +1 -1
- package/build/modern/focusManager.cjs.map +1 -1
- package/build/modern/focusManager.d.cts +1 -1
- package/build/modern/focusManager.d.ts +1 -1
- package/build/modern/focusManager.js.map +1 -1
- package/build/modern/{hydration-DwR10Hi-.d.cts → hydration-B9t5w6NC.d.ts} +167 -25
- package/build/modern/hydration-B9t5w6NC.d.ts.map +1 -0
- package/build/modern/{hydration-Cq7QYAzB.d.ts → hydration-Br9VIGXa.d.cts} +167 -25
- package/build/modern/hydration-Br9VIGXa.d.cts.map +1 -0
- package/build/modern/hydration.cjs.map +1 -1
- package/build/modern/hydration.d.cts +1 -1
- package/build/modern/hydration.d.ts +1 -1
- package/build/modern/hydration.js.map +1 -1
- package/build/modern/index.d.cts +1 -1
- package/build/modern/index.d.ts +1 -1
- package/build/modern/infiniteQueryBehavior.d.cts +1 -1
- package/build/modern/infiniteQueryBehavior.d.ts +1 -1
- package/build/modern/infiniteQueryObserver.d.cts +2 -2
- package/build/modern/infiniteQueryObserver.d.ts +2 -2
- package/build/modern/mutation.cjs.map +1 -1
- package/build/modern/mutation.d.cts +1 -1
- package/build/modern/mutation.d.ts +1 -1
- package/build/modern/mutation.js.map +1 -1
- package/build/modern/mutationCache.cjs.map +1 -1
- package/build/modern/mutationCache.d.cts +1 -1
- package/build/modern/mutationCache.d.ts +1 -1
- package/build/modern/mutationCache.js.map +1 -1
- package/build/modern/mutationObserver.cjs.map +1 -1
- package/build/modern/mutationObserver.d.cts +1 -1
- package/build/modern/mutationObserver.d.ts +1 -1
- package/build/modern/mutationObserver.js.map +1 -1
- package/build/modern/onlineManager.cjs.map +1 -1
- package/build/modern/onlineManager.d.cts +1 -1
- package/build/modern/onlineManager.d.ts +1 -1
- package/build/modern/onlineManager.js.map +1 -1
- package/build/modern/queriesObserver.cjs.map +1 -1
- package/build/modern/queriesObserver.d.cts +2 -2
- package/build/modern/queriesObserver.d.cts.map +1 -1
- package/build/modern/queriesObserver.d.ts +2 -2
- package/build/modern/queriesObserver.d.ts.map +1 -1
- package/build/modern/queriesObserver.js.map +1 -1
- package/build/modern/query.cjs.map +1 -1
- package/build/modern/query.d.cts +1 -1
- package/build/modern/query.d.ts +1 -1
- package/build/modern/query.js.map +1 -1
- package/build/modern/queryCache.cjs +2 -3
- package/build/modern/queryCache.cjs.map +1 -1
- package/build/modern/queryCache.d.cts +1 -1
- package/build/modern/queryCache.d.ts +1 -1
- package/build/modern/queryCache.js +2 -3
- package/build/modern/queryCache.js.map +1 -1
- package/build/modern/queryClient.cjs +7 -0
- package/build/modern/queryClient.cjs.map +1 -1
- package/build/modern/queryClient.d.cts +1 -1
- package/build/modern/queryClient.d.ts +1 -1
- package/build/modern/queryClient.js +7 -0
- package/build/modern/queryClient.js.map +1 -1
- package/build/modern/queryObserver.cjs.map +1 -1
- package/build/modern/queryObserver.d.cts +1 -1
- package/build/modern/queryObserver.d.ts +1 -1
- package/build/modern/queryObserver.js.map +1 -1
- package/build/modern/removable-0GzhW1PK.d.cts +22 -0
- package/build/modern/removable-0GzhW1PK.d.cts.map +1 -0
- package/build/modern/removable-0GzhW1PK.d.ts +22 -0
- package/build/modern/removable-0GzhW1PK.d.ts.map +1 -0
- package/build/modern/removable.cjs +9 -0
- package/build/modern/removable.cjs.map +1 -1
- package/build/modern/removable.d.cts +1 -1
- package/build/modern/removable.d.ts +1 -1
- package/build/modern/removable.js +9 -0
- package/build/modern/removable.js.map +1 -1
- package/build/modern/retryer.cjs.map +1 -1
- package/build/modern/retryer.d.cts +1 -1
- package/build/modern/retryer.d.ts +1 -1
- package/build/modern/retryer.js.map +1 -1
- package/build/modern/streamedQuery.cjs +0 -7
- package/build/modern/streamedQuery.cjs.map +1 -1
- package/build/modern/streamedQuery.d.cts +1 -8
- package/build/modern/streamedQuery.d.cts.map +1 -1
- package/build/modern/streamedQuery.d.ts +1 -8
- package/build/modern/streamedQuery.d.ts.map +1 -1
- package/build/modern/streamedQuery.js +0 -7
- package/build/modern/streamedQuery.js.map +1 -1
- package/build/modern/subscribable-CysQ0tne.d.cts +34 -0
- package/build/modern/subscribable-CysQ0tne.d.cts.map +1 -0
- package/build/modern/subscribable-CysQ0tne.d.ts +34 -0
- package/build/modern/subscribable-CysQ0tne.d.ts.map +1 -0
- package/build/modern/subscribable.cjs +22 -0
- package/build/modern/subscribable.cjs.map +1 -1
- package/build/modern/subscribable.d.cts +1 -1
- package/build/modern/subscribable.d.ts +1 -1
- package/build/modern/subscribable.js +22 -0
- package/build/modern/subscribable.js.map +1 -1
- package/build/modern/timeoutManager.cjs.map +1 -1
- package/build/modern/timeoutManager.js.map +1 -1
- package/build/modern/types.cjs.map +1 -1
- package/build/modern/types.d.cts +1 -1
- package/build/modern/types.d.ts +1 -1
- package/build/modern/types.js.map +1 -1
- package/build/modern/utils.cjs.map +1 -1
- package/build/modern/utils.d.cts +1 -1
- package/build/modern/utils.d.ts +1 -1
- package/build/modern/utils.js.map +1 -1
- package/package.json +3 -3
- package/src/hydration.ts +1 -0
- package/src/query.ts +1 -2
- package/src/queryCache.ts +3 -8
- package/src/queryClient.ts +7 -0
- package/src/queryObserver.ts +4 -8
- package/src/removable.ts +9 -0
- package/src/retryer.ts +4 -0
- package/src/streamedQuery.ts +0 -7
- package/src/subscribable.ts +22 -0
- package/src/types.ts +159 -35
- package/src/utils.ts +1 -1
- package/build/legacy/hydration-Cq7QYAzB.d.ts.map +0 -1
- package/build/legacy/hydration-DwR10Hi-.d.cts.map +0 -1
- package/build/legacy/removable-DeMjhW5M.d.cts +0 -13
- package/build/legacy/removable-DeMjhW5M.d.cts.map +0 -1
- package/build/legacy/removable-DeMjhW5M.d.ts +0 -13
- package/build/legacy/removable-DeMjhW5M.d.ts.map +0 -1
- package/build/legacy/subscribable-CbifVTKz.d.cts +0 -12
- package/build/legacy/subscribable-CbifVTKz.d.cts.map +0 -1
- package/build/legacy/subscribable-CbifVTKz.d.ts +0 -12
- package/build/legacy/subscribable-CbifVTKz.d.ts.map +0 -1
- package/build/modern/hydration-Cq7QYAzB.d.ts.map +0 -1
- package/build/modern/hydration-DwR10Hi-.d.cts.map +0 -1
- package/build/modern/removable-DeMjhW5M.d.cts +0 -13
- package/build/modern/removable-DeMjhW5M.d.cts.map +0 -1
- package/build/modern/removable-DeMjhW5M.d.ts +0 -13
- package/build/modern/removable-DeMjhW5M.d.ts.map +0 -1
- package/build/modern/subscribable-CbifVTKz.d.cts +0 -12
- package/build/modern/subscribable-CbifVTKz.d.cts.map +0 -1
- package/build/modern/subscribable-CbifVTKz.d.ts +0 -12
- package/build/modern/subscribable-CbifVTKz.d.ts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as Subscribable } from "./subscribable-
|
|
2
|
-
import { t as Removable } from "./removable-
|
|
1
|
+
import { t as Subscribable } from "./subscribable-CysQ0tne.cjs";
|
|
2
|
+
import { t as Removable } from "./removable-0GzhW1PK.cjs";
|
|
3
3
|
//#region src/queryObserver.d.ts
|
|
4
4
|
type QueryObserverListener<TData, TError> = (result: QueryObserverResult<TData, TError>) => void;
|
|
5
5
|
interface ObserverFetchOptions extends FetchOptions {
|
|
@@ -870,7 +870,7 @@ interface QueryFilters<TQueryKey extends QueryKey = QueryKey> {
|
|
|
870
870
|
/**
|
|
871
871
|
* Filter to active queries, inactive queries or all queries
|
|
872
872
|
*
|
|
873
|
-
*
|
|
873
|
+
* @defaultValue 'all'
|
|
874
874
|
*/
|
|
875
875
|
type?: QueryTypeFilter;
|
|
876
876
|
/**
|
|
@@ -1329,6 +1329,7 @@ declare class QueryClient {
|
|
|
1329
1329
|
* Hint: Do not use this function inside a component, because it won't receive updates.
|
|
1330
1330
|
* Use `useQuery` to create a `QueryObserver` that subscribes to changes.
|
|
1331
1331
|
*
|
|
1332
|
+
* @returns The cached data for the query, or `undefined` if no query with this key has been observed yet.
|
|
1332
1333
|
* @see {@link QueryClient#getQueriesData}
|
|
1333
1334
|
*/
|
|
1334
1335
|
getQueryData<TQueryFnData = unknown, TTaggedQueryKey extends QueryKey = QueryKey, TInferredQueryFnData = InferDataFromTag<TQueryFnData, TTaggedQueryKey>>(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined;
|
|
@@ -1347,6 +1348,7 @@ declare class QueryClient {
|
|
|
1347
1348
|
* every matched query holds the same shape — it is not checked against the actual cache
|
|
1348
1349
|
* contents.
|
|
1349
1350
|
*
|
|
1351
|
+
* @returns An array of query key and data pairs. The data is `undefined` for a query with no cached data.
|
|
1350
1352
|
* @see {@link QueryClient#getQueryData}
|
|
1351
1353
|
* @example
|
|
1352
1354
|
* ```ts
|
|
@@ -1366,6 +1368,9 @@ declare class QueryClient {
|
|
|
1366
1368
|
* @param queryKey - The query key to set data for.
|
|
1367
1369
|
* @param updater - Either the new data, or a function that receives the current data (which
|
|
1368
1370
|
* may be `undefined`) and returns the new data.
|
|
1371
|
+
* @param options - Set `updatedAt` to override the timestamp the written data is recorded with.
|
|
1372
|
+
* @returns The data that was written, or `undefined` if the updater returned `undefined` — in that case
|
|
1373
|
+
* the write is skipped and the cache is left unchanged.
|
|
1369
1374
|
*
|
|
1370
1375
|
* @example
|
|
1371
1376
|
* ```ts
|
|
@@ -1382,6 +1387,8 @@ declare class QueryClient {
|
|
|
1382
1387
|
* filters are updated; no new cache entries are created. Internally this calls
|
|
1383
1388
|
* {@link QueryClient#setQueryData} for each matching query.
|
|
1384
1389
|
*
|
|
1390
|
+
* @returns One `[queryKey, data]` tuple per matched query, in the same shape and with the same
|
|
1391
|
+
* `undefined` case as {@link QueryClient#setQueryData}.
|
|
1385
1392
|
* @example
|
|
1386
1393
|
* ```ts
|
|
1387
1394
|
* queryClient.setQueriesData({ queryKey: ['posts'] }, (oldPosts) =>
|
|
@@ -1713,9 +1720,13 @@ interface Retryer<TData = unknown> {
|
|
|
1713
1720
|
start: () => Promise<TData>;
|
|
1714
1721
|
status: () => 'pending' | 'resolved' | 'rejected';
|
|
1715
1722
|
}
|
|
1723
|
+
/** @inline */
|
|
1716
1724
|
type RetryValue<TError> = boolean | number | ShouldRetryFunction<TError>;
|
|
1725
|
+
/** @inline */
|
|
1717
1726
|
type ShouldRetryFunction<TError = DefaultError> = (failureCount: number, error: TError) => boolean;
|
|
1727
|
+
/** @inline */
|
|
1718
1728
|
type RetryDelayValue<TError> = number | RetryDelayFunction<TError>;
|
|
1729
|
+
/** @inline */
|
|
1719
1730
|
type RetryDelayFunction<TError = DefaultError> = (failureCount: number, error: TError) => number;
|
|
1720
1731
|
declare function canFetch(networkMode: NetworkMode | undefined): boolean;
|
|
1721
1732
|
/**
|
|
@@ -1750,12 +1761,39 @@ declare function createRetryer<TData = unknown, TError = DefaultError>(config: R
|
|
|
1750
1761
|
//#region src/types.d.ts
|
|
1751
1762
|
type NonUndefinedGuard<T> = T extends undefined ? never : T;
|
|
1752
1763
|
type DistributiveOmit<TObject, TKey extends keyof TObject> = TObject extends any ? Omit<TObject, TKey> : never;
|
|
1753
|
-
type OmitKeyof<TObject, TKey extends TStrictly extends 'safely' ? keyof TObject | (string & Record<never, never>) | (number & Record<never, never>) | (symbol & Record<never, never>) : keyof TObject, TStrictly extends 'strictly' | 'safely' = 'strictly'> = Omit<TObject, TKey>;
|
|
1764
|
+
type OmitKeyof<TObject, TKey extends (TStrictly extends 'safely' ? keyof TObject | (string & Record<never, never>) | (number & Record<never, never>) | (symbol & Record<never, never>) : keyof TObject), TStrictly extends 'strictly' | 'safely' = 'strictly'> = Omit<TObject, TKey>;
|
|
1754
1765
|
type Override<TTargetA, TTargetB> = { [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey]; };
|
|
1766
|
+
/**
|
|
1767
|
+
* The interface to augment via declaration merging to override Query's default types repository-wide.
|
|
1768
|
+
* Each field it declares replaces the default of the matching type: `defaultError` for {@link DefaultError},
|
|
1769
|
+
* `queryKey` for {@link QueryKey}, `mutationKey` for {@link MutationKey}, `queryMeta` for {@link QueryMeta} and
|
|
1770
|
+
* `mutationMeta` for {@link MutationMeta}. Leave a field out to keep that type's default.
|
|
1771
|
+
* Augment the module you install — `@tanstack/react-query`, `@tanstack/vue-query`,
|
|
1772
|
+
* `@tanstack/solid-query`, `@tanstack/svelte-query`, `@tanstack/preact-query`,
|
|
1773
|
+
* `@tanstack/angular-query-experimental` or `@tanstack/lit-query`. Augmenting `@tanstack/query-core`
|
|
1774
|
+
* works too and covers every adapter at once.
|
|
1775
|
+
* @example
|
|
1776
|
+
* ```ts
|
|
1777
|
+
* // Use the module you installed — here, the React adapter.
|
|
1778
|
+
* declare module '@tanstack/react-query' {
|
|
1779
|
+
* interface Register {
|
|
1780
|
+
* defaultError: AxiosError
|
|
1781
|
+
* }
|
|
1782
|
+
* }
|
|
1783
|
+
* ```
|
|
1784
|
+
*/
|
|
1755
1785
|
interface Register {}
|
|
1786
|
+
/**
|
|
1787
|
+
* The error type used wherever an error is not given an explicit type parameter.
|
|
1788
|
+
* Defaults to `Error`; declare `defaultError` on {@link Register} to change it everywhere at once.
|
|
1789
|
+
*/
|
|
1756
1790
|
type DefaultError = Register extends {
|
|
1757
1791
|
defaultError: infer TError;
|
|
1758
1792
|
} ? TError : Error;
|
|
1793
|
+
/**
|
|
1794
|
+
* The type of a query key — the serializable array that identifies a query in the cache.
|
|
1795
|
+
* Defaults to `ReadonlyArray<unknown>`; declare `queryKey` on {@link Register} to narrow it repository-wide.
|
|
1796
|
+
*/
|
|
1759
1797
|
type QueryKey = Register extends {
|
|
1760
1798
|
queryKey: infer TQueryKey;
|
|
1761
1799
|
} ? TQueryKey extends ReadonlyArray<unknown> ? TQueryKey : TQueryKey extends Array<unknown> ? TQueryKey : ReadonlyArray<unknown> : ReadonlyArray<unknown>;
|
|
@@ -1778,10 +1816,15 @@ type QueryKeyWithDataTag<TQueryKey extends QueryKey = QueryKey, TQueryFnData = u
|
|
|
1778
1816
|
};
|
|
1779
1817
|
type InferDataFromTag<TQueryFnData, TTaggedQueryKey extends QueryKey> = TTaggedQueryKey extends DataTag<unknown, infer TaggedValue, unknown> ? TaggedValue : TQueryFnData;
|
|
1780
1818
|
type InferErrorFromTag<TError, TTaggedQueryKey extends QueryKey> = TTaggedQueryKey extends DataTag<unknown, unknown, infer TaggedError> ? TaggedError extends UnsetMarker ? TError : TaggedError : TError;
|
|
1819
|
+
/** @inline */
|
|
1781
1820
|
type QueryFunction<T = unknown, TQueryKey extends QueryKey = QueryKey, TPageParam = never> = (context: QueryFunctionContext<TQueryKey, TPageParam>) => T | Promise<T>;
|
|
1821
|
+
/** @inline */
|
|
1782
1822
|
type StaleTime = number | 'static';
|
|
1823
|
+
/** @inline */
|
|
1783
1824
|
type StaleTimeFunction<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = StaleTime | ((query: Query<TQueryFnData, TError, TData, TQueryKey>) => StaleTime);
|
|
1825
|
+
/** @inline */
|
|
1784
1826
|
type QueryBooleanOption<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = boolean | ((query: Query<TQueryFnData, TError, TData, TQueryKey>) => boolean);
|
|
1827
|
+
/** @inline */
|
|
1785
1828
|
type QueryPersister<T = unknown, TQueryKey extends QueryKey = QueryKey, TPageParam = never> = [TPageParam] extends [never] ? (queryFn: QueryFunction<T, TQueryKey, never>, context: QueryFunctionContext<TQueryKey>, query: Query) => T | Promise<T> : (queryFn: QueryFunction<T, TQueryKey, TPageParam>, context: QueryFunctionContext<TQueryKey>, query: Query) => T | Promise<T>;
|
|
1786
1829
|
type QueryFunctionContext<TQueryKey extends QueryKey = QueryKey, TPageParam = never> = [TPageParam] extends [never] ? {
|
|
1787
1830
|
client: QueryClient;
|
|
@@ -1806,21 +1849,36 @@ type QueryFunctionContext<TQueryKey extends QueryKey = QueryKey, TPageParam = ne
|
|
|
1806
1849
|
direction: FetchDirection;
|
|
1807
1850
|
meta: QueryMeta | undefined;
|
|
1808
1851
|
};
|
|
1852
|
+
/** @inline */
|
|
1809
1853
|
type InitialDataFunction<T> = () => T | undefined;
|
|
1810
1854
|
type NonFunctionGuard<T> = T extends Function ? never : T;
|
|
1855
|
+
/** @inline */
|
|
1811
1856
|
type PlaceholderDataFunction<TQueryFnData = unknown, TError = DefaultError, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = (previousData: TQueryData | undefined, previousQuery: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined) => TQueryData | undefined;
|
|
1812
1857
|
type QueriesPlaceholderDataFunction<TQueryData> = (previousData: undefined, previousQuery: undefined) => TQueryData | undefined;
|
|
1858
|
+
/** @inline */
|
|
1813
1859
|
type QueryKeyHashFunction<TQueryKey extends QueryKey> = (queryKey: TQueryKey) => string;
|
|
1860
|
+
/** @inline */
|
|
1814
1861
|
type GetPreviousPageParamFunction<TPageParam, TQueryFnData = unknown> = (firstPage: TQueryFnData, allPages: Array<TQueryFnData>, firstPageParam: TPageParam, allPageParams: Array<TPageParam>) => TPageParam | undefined | null;
|
|
1862
|
+
/** @inline */
|
|
1815
1863
|
type GetNextPageParamFunction<TPageParam, TQueryFnData = unknown> = (lastPage: TQueryFnData, allPages: Array<TQueryFnData>, lastPageParam: TPageParam, allPageParams: Array<TPageParam>) => TPageParam | undefined | null;
|
|
1864
|
+
/**
|
|
1865
|
+
* The data shape of an infinite query: every page fetched so far, plus the page param each one was fetched with.
|
|
1866
|
+
* `pages` and `pageParams` are index-aligned — `pageParams[i]` is the param that produced `pages[i]`.
|
|
1867
|
+
*/
|
|
1816
1868
|
interface InfiniteData<TData, TPageParam = unknown> {
|
|
1817
1869
|
pages: Array<TData>;
|
|
1818
1870
|
pageParams: Array<TPageParam>;
|
|
1819
1871
|
}
|
|
1872
|
+
/**
|
|
1873
|
+
* The type of the `meta` object that can be attached to a query and read back from `queryFn`, callbacks and
|
|
1874
|
+
* cache-level handlers. Defaults to `Record<string, unknown>`; declare `queryMeta` on {@link Register} to narrow it.
|
|
1875
|
+
*/
|
|
1820
1876
|
type QueryMeta = Register extends {
|
|
1821
1877
|
queryMeta: infer TQueryMeta;
|
|
1822
1878
|
} ? TQueryMeta extends Record<string, unknown> ? TQueryMeta : Record<string, unknown> : Record<string, unknown>;
|
|
1879
|
+
/** @inline */
|
|
1823
1880
|
type NetworkMode = 'online' | 'always' | 'offlineFirst';
|
|
1881
|
+
/** @inline */
|
|
1824
1882
|
type NotifyOnChangeProps = Array<keyof InfiniteQueryObserverResult> | 'all' | undefined | (() => Array<keyof InfiniteQueryObserverResult> | 'all' | undefined);
|
|
1825
1883
|
interface QueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = never> {
|
|
1826
1884
|
/**
|
|
@@ -1847,7 +1905,7 @@ interface QueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQ
|
|
|
1847
1905
|
/**
|
|
1848
1906
|
* Controls whether a query is allowed to run based on the current network connectivity.
|
|
1849
1907
|
*
|
|
1850
|
-
*
|
|
1908
|
+
* @defaultValue 'online'
|
|
1851
1909
|
* @see [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information.
|
|
1852
1910
|
*/
|
|
1853
1911
|
networkMode?: NetworkMode;
|
|
@@ -1913,7 +1971,7 @@ interface QueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQ
|
|
|
1913
1971
|
* Set this to `false` to disable structural sharing between query results.
|
|
1914
1972
|
* 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.
|
|
1915
1973
|
*
|
|
1916
|
-
*
|
|
1974
|
+
* @defaultValue true
|
|
1917
1975
|
*/
|
|
1918
1976
|
structuralSharing?: boolean | ((oldData: unknown | undefined, newData: unknown) => unknown);
|
|
1919
1977
|
/** @internal */
|
|
@@ -1931,6 +1989,13 @@ interface QueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQ
|
|
|
1931
1989
|
maxPages?: number;
|
|
1932
1990
|
}
|
|
1933
1991
|
interface InitialPageParam<TPageParam = unknown> {
|
|
1992
|
+
/**
|
|
1993
|
+
* The page param to start from when an infinite query has no pages yet.
|
|
1994
|
+
* It is passed to `queryFn` as `pageParam` for the first page; every page after that gets the
|
|
1995
|
+
* value returned by `getNextPageParam` or `getPreviousPageParam`.
|
|
1996
|
+
* It only applies while the query has no pages: once a first page exists, refetching starts from
|
|
1997
|
+
* that page's own param instead.
|
|
1998
|
+
*/
|
|
1934
1999
|
initialPageParam: TPageParam;
|
|
1935
2000
|
}
|
|
1936
2001
|
interface InfiniteQueryPageParamsOptions<TQueryFnData = unknown, TPageParam = unknown> extends InitialPageParam<TPageParam> {
|
|
@@ -1945,6 +2010,7 @@ interface InfiniteQueryPageParamsOptions<TQueryFnData = unknown, TPageParam = un
|
|
|
1945
2010
|
*/
|
|
1946
2011
|
getNextPageParam: GetNextPageParamFunction<TPageParam, TQueryFnData>;
|
|
1947
2012
|
}
|
|
2013
|
+
/** @inline */
|
|
1948
2014
|
type ThrowOnError<TQueryFnData, TError, TQueryData, TQueryKey extends QueryKey> = boolean | ((error: TError, query: Query<TQueryFnData, TError, TQueryData, TQueryKey>) => boolean);
|
|
1949
2015
|
interface QueryObserverOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = never> extends WithRequired<QueryOptions<TQueryFnData, TError, TQueryData, TQueryKey, TPageParam>, 'queryKey'> {
|
|
1950
2016
|
/**
|
|
@@ -1952,7 +2018,7 @@ interface QueryObserverOptions<TQueryFnData = unknown, TError = DefaultError, TD
|
|
|
1952
2018
|
* To refetch the query, use the `refetch` method returned from the `useQuery` instance.
|
|
1953
2019
|
* Accepts a boolean or function that returns a boolean.
|
|
1954
2020
|
*
|
|
1955
|
-
*
|
|
2021
|
+
* @defaultValue true
|
|
1956
2022
|
*/
|
|
1957
2023
|
enabled?: QueryBooleanOption<TQueryFnData, TError, TQueryData, TQueryKey>;
|
|
1958
2024
|
/**
|
|
@@ -1961,20 +2027,20 @@ interface QueryObserverOptions<TQueryFnData = unknown, TError = DefaultError, TD
|
|
|
1961
2027
|
* If set to `'static'`, the data will never be considered stale.
|
|
1962
2028
|
* If set to a function, the function will be executed with the query to compute a `staleTime`.
|
|
1963
2029
|
*
|
|
1964
|
-
*
|
|
2030
|
+
* @defaultValue 0
|
|
1965
2031
|
*/
|
|
1966
2032
|
staleTime?: StaleTimeFunction<TQueryFnData, TError, TQueryData, TQueryKey>;
|
|
1967
2033
|
/**
|
|
1968
2034
|
* If set to a number, the query will continuously refetch at this frequency in milliseconds.
|
|
1969
2035
|
* If set to a function, the function will be executed with the latest data and query to compute a frequency
|
|
1970
2036
|
*
|
|
1971
|
-
*
|
|
2037
|
+
* @defaultValue false
|
|
1972
2038
|
*/
|
|
1973
2039
|
refetchInterval?: number | false | ((query: Query<TQueryFnData, TError, TQueryData, TQueryKey>) => number | false | undefined);
|
|
1974
2040
|
/**
|
|
1975
2041
|
* If set to `true`, the query will continue to refetch while their tab/window is in the background.
|
|
1976
2042
|
*
|
|
1977
|
-
*
|
|
2043
|
+
* @defaultValue false
|
|
1978
2044
|
*/
|
|
1979
2045
|
refetchIntervalInBackground?: boolean;
|
|
1980
2046
|
/**
|
|
@@ -1983,7 +2049,7 @@ interface QueryObserverOptions<TQueryFnData = unknown, TError = DefaultError, TD
|
|
|
1983
2049
|
* If set to `'always'`, the query will always refetch on window focus (except when `staleTime: 'static'` is used).
|
|
1984
2050
|
* If set to a function, the function will be executed with the latest data and query to compute the value.
|
|
1985
2051
|
*
|
|
1986
|
-
*
|
|
2052
|
+
* @defaultValue true
|
|
1987
2053
|
*/
|
|
1988
2054
|
refetchOnWindowFocus?: boolean | 'always' | ((query: Query<TQueryFnData, TError, TQueryData, TQueryKey>) => boolean | 'always');
|
|
1989
2055
|
/**
|
|
@@ -2001,14 +2067,14 @@ interface QueryObserverOptions<TQueryFnData = unknown, TError = DefaultError, TD
|
|
|
2001
2067
|
* If set to `'always'`, the query will always refetch on mount (except when `staleTime: 'static'` is used).
|
|
2002
2068
|
* If set to a function, the function will be executed with the latest data and query to compute the value
|
|
2003
2069
|
*
|
|
2004
|
-
*
|
|
2070
|
+
* @defaultValue true
|
|
2005
2071
|
*/
|
|
2006
2072
|
refetchOnMount?: boolean | 'always' | ((query: Query<TQueryFnData, TError, TQueryData, TQueryKey>) => boolean | 'always');
|
|
2007
2073
|
/**
|
|
2008
2074
|
* If set to `false`, the query will not be retried on mount if it contains an error.
|
|
2009
2075
|
* If set to a function, the function will be executed with the query to compute the value.
|
|
2010
2076
|
*
|
|
2011
|
-
*
|
|
2077
|
+
* @defaultValue true
|
|
2012
2078
|
*/
|
|
2013
2079
|
retryOnMount?: QueryBooleanOption<TQueryFnData, TError, TQueryData, TQueryKey>;
|
|
2014
2080
|
/**
|
|
@@ -2027,7 +2093,7 @@ interface QueryObserverOptions<TQueryFnData = unknown, TError = DefaultError, TD
|
|
|
2027
2093
|
* If set to `false` and `suspense` is `false`, errors are returned as state.
|
|
2028
2094
|
* 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`).
|
|
2029
2095
|
*
|
|
2030
|
-
*
|
|
2096
|
+
* @defaultValue false
|
|
2031
2097
|
*/
|
|
2032
2098
|
throwOnError?: ThrowOnError<TQueryFnData, TError, TQueryData, TQueryKey>;
|
|
2033
2099
|
/**
|
|
@@ -2041,7 +2107,7 @@ interface QueryObserverOptions<TQueryFnData = unknown, TError = DefaultError, TD
|
|
|
2041
2107
|
* If set to `true`, the query will suspend when `status === 'pending'`
|
|
2042
2108
|
* and throw errors when `status === 'error'`.
|
|
2043
2109
|
*
|
|
2044
|
-
*
|
|
2110
|
+
* @defaultValue false
|
|
2045
2111
|
*/
|
|
2046
2112
|
suspense?: boolean;
|
|
2047
2113
|
/**
|
|
@@ -2057,6 +2123,10 @@ interface InfiniteQueryObserverOptions<TQueryFnData = unknown, TError = DefaultE
|
|
|
2057
2123
|
type DefaultedInfiniteQueryObserverOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = WithRequired<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>;
|
|
2058
2124
|
interface QueryExecuteOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TPageParam = never> extends WithRequired<QueryOptions<TQueryFnData, TError, TQueryData, TQueryKey, TPageParam>, 'queryKey'> {
|
|
2059
2125
|
initialPageParam?: never;
|
|
2126
|
+
/**
|
|
2127
|
+
* This option can be used to transform or select a part of the data returned by the query function. It affects
|
|
2128
|
+
* the value this call resolves with, but does not affect what gets stored in the query cache.
|
|
2129
|
+
*/
|
|
2060
2130
|
select?: (data: TQueryData) => TData;
|
|
2061
2131
|
/**
|
|
2062
2132
|
* The time in milliseconds after data is considered stale.
|
|
@@ -2093,9 +2163,9 @@ type FetchInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TD
|
|
|
2093
2163
|
interface ResultOptions {
|
|
2094
2164
|
/**
|
|
2095
2165
|
* If set to `true`, the method throws if any of the underlying query refetch tasks fail.
|
|
2166
|
+
* If set to `false`, failed refetches are swallowed and not surfaced to the caller.
|
|
2096
2167
|
*
|
|
2097
|
-
*
|
|
2098
|
-
* caller.
|
|
2168
|
+
* @defaultValue false
|
|
2099
2169
|
*/
|
|
2100
2170
|
throwOnError?: boolean;
|
|
2101
2171
|
}
|
|
@@ -2105,7 +2175,7 @@ interface RefetchOptions extends ResultOptions {
|
|
|
2105
2175
|
*
|
|
2106
2176
|
* If set to `false`, no refetch will be made if there is already a request running.
|
|
2107
2177
|
*
|
|
2108
|
-
*
|
|
2178
|
+
* @defaultValue true
|
|
2109
2179
|
*/
|
|
2110
2180
|
cancelRefetch?: boolean;
|
|
2111
2181
|
}
|
|
@@ -2113,11 +2183,12 @@ interface InvalidateQueryFilters<TQueryKey extends QueryKey = QueryKey> extends
|
|
|
2113
2183
|
/**
|
|
2114
2184
|
* Controls which of the matched (now-invalidated) queries are refetched in the background.
|
|
2115
2185
|
*
|
|
2116
|
-
* Defaults to `'active'`.
|
|
2117
2186
|
* - `'active'`: only queries with at least one active observer are refetched.
|
|
2118
2187
|
* - `'inactive'`: only queries with no active observer are refetched.
|
|
2119
2188
|
* - `'all'`: every matched query is refetched, active or not.
|
|
2120
2189
|
* - `'none'`: no query is refetched; matched queries are only marked as invalidated.
|
|
2190
|
+
*
|
|
2191
|
+
* @defaultValue 'active'
|
|
2121
2192
|
*/
|
|
2122
2193
|
refetchType?: QueryTypeFilter | 'none';
|
|
2123
2194
|
}
|
|
@@ -2131,7 +2202,7 @@ interface FetchNextPageOptions extends ResultOptions {
|
|
|
2131
2202
|
*
|
|
2132
2203
|
* If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved.
|
|
2133
2204
|
*
|
|
2134
|
-
*
|
|
2205
|
+
* @defaultValue true
|
|
2135
2206
|
*/
|
|
2136
2207
|
cancelRefetch?: boolean;
|
|
2137
2208
|
}
|
|
@@ -2142,11 +2213,13 @@ interface FetchPreviousPageOptions extends ResultOptions {
|
|
|
2142
2213
|
*
|
|
2143
2214
|
* If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved.
|
|
2144
2215
|
*
|
|
2145
|
-
*
|
|
2216
|
+
* @defaultValue true
|
|
2146
2217
|
*/
|
|
2147
2218
|
cancelRefetch?: boolean;
|
|
2148
2219
|
}
|
|
2220
|
+
/** @inline */
|
|
2149
2221
|
type QueryStatus = 'pending' | 'error' | 'success';
|
|
2222
|
+
/** @inline */
|
|
2150
2223
|
type FetchStatus = 'fetching' | 'paused' | 'idle';
|
|
2151
2224
|
interface QueryObserverBaseResult<TData = unknown, TError = DefaultError> {
|
|
2152
2225
|
/**
|
|
@@ -2460,13 +2533,27 @@ interface InfiniteQueryObserverPlaceholderResult<TData = unknown, TError = Defau
|
|
|
2460
2533
|
}
|
|
2461
2534
|
type DefinedInfiniteQueryObserverResult<TData = unknown, TError = DefaultError> = InfiniteQueryObserverRefetchErrorResult<TData, TError> | InfiniteQueryObserverSuccessResult<TData, TError>;
|
|
2462
2535
|
type InfiniteQueryObserverResult<TData = unknown, TError = DefaultError> = DefinedInfiniteQueryObserverResult<TData, TError> | InfiniteQueryObserverLoadingErrorResult<TData, TError> | InfiniteQueryObserverLoadingResult<TData, TError> | InfiniteQueryObserverPendingResult<TData, TError> | InfiniteQueryObserverPlaceholderResult<TData, TError>;
|
|
2536
|
+
/**
|
|
2537
|
+
* The type of a mutation key — the serializable array used to identify and filter mutations.
|
|
2538
|
+
* Defaults to `ReadonlyArray<unknown>`; declare `mutationKey` on {@link Register} to narrow it repository-wide.
|
|
2539
|
+
*/
|
|
2463
2540
|
type MutationKey = Register extends {
|
|
2464
2541
|
mutationKey: infer TMutationKey;
|
|
2465
2542
|
} ? TMutationKey extends ReadonlyArray<unknown> ? TMutationKey : TMutationKey extends Array<unknown> ? TMutationKey : ReadonlyArray<unknown> : ReadonlyArray<unknown>;
|
|
2543
|
+
/** @inline */
|
|
2466
2544
|
type MutationStatus = 'idle' | 'pending' | 'success' | 'error';
|
|
2545
|
+
/**
|
|
2546
|
+
* Groups mutations so they run one after another instead of in parallel.
|
|
2547
|
+
* Mutations that share the same `id` form a queue: while one is running, the others wait in `isPaused: true`
|
|
2548
|
+
* state and resume automatically when their turn comes. Mutations with no scope always run in parallel.
|
|
2549
|
+
*/
|
|
2467
2550
|
type MutationScope = {
|
|
2468
2551
|
id: string;
|
|
2469
2552
|
};
|
|
2553
|
+
/**
|
|
2554
|
+
* The type of the `meta` object that can be attached to a mutation and read back from `mutationFn`, callbacks and
|
|
2555
|
+
* cache-level handlers. Defaults to `Record<string, unknown>`; declare `mutationMeta` on {@link Register} to narrow it.
|
|
2556
|
+
*/
|
|
2470
2557
|
type MutationMeta = Register extends {
|
|
2471
2558
|
mutationMeta: infer TMutationMeta;
|
|
2472
2559
|
} ? TMutationMeta extends Record<string, unknown> ? TMutationMeta : Record<string, unknown> : Record<string, unknown>;
|
|
@@ -2475,13 +2562,47 @@ type MutationFunctionContext = {
|
|
|
2475
2562
|
meta: MutationMeta | undefined;
|
|
2476
2563
|
mutationKey?: MutationKey;
|
|
2477
2564
|
};
|
|
2565
|
+
/** @inline */
|
|
2478
2566
|
type MutationFunction<TData = unknown, TVariables = unknown> = (variables: TVariables, context: MutationFunctionContext) => Promise<TData>;
|
|
2479
2567
|
interface MutationOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> {
|
|
2568
|
+
/**
|
|
2569
|
+
* The function that performs the asynchronous task this mutation runs.
|
|
2570
|
+
* Required, unless a default mutation function has been set for the matching `mutationKey` via
|
|
2571
|
+
* `queryClient.setMutationDefaults`.
|
|
2572
|
+
* Receives the `variables` passed to `mutate`, and a {@link MutationFunctionContext} holding the
|
|
2573
|
+
* `QueryClient`, the `mutationKey` and `meta`.
|
|
2574
|
+
* Must return a promise that resolves the mutation's data.
|
|
2575
|
+
*/
|
|
2480
2576
|
mutationFn?: MutationFunction<TData, TVariables>;
|
|
2577
|
+
/**
|
|
2578
|
+
* The key to use for this mutation. Optional, but required to inherit defaults registered with
|
|
2579
|
+
* `queryClient.setMutationDefaults`, and to match this mutation with `useMutationState` or
|
|
2580
|
+
* `queryClient.isMutating`.
|
|
2581
|
+
*/
|
|
2481
2582
|
mutationKey?: MutationKey;
|
|
2583
|
+
/**
|
|
2584
|
+
* This function fires before the mutation function runs, and receives the same variables.
|
|
2585
|
+
* Useful for optimistic updates applied in the hope that the mutation succeeds.
|
|
2586
|
+
* The value it returns is passed to `onSuccess`, `onError` and `onSettled` as `onMutateResult`,
|
|
2587
|
+
* which is where an optimistic update is usually rolled back.
|
|
2588
|
+
* If a promise is returned, it is awaited before the mutation function runs.
|
|
2589
|
+
*/
|
|
2482
2590
|
onMutate?: (variables: TVariables, context: MutationFunctionContext) => Promise<TOnMutateResult> | TOnMutateResult;
|
|
2591
|
+
/**
|
|
2592
|
+
* This function fires when the mutation succeeds, and is passed the mutation's result.
|
|
2593
|
+
* If a promise is returned, it is awaited before `onSettled` runs.
|
|
2594
|
+
*/
|
|
2483
2595
|
onSuccess?: (data: TData, variables: TVariables, onMutateResult: TOnMutateResult, context: MutationFunctionContext) => Promise<unknown> | unknown;
|
|
2596
|
+
/**
|
|
2597
|
+
* This function fires when the mutation encounters an error, and is passed the error.
|
|
2598
|
+
* If a promise is returned, it is awaited before `onSettled` runs.
|
|
2599
|
+
*/
|
|
2484
2600
|
onError?: (error: TError, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => Promise<unknown> | unknown;
|
|
2601
|
+
/**
|
|
2602
|
+
* This function fires when the mutation either succeeds or errors, and is passed either the data
|
|
2603
|
+
* or the error.
|
|
2604
|
+
* If a promise is returned, it is awaited before the mutation settles.
|
|
2605
|
+
*/
|
|
2485
2606
|
onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => Promise<unknown> | unknown;
|
|
2486
2607
|
/**
|
|
2487
2608
|
* If `false`, failed mutations will not retry by default.
|
|
@@ -2489,7 +2610,7 @@ interface MutationOptions<TData = unknown, TError = DefaultError, TVariables = v
|
|
|
2489
2610
|
* If set to an integer number, e.g. 3, failed mutations will retry until the failed mutation count meets that number.
|
|
2490
2611
|
* If set to a function `(failureCount, error) => boolean` failed mutations will retry until the function returns false.
|
|
2491
2612
|
*
|
|
2492
|
-
*
|
|
2613
|
+
* @defaultValue 0
|
|
2493
2614
|
*/
|
|
2494
2615
|
retry?: RetryValue<TError>;
|
|
2495
2616
|
/**
|
|
@@ -2502,7 +2623,7 @@ interface MutationOptions<TData = unknown, TError = DefaultError, TVariables = v
|
|
|
2502
2623
|
/**
|
|
2503
2624
|
* Controls whether a mutation is allowed to run based on the current network connectivity.
|
|
2504
2625
|
*
|
|
2505
|
-
*
|
|
2626
|
+
* @defaultValue 'online'
|
|
2506
2627
|
* @see [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information.
|
|
2507
2628
|
*/
|
|
2508
2629
|
networkMode?: NetworkMode;
|
|
@@ -2515,7 +2636,17 @@ interface MutationOptions<TData = unknown, TError = DefaultError, TVariables = v
|
|
|
2515
2636
|
gcTime?: number;
|
|
2516
2637
|
/** @internal */
|
|
2517
2638
|
_defaulted?: boolean;
|
|
2639
|
+
/**
|
|
2640
|
+
* Additional payload to be stored on the mutation cache entry.
|
|
2641
|
+
* Use it to pass information that can be read wherever the `mutation` is available, such as the
|
|
2642
|
+
* `onError` and `onSuccess` callbacks of the `MutationCache`.
|
|
2643
|
+
*/
|
|
2518
2644
|
meta?: MutationMeta;
|
|
2645
|
+
/**
|
|
2646
|
+
* Controls whether this mutation runs alongside others or waits its turn.
|
|
2647
|
+
* Mutations sharing the same `scope.id` run serially, in the order they were started.
|
|
2648
|
+
* Without a scope, a mutation runs as soon as it is triggered.
|
|
2649
|
+
*/
|
|
2519
2650
|
scope?: MutationScope;
|
|
2520
2651
|
}
|
|
2521
2652
|
interface MutationObserverOptions<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown> extends MutationOptions<TData, TError, TVariables, TOnMutateResult> {
|
|
@@ -2525,7 +2656,7 @@ interface MutationObserverOptions<TData = unknown, TError = DefaultError, TVaria
|
|
|
2525
2656
|
* If set to a function, it will be passed the error and should return a boolean indicating whether to throw the
|
|
2526
2657
|
* error (`true`) or return it as state (`false`).
|
|
2527
2658
|
*
|
|
2528
|
-
*
|
|
2659
|
+
* @defaultValue false
|
|
2529
2660
|
*/
|
|
2530
2661
|
throwOnError?: boolean | ((error: TError) => boolean);
|
|
2531
2662
|
}
|
|
@@ -2657,13 +2788,23 @@ interface DefaultOptions<TError = DefaultError> {
|
|
|
2657
2788
|
/** Default options used when dehydrating the client's caches; see {@link DehydrateOptions}. */
|
|
2658
2789
|
dehydrate?: DehydrateOptions;
|
|
2659
2790
|
}
|
|
2791
|
+
/**
|
|
2792
|
+
* Options for cancelling an in-flight fetch, e.g. via `query.cancel()`.
|
|
2793
|
+
* They are carried on the {@link CancelledError} that the cancelled fetch rejects with.
|
|
2794
|
+
*/
|
|
2660
2795
|
interface CancelOptions {
|
|
2661
2796
|
revert?: boolean;
|
|
2662
2797
|
silent?: boolean;
|
|
2663
2798
|
}
|
|
2799
|
+
/**
|
|
2800
|
+
* Options for writing data into the cache, e.g. via `queryClient.setQueryData()`.
|
|
2801
|
+
* `updatedAt` overrides the timestamp the data is recorded with, which is what staleness is measured from;
|
|
2802
|
+
* omit it to use the current time.
|
|
2803
|
+
*/
|
|
2664
2804
|
interface SetDataOptions {
|
|
2665
2805
|
updatedAt?: number;
|
|
2666
2806
|
}
|
|
2807
|
+
/** @inline */
|
|
2667
2808
|
type NotifyEventType = 'added' | 'removed' | 'updated' | 'observerAdded' | 'observerRemoved' | 'observerResultsUpdated' | 'observerOptionsUpdated';
|
|
2668
2809
|
interface NotifyEvent {
|
|
2669
2810
|
type: NotifyEventType;
|
|
@@ -2694,6 +2835,7 @@ interface DehydrateOptions {
|
|
|
2694
2835
|
* `DehydratedState`, and how to reverse any transformation applied by `DehydrateOptions.serializeData`.
|
|
2695
2836
|
*/
|
|
2696
2837
|
interface HydrateOptions {
|
|
2838
|
+
/** Options applied to the queries and mutations restored from the dehydrated state. */
|
|
2697
2839
|
defaultOptions?: {
|
|
2698
2840
|
/** Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. */
|
|
2699
2841
|
deserializeData?: TransformerFn;
|
|
@@ -2787,4 +2929,4 @@ declare function dehydrate(client: QueryClient, options?: DehydrateOptions): Deh
|
|
|
2787
2929
|
declare function hydrate(client: QueryClient, dehydratedState: Partial<DehydratedState>, options?: HydrateOptions): void;
|
|
2788
2930
|
//#endregion
|
|
2789
2931
|
export { MutationObserverBaseResult as $, Query as $n, CancelledError as $t, InfiniteData as A, noop as An, QueryObserverOptions as At, InfiniteQueryObserverSuccessResult as B, Action as Bn, RefetchQueryFilters as Bt, FetchPreviousPageOptions as C, isPlainArray as Cn, QueryKey as Ct, GetPreviousPageParamFunction as D, keepPreviousData as Dn, QueryObserverBaseResult as Dt, GetNextPageParamFunction as E, isValidTimeout as En, QueryMeta as Et, InfiniteQueryObserverOptions as F, shallowEqualObjects as Fn, QueryObserverSuccessResult as Ft, InvalidateQueryFilters as G, MutationCacheConfig as Gn, StaleTime as Gt, InitialDataFunction as H, MutationState as Hn, ResetOptions as Ht, InfiniteQueryObserverPendingResult as I, shouldThrowError as In, QueryOptions as It, MutateOptions as J, Action$1 as Jn, UnsetMarker as Jt, MutateFunction as K, MutationCacheNotifyEvent as Kn, StaleTimeFunction as Kt, InfiniteQueryObserverPlaceholderResult as L, skipToken as Ln, QueryPersister as Lt, InfiniteQueryObserverBaseResult as M, replaceData as Mn, QueryObserverPlaceholderResult as Mt, InfiniteQueryObserverLoadingErrorResult as N, replaceEqualDeep as Nn, QueryObserverRefetchErrorResult as Nt, InferDataFromTag as O, matchMutation as On, QueryObserverLoadingErrorResult as Ot, InfiniteQueryObserverLoadingResult as P, resolveQueryValue as Pn, QueryObserverResult as Pt, MutationMeta as Q, FetchOptions as Qn, unsetMarker as Qt, InfiniteQueryObserverRefetchErrorResult as R, sleep as Rn, QueryStatus as Rt, FetchNextPageOptions as S, hashQueryKeyByOptions as Sn, QueryFunctionContext as St, FetchStatus as T, isServer as Tn, QueryKeyWithDataTag as Tt, InitialPageParam as U, getDefaultState as Un, ResultOptions as Ut, InfiniteQueryPageParamsOptions as V, Mutation as Vn, Register as Vt, InvalidateOptions as W, MutationCache as Wn, SetDataOptions as Wt, MutationFunctionContext as X, FetchDirection as Xn, dataTagErrorSymbol as Xt, MutationFunction as Y, FetchContext as Yn, WithRequired as Yt, MutationKey as Z, FetchMeta as Zn, dataTagSymbol as Zt, DefinedQueryObserverResult as _, addToEnd as _n, QueriesPlaceholderDataFunction as _t, defaultShouldDehydrateQuery as a, isCancelledError as an, MutationObserverSuccessResult as at, EnsureQueryDataOptions as b, functionalUpdate as bn, QueryExecuteOptions as bt, hydrate as c, QueryCacheConfig as cn, MutationStatus as ct, DataTag as d, MutationFilters as dn, NotifyEvent as dt, RetryDelayValue as en, QueryBehavior as er, MutationObserverErrorResult as et, DefaultError as f, QueryFilters as fn, NotifyEventType as ft, DefinedInfiniteQueryObserverResult as g, addConsumeAwareSignal as gn, PlaceholderDataFunction as gt, DefaultedQueryObserverOptions as h, Updater as hn, Override as ht, defaultShouldDehydrateMutation as i, createRetryer as in, MutationObserverResult as it, InfiniteQueryExecuteOptions as j, partialMatchKey as jn, QueryObserverPendingResult as jt, InferErrorFromTag as k, matchQuery as kn, QueryObserverLoadingResult as kt, AnyDataTag as l, QueryCacheNotifyEvent as ln, NetworkMode as lt, DefaultedInfiniteQueryObserverOptions as m, SkipToken as mn, OmitKeyof as mt, DehydratedState as n, Retryer as nn, fetchState as nr, MutationObserverLoadingResult as nt, dehydrate as o, QueryClient as on, MutationOptions as ot, DefaultOptions as p, QueryTypeFilter as pn, NotifyOnChangeProps as pt, MutateFunctionRest as q, MutationObserver as qn, ThrowOnError as qt, HydrateOptions as r, canFetch as rn, QueryObserver as rr, MutationObserverOptions as rt, dehydrateQuery as s, QueryCache as sn, MutationScope as st, DehydrateOptions as t, RetryValue as tn, QueryState as tr, MutationObserverIdleResult as tt, CancelOptions as u, QueryStore as un, NonUndefinedGuard as ut, DistributiveOmit as v, addToStart as vn, QueryBooleanOption as vt, FetchQueryOptions as w, isPlainObject as wn, QueryKeyHashFunction as wt, FetchInfiniteQueryOptions as x, hashKey as xn, QueryFunction as xt, EnsureInfiniteQueryDataOptions as y, ensureQueryFn as yn, QueryClientConfig as yt, InfiniteQueryObserverResult as z, timeUntilStale as zn, RefetchOptions as zt };
|
|
2790
|
-
//# sourceMappingURL=hydration-
|
|
2932
|
+
//# sourceMappingURL=hydration-Br9VIGXa.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hydration-Br9VIGXa.d.cts","names":["FailedAction","SuccessAction","ErrorAction","PauseAction","ContinueAction","Action","Action"],"sources":["../../src/queryObserver.ts","../../src/query.ts","../../src/mutationObserver.ts","../../src/mutationCache.ts","../../src/mutation.ts","../../src/utils.ts","../../src/queryCache.ts","../../src/queryClient.ts","../../src/retryer.ts","../../src/types.ts","../../src/hydration.ts"],"mappings":";;;KA4BK,sBAAsB,OAAO,WAChC,QAAQ,oBAAoB,OAAO;UAG3B,6BAA6B;EACrC;;;;;;;;;;;;;;;;;;;;;;cAuBW,cACX,wBACA,SAAS,cACT,QAAQ,cACR,aAAa,cACb,kBAAkB,WAAW,kBACrB,aAAa,sBAAsB,OAAO;;EA0BzC,SAAS,qBACd,cACA,QACA,OACA,YACA;EANF,YAAA,QAAQ,aACD,SAAS,qBACd,cACA,QACA,OACA,YACA;YAYM;YAIA;YAcA;;;;;;EAWV;;;;;;EAaA;;;;;;EAaA;;;;;;;;;;;;;;;EAqBA,WACE,SAAS,qBACP,cACA,QACA,OACA,YACA;;;;;;;EAoFJ,oBACE,SAAS,8BACP,cACA,QACA,OACA,YACA,aAED,oBAAoB,OAAO;;;;;;;;;;;;;EAyC9B,oBAAoB,oBAAoB,OAAO;;;;;;;EAU/C,YACE,QAAQ,oBAAoB,OAAO,SACnC,iBAAiB,WAAW,+BAC3B,oBAAoB,OAAO;;;;;;;EAgB9B,UAAU,WAAW;;;;EAOrB,mBAAmB,MAAM,cAAc,QAAQ,YAAY;;;;;;;;;;;EAc3D,aAAa,YAAW,iBAAsB,QAC5C,oBAAoB,OAAO;;;;;;;;;;;;;;;;;EAuB7B,gBACE,SAAS,qBACP,cACA,QACA,OACA,YACA,aAED,QAAQ,oBAAoB,OAAO;YA4C5B,MACR,cAAc,uBACb,QAAQ,oBAAoB,OAAO;YA6G5B,aACR,OAAO,MAAM,cAAc,QAAQ,YAAY,YAC/C,SAAS,qBACP,cACA,QACA,OACA,YACA,aAED,oBAAoB,OAAO;;;;;;EAsK9B;;EA2FA;;;;UCtxBQ,YACR,cACA,QACA,OACA,kBAAkB,WAAW;EAE7B,QAAQ;EACR,UAAU;EACV;EACA,UAAU,aAAa,cAAc,QAAQ,OAAO;EACpD,iBA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U;;EAErC,wBAAwB,OAAO;;;;;;EAM/B,sBAAsB;;;;;;UAOP;;EAEf;;IAEE,kBAAkB;;IAElB,UAAU;;IAEV,YAAY,yBAAyB;;;UAI/B;EACR,cAAc;EACd,OAAO;EACP,OAAO;EACP,QAAQ;;UAGA;EACR;EACA,UAAU;EACV,OAAO;EACP;EACA,UAAU;EACV,OAAO;EACP;;;;;;;UAQe;EACf,WAAW,MAAM;EACjB,SAAS,MAAM;;;;;;;;;;;;iBAoDD,eACd,OAAO,OACP,gBAAgB,eAChB,sBAAsB,6BACrB;;;;;iBAyBa,+BAA+B,UAAU;;;;;iBAQzC,4BAA4B,OAAO;;;;;;;;;;;;;;;;;;;iBAsBnC,UACd,QAAQ,aACR,UAAS,mBACR;;;;;;;;;;;;;;;;;;iBAsDa,QACd,QAAQ,aACR,iBAAiB,QAAQ,kBACzB,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydration.cjs","names":["noop"],"sources":["../../src/hydration.ts"],"sourcesContent":["import { noop } from './utils'\nimport type {\n DefaultError,\n MutationKey,\n MutationMeta,\n MutationOptions,\n MutationScope,\n QueryKey,\n QueryMeta,\n QueryOptions,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query, QueryState } from './query'\nimport type { Mutation, MutationState } from './mutation'\n\n// TYPES\ntype TransformerFn = (data: any) => any\n\nfunction tryResolveSync(promise: PromiseLike<unknown>) {\n let data: unknown\n\n const thenResult = promise.then((result) => {\n data = result\n return result\n }, noop) as Promise<unknown> | undefined\n\n // .catch can be unavailable on certain kinds of thenable's\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n thenResult?.catch?.(noop)\n\n if (data !== undefined) {\n return { data }\n }\n\n return undefined\n}\n\n/**\n * Options for `dehydrate`, controlling which queries/mutations are included in the resulting `DehydratedState` and\n * how their data/errors are transformed before being serialized (e.g. for embedding in server-rendered markup).\n */\nexport interface DehydrateOptions {\n /** Transforms a query's `data` before it is dehydrated. Useful for non-JSON-serializable data. */\n serializeData?: TransformerFn\n /** Predicate to decide whether a given `Mutation` should be dehydrated. Defaults to `defaultShouldDehydrateMutation`. */\n shouldDehydrateMutation?: (mutation: Mutation) => boolean\n /** Predicate to decide whether a given `Query` should be dehydrated. Defaults to `defaultShouldDehydrateQuery`. */\n shouldDehydrateQuery?: (query: Query) => boolean\n /**\n * Predicate to decide whether a query's error should be redacted before dehydration. Errors are redacted\n * (replaced with a generic `Error('redacted')`) unless this function is provided and returns `false` for the\n * given error, in which case the original error is kept.\n */\n shouldRedactErrors?: (error: unknown) => boolean\n}\n\n/**\n * Options for `hydrate`, controlling the default options applied to queries/mutations restored from a\n * `DehydratedState`, and how to reverse any transformation applied by `DehydrateOptions.serializeData`.\n */\nexport interface HydrateOptions {\n defaultOptions?: {\n /** Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. */\n deserializeData?: TransformerFn\n /** Default options merged into every query restored from the dehydrated state. */\n queries?: QueryOptions\n /** Default options merged into every mutation restored from the dehydrated state. */\n mutations?: MutationOptions<unknown, DefaultError, unknown, unknown>\n }\n}\n\ninterface DehydratedMutation {\n mutationKey?: MutationKey\n state: MutationState\n meta?: MutationMeta\n scope?: MutationScope\n}\n\ninterface DehydratedQuery {\n queryHash: string\n queryKey: QueryKey\n state: QueryState\n dehydratedAt: number\n promise?: Promise<unknown>\n meta?: QueryMeta\n queryType?: 'infinite'\n}\n\n/**\n * A serializable snapshot of a `QueryClient`'s cache, as produced by `dehydrate` and consumed by `hydrate`. Typically\n * transported from server to client (e.g. embedded in server-rendered markup) to seed the client's cache with data\n * that has already been fetched, avoiding a redundant fetch on the client.\n */\nexport interface DehydratedState {\n mutations: Array<DehydratedMutation>\n queries: Array<DehydratedQuery>\n}\n\n// FUNCTIONS\n\nfunction dehydrateMutation(mutation: Mutation): DehydratedMutation {\n return {\n mutationKey: mutation.options.mutationKey,\n state: mutation.state,\n ...(mutation.options.scope && { scope: mutation.options.scope }),\n ...(mutation.meta && { meta: mutation.meta }),\n }\n}\n\nfunction dehydratePromise(\n query: Query,\n serializeData?: TransformerFn,\n shouldRedactErrors?: (error: unknown) => boolean,\n): Promise<unknown> | undefined {\n const promise = query.promise?.then(serializeData).catch((error) => {\n if (shouldRedactErrors?.(error) === false) {\n // Reject original error if it should not be redacted\n return Promise.reject(error)\n }\n // If not in production, log original error before rejecting redacted error\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`,\n )\n }\n return Promise.reject(new Error('redacted'))\n })\n\n // Avoid unhandled promise rejections\n // We need the promise we dehydrate to reject to get the correct result into\n // the query cache, but we also want to avoid unhandled promise rejections\n // in whatever environment the prefetches are happening in.\n promise?.catch(noop)\n\n return promise\n}\n\n/**\n * Dehydrates a single `Query` into a serializable `DehydratedQuery` snapshot. Note that most query config (e.g.\n * `queryFn`, `staleTime`) is not dehydrated but instead meant to be configured again when consuming the\n * de/rehydrated data, typically with `useQuery` on the client. If the query is still `pending`, its in-flight\n * promise is dehydrated too so it can be resumed on the other side instead of re-fetched.\n * @param query - The query to dehydrate.\n * @param serializeData - Optional transform applied to `query.state.data` before it is included in the snapshot.\n * @param shouldRedactErrors - Optional predicate; if it returns `false` for the promise's rejection error, that\n * error is kept as-is instead of being redacted.\n */\nexport function dehydrateQuery(\n query: Query,\n serializeData?: TransformerFn,\n shouldRedactErrors?: (error: unknown) => boolean,\n): DehydratedQuery {\n return {\n dehydratedAt: Date.now(),\n state: {\n ...query.state,\n ...(query.state.data !== undefined && {\n data: serializeData\n ? serializeData(query.state.data)\n : query.state.data,\n }),\n },\n queryKey: query.queryKey,\n queryHash: query.queryHash,\n ...(query.state.status === 'pending' && {\n promise: dehydratePromise(query, serializeData, shouldRedactErrors),\n }),\n ...(query.meta && { meta: query.meta }),\n ...(query.queryType && { queryType: query.queryType }),\n }\n}\n\n/**\n * The default `shouldDehydrateMutation` predicate used by `dehydrate`. Only dehydrates mutations that are\n * currently paused (e.g. paused by `networkMode` while offline).\n */\nexport function defaultShouldDehydrateMutation(mutation: Mutation) {\n return mutation.state.isPaused\n}\n\n/**\n * The default `shouldDehydrateQuery` predicate used by `dehydrate`. Only dehydrates queries whose status is\n * `'success'`.\n */\nexport function defaultShouldDehydrateQuery(query: Query) {\n return query.state.status === 'success'\n}\n\n/**\n * Dehydrates a `QueryClient`'s cache (queries and mutations) into a plain, serializable `DehydratedState`,\n * typically to embed in server-rendered markup and later restore into a client-side `QueryClient` via `hydrate`.\n * Which queries/mutations are included, and how their data/errors are transformed, is controlled by `options`,\n * falling back to the client's `dehydrate` default options, and finally to `defaultShouldDehydrateQuery` /\n * `defaultShouldDehydrateMutation`.\n * @example\n * ```ts\n * const queryClient = new QueryClient()\n *\n * await queryClient.prefetchQuery({\n * queryKey: ['posts'],\n * queryFn: getPosts,\n * })\n *\n * const dehydratedState = dehydrate(queryClient)\n * ```\n */\nexport function dehydrate(\n client: QueryClient,\n options: DehydrateOptions = {},\n): DehydratedState {\n const filterMutation =\n options.shouldDehydrateMutation ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ??\n defaultShouldDehydrateMutation\n\n const mutations = client\n .getMutationCache()\n .getAll()\n .flatMap((mutation) =>\n filterMutation(mutation) ? [dehydrateMutation(mutation)] : [],\n )\n\n const filterQuery =\n options.shouldDehydrateQuery ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ??\n defaultShouldDehydrateQuery\n\n const shouldRedactErrors =\n options.shouldRedactErrors ??\n client.getDefaultOptions().dehydrate?.shouldRedactErrors\n\n const serializeData =\n options.serializeData ?? client.getDefaultOptions().dehydrate?.serializeData\n\n const queries = client\n .getQueryCache()\n .getAll()\n .flatMap((query) =>\n filterQuery(query)\n ? [dehydrateQuery(query, serializeData, shouldRedactErrors)]\n : [],\n )\n\n return { mutations, queries }\n}\n\n/**\n * Restores a `DehydratedState` (as produced by `dehydrate`) into a `QueryClient`'s cache, typically to seed the\n * client with data already fetched on the server. `mutations` and `queries` are each optional on `dehydratedState`.\n * Queries not yet in the cache are built from the dehydrated snapshot; queries that already exist are only updated\n * when the dehydrated data is newer than what's already cached. Newly built queries have their `fetchStatus` reset\n * to `'idle'` so they don't hydrate stuck in a fetching state. If a dehydrated query still had an in-flight\n * promise, it is resumed via `query.fetch()` (reusing that promise as `initialPromise`) rather than re-invoking\n * `queryFn`.\n * @example\n * ```ts\n * // dehydratedState was produced by `dehydrate` on the server\n * // and sent to the client, e.g. embedded in server-rendered markup.\n * const queryClient = new QueryClient()\n *\n * hydrate(queryClient, dehydratedState)\n * ```\n */\nexport function hydrate(\n client: QueryClient,\n dehydratedState: Partial<DehydratedState>,\n options?: HydrateOptions,\n): void {\n const mutationCache = client.getMutationCache()\n const queryCache = client.getQueryCache()\n const deserializeData =\n options?.defaultOptions?.deserializeData ??\n client.getDefaultOptions().hydrate?.deserializeData\n\n dehydratedState.mutations?.forEach(({ state, ...mutationOptions }) => {\n mutationCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.mutations,\n ...options?.defaultOptions?.mutations,\n ...mutationOptions,\n },\n state,\n )\n })\n\n dehydratedState.queries?.forEach(\n ({\n queryKey,\n state,\n queryHash,\n meta,\n promise,\n dehydratedAt,\n queryType,\n }) => {\n const syncData = promise ? tryResolveSync(promise) : undefined\n const rawData = state.data === undefined ? syncData?.data : state.data\n const data =\n rawData === undefined\n ? rawData\n : deserializeData\n ? deserializeData(rawData)\n : rawData\n\n let query = queryCache.get(queryHash)\n const existingQueryIsPending = query?.state.status === 'pending'\n const existingQueryIsFetching = query?.state.fetchStatus === 'fetching'\n\n // Do not hydrate if an existing query exists with newer data\n if (query) {\n const hasNewerSyncData =\n syncData && dehydratedAt > query.state.dataUpdatedAt\n if (\n state.dataUpdatedAt > query.state.dataUpdatedAt ||\n hasNewerSyncData\n ) {\n // Omit fetchStatus from dehydrated state so that query stays in its current fetchStatus\n const { fetchStatus: _ignored, ...serializedState } = state\n query.setState({\n ...serializedState,\n data,\n // If the query was pending at the moment of dehydration, but resolved to have data\n // before hydration, we can assume the query should be hydrated as successful.\n //\n // Since you can opt into dehydrating failed queries, and those can have data from\n // previous successful fetches, we make sure we only do this for pending queries.\n ...(state.status === 'pending' &&\n data !== undefined && {\n status: 'success' as const,\n dataUpdatedAt: dehydratedAt,\n // Preserve existing fetchStatus if the existing query is actively fetching.\n ...(!existingQueryIsFetching && {\n fetchStatus: 'idle' as const,\n }),\n }),\n })\n }\n } else {\n // Restore query\n query = queryCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.queries,\n ...options?.defaultOptions?.queries,\n queryKey,\n queryHash,\n meta,\n _type: queryType,\n },\n // Reset fetch status to idle to avoid\n // query being stuck in fetching state upon hydration\n {\n ...state,\n data,\n fetchStatus: 'idle',\n // Like above, if the query was pending at the moment of dehydration but has data,\n // we can assume it should be hydrated as successful.\n status:\n state.status === 'pending' && data !== undefined\n ? 'success'\n : state.status,\n ...(state.status === 'pending' &&\n data !== undefined && {\n dataUpdatedAt: dehydratedAt,\n }),\n },\n )\n }\n\n if (\n promise &&\n // If the data was synchronously available, there is no need to set up\n // a retryer and thus no reason to call fetch\n !syncData &&\n !existingQueryIsPending &&\n !existingQueryIsFetching &&\n // Only hydrate if dehydration is newer than any existing data,\n // this is always true for new queries\n dehydratedAt > query.state.dataUpdatedAt\n ) {\n // This doesn't actually fetch - it just creates a retryer\n // which will re-use the passed `initialPromise`\n query\n .fetch(undefined, {\n // RSC transformed promises are not thenable\n initialPromise: Promise.resolve(promise).then(deserializeData),\n })\n // Avoid unhandled promise rejections\n .catch(noop)\n }\n },\n )\n}\n"],"mappings":";;;AAkBA,SAAS,eAAe,SAA+B;CACrD,IAAI;CASJ,QAP2B,MAAM,WAAW;EAC1C,OAAO;EACP,OAAO;CACT,GAAGA,cAAAA,IAIM,CAAC,EAAE,QAAQA,cAAAA,IAAI;CAExB,IAAI,SAAS,KAAA,GACX,OAAO,EAAE,KAAK;AAIlB;AAiEA,SAAS,kBAAkB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,OAAO,MAAM,WAAW;EACvD,MAAM,0BAA0B,OAAO,MAAM,gBAAgB;EAG7D,IAAI,OAAO;GACT,MAAM,mBACJ,YAAY,eAAe,MAAM,MAAM;GACzC,IACE,MAAM,gBAAgB,MAAM,MAAM,iBAClC,kBACA;IAEA,MAAM,EAAE,aAAa,UAAU,GAAG,oBAAoB;IACtD,MAAM,SAAS;KACb,GAAG;KACH;KAMA,GAAI,MAAM,WAAW,aACnB,SAAS,KAAA,KAAa;MACpB,QAAQ;MACR,eAAe;MAEf,GAAI,CAAC,2BAA2B,EAC9B,aAAa,OACf;KACF;IACJ,CAAC;GACH;EACF,OAEE,QAAQ,WAAW,MACjB,QACA;GACE,GAAG,OAAO,kBAAkB,CAAC,CAAC,SAAS;GACvC,GAAG,SAAS,gBAAgB;GAC5B;GACA;GACA;GACA,OAAO;EACT,GAGA;GACE,GAAG;GACH;GACA,aAAa;GAGb,QACE,MAAM,WAAW,aAAa,SAAS,KAAA,IACnC,YACA,MAAM;GACZ,GAAI,MAAM,WAAW,aACnB,SAAS,KAAA,KAAa,EACpB,eAAe,aACjB;EACJ,CACF;EAGF,IACE,WAGA,CAAC,YACD,CAAC,0BACD,CAAC,2BAGD,eAAe,MAAM,MAAM,eAI3B,MACG,MAAM,KAAA,GAAW,EAEhB,gBAAgB,QAAQ,QAAQ,OAAO,CAAC,CAAC,KAAK,eAAe,EAC/D,CAAC,CAAC,CAED,MAAMA,cAAAA,IAAI;CAEjB,CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"hydration.cjs","names":["noop"],"sources":["../../src/hydration.ts"],"sourcesContent":["import { noop } from './utils'\nimport type {\n DefaultError,\n MutationKey,\n MutationMeta,\n MutationOptions,\n MutationScope,\n QueryKey,\n QueryMeta,\n QueryOptions,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query, QueryState } from './query'\nimport type { Mutation, MutationState } from './mutation'\n\n// TYPES\ntype TransformerFn = (data: any) => any\n\nfunction tryResolveSync(promise: PromiseLike<unknown>) {\n let data: unknown\n\n const thenResult = promise.then((result) => {\n data = result\n return result\n }, noop) as Promise<unknown> | undefined\n\n // .catch can be unavailable on certain kinds of thenable's\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n thenResult?.catch?.(noop)\n\n if (data !== undefined) {\n return { data }\n }\n\n return undefined\n}\n\n/**\n * Options for `dehydrate`, controlling which queries/mutations are included in the resulting `DehydratedState` and\n * how their data/errors are transformed before being serialized (e.g. for embedding in server-rendered markup).\n */\nexport interface DehydrateOptions {\n /** Transforms a query's `data` before it is dehydrated. Useful for non-JSON-serializable data. */\n serializeData?: TransformerFn\n /** Predicate to decide whether a given `Mutation` should be dehydrated. Defaults to `defaultShouldDehydrateMutation`. */\n shouldDehydrateMutation?: (mutation: Mutation) => boolean\n /** Predicate to decide whether a given `Query` should be dehydrated. Defaults to `defaultShouldDehydrateQuery`. */\n shouldDehydrateQuery?: (query: Query) => boolean\n /**\n * Predicate to decide whether a query's error should be redacted before dehydration. Errors are redacted\n * (replaced with a generic `Error('redacted')`) unless this function is provided and returns `false` for the\n * given error, in which case the original error is kept.\n */\n shouldRedactErrors?: (error: unknown) => boolean\n}\n\n/**\n * Options for `hydrate`, controlling the default options applied to queries/mutations restored from a\n * `DehydratedState`, and how to reverse any transformation applied by `DehydrateOptions.serializeData`.\n */\nexport interface HydrateOptions {\n /** Options applied to the queries and mutations restored from the dehydrated state. */\n defaultOptions?: {\n /** Transforms a query's `data` after it is read from the dehydrated state, reversing `serializeData`. */\n deserializeData?: TransformerFn\n /** Default options merged into every query restored from the dehydrated state. */\n queries?: QueryOptions\n /** Default options merged into every mutation restored from the dehydrated state. */\n mutations?: MutationOptions<unknown, DefaultError, unknown, unknown>\n }\n}\n\ninterface DehydratedMutation {\n mutationKey?: MutationKey\n state: MutationState\n meta?: MutationMeta\n scope?: MutationScope\n}\n\ninterface DehydratedQuery {\n queryHash: string\n queryKey: QueryKey\n state: QueryState\n dehydratedAt: number\n promise?: Promise<unknown>\n meta?: QueryMeta\n queryType?: 'infinite'\n}\n\n/**\n * A serializable snapshot of a `QueryClient`'s cache, as produced by `dehydrate` and consumed by `hydrate`. Typically\n * transported from server to client (e.g. embedded in server-rendered markup) to seed the client's cache with data\n * that has already been fetched, avoiding a redundant fetch on the client.\n */\nexport interface DehydratedState {\n mutations: Array<DehydratedMutation>\n queries: Array<DehydratedQuery>\n}\n\n// FUNCTIONS\n\nfunction dehydrateMutation(mutation: Mutation): DehydratedMutation {\n return {\n mutationKey: mutation.options.mutationKey,\n state: mutation.state,\n ...(mutation.options.scope && { scope: mutation.options.scope }),\n ...(mutation.meta && { meta: mutation.meta }),\n }\n}\n\nfunction dehydratePromise(\n query: Query,\n serializeData?: TransformerFn,\n shouldRedactErrors?: (error: unknown) => boolean,\n): Promise<unknown> | undefined {\n const promise = query.promise?.then(serializeData).catch((error) => {\n if (shouldRedactErrors?.(error) === false) {\n // Reject original error if it should not be redacted\n return Promise.reject(error)\n }\n // If not in production, log original error before rejecting redacted error\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`,\n )\n }\n return Promise.reject(new Error('redacted'))\n })\n\n // Avoid unhandled promise rejections\n // We need the promise we dehydrate to reject to get the correct result into\n // the query cache, but we also want to avoid unhandled promise rejections\n // in whatever environment the prefetches are happening in.\n promise?.catch(noop)\n\n return promise\n}\n\n/**\n * Dehydrates a single `Query` into a serializable `DehydratedQuery` snapshot. Note that most query config (e.g.\n * `queryFn`, `staleTime`) is not dehydrated but instead meant to be configured again when consuming the\n * de/rehydrated data, typically with `useQuery` on the client. If the query is still `pending`, its in-flight\n * promise is dehydrated too so it can be resumed on the other side instead of re-fetched.\n * @param query - The query to dehydrate.\n * @param serializeData - Optional transform applied to `query.state.data` before it is included in the snapshot.\n * @param shouldRedactErrors - Optional predicate; if it returns `false` for the promise's rejection error, that\n * error is kept as-is instead of being redacted.\n */\nexport function dehydrateQuery(\n query: Query,\n serializeData?: TransformerFn,\n shouldRedactErrors?: (error: unknown) => boolean,\n): DehydratedQuery {\n return {\n dehydratedAt: Date.now(),\n state: {\n ...query.state,\n ...(query.state.data !== undefined && {\n data: serializeData\n ? serializeData(query.state.data)\n : query.state.data,\n }),\n },\n queryKey: query.queryKey,\n queryHash: query.queryHash,\n ...(query.state.status === 'pending' && {\n promise: dehydratePromise(query, serializeData, shouldRedactErrors),\n }),\n ...(query.meta && { meta: query.meta }),\n ...(query.queryType && { queryType: query.queryType }),\n }\n}\n\n/**\n * The default `shouldDehydrateMutation` predicate used by `dehydrate`. Only dehydrates mutations that are\n * currently paused (e.g. paused by `networkMode` while offline).\n */\nexport function defaultShouldDehydrateMutation(mutation: Mutation) {\n return mutation.state.isPaused\n}\n\n/**\n * The default `shouldDehydrateQuery` predicate used by `dehydrate`. Only dehydrates queries whose status is\n * `'success'`.\n */\nexport function defaultShouldDehydrateQuery(query: Query) {\n return query.state.status === 'success'\n}\n\n/**\n * Dehydrates a `QueryClient`'s cache (queries and mutations) into a plain, serializable `DehydratedState`,\n * typically to embed in server-rendered markup and later restore into a client-side `QueryClient` via `hydrate`.\n * Which queries/mutations are included, and how their data/errors are transformed, is controlled by `options`,\n * falling back to the client's `dehydrate` default options, and finally to `defaultShouldDehydrateQuery` /\n * `defaultShouldDehydrateMutation`.\n * @example\n * ```ts\n * const queryClient = new QueryClient()\n *\n * await queryClient.prefetchQuery({\n * queryKey: ['posts'],\n * queryFn: getPosts,\n * })\n *\n * const dehydratedState = dehydrate(queryClient)\n * ```\n */\nexport function dehydrate(\n client: QueryClient,\n options: DehydrateOptions = {},\n): DehydratedState {\n const filterMutation =\n options.shouldDehydrateMutation ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ??\n defaultShouldDehydrateMutation\n\n const mutations = client\n .getMutationCache()\n .getAll()\n .flatMap((mutation) =>\n filterMutation(mutation) ? [dehydrateMutation(mutation)] : [],\n )\n\n const filterQuery =\n options.shouldDehydrateQuery ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ??\n defaultShouldDehydrateQuery\n\n const shouldRedactErrors =\n options.shouldRedactErrors ??\n client.getDefaultOptions().dehydrate?.shouldRedactErrors\n\n const serializeData =\n options.serializeData ?? client.getDefaultOptions().dehydrate?.serializeData\n\n const queries = client\n .getQueryCache()\n .getAll()\n .flatMap((query) =>\n filterQuery(query)\n ? [dehydrateQuery(query, serializeData, shouldRedactErrors)]\n : [],\n )\n\n return { mutations, queries }\n}\n\n/**\n * Restores a `DehydratedState` (as produced by `dehydrate`) into a `QueryClient`'s cache, typically to seed the\n * client with data already fetched on the server. `mutations` and `queries` are each optional on `dehydratedState`.\n * Queries not yet in the cache are built from the dehydrated snapshot; queries that already exist are only updated\n * when the dehydrated data is newer than what's already cached. Newly built queries have their `fetchStatus` reset\n * to `'idle'` so they don't hydrate stuck in a fetching state. If a dehydrated query still had an in-flight\n * promise, it is resumed via `query.fetch()` (reusing that promise as `initialPromise`) rather than re-invoking\n * `queryFn`.\n * @example\n * ```ts\n * // dehydratedState was produced by `dehydrate` on the server\n * // and sent to the client, e.g. embedded in server-rendered markup.\n * const queryClient = new QueryClient()\n *\n * hydrate(queryClient, dehydratedState)\n * ```\n */\nexport function hydrate(\n client: QueryClient,\n dehydratedState: Partial<DehydratedState>,\n options?: HydrateOptions,\n): void {\n const mutationCache = client.getMutationCache()\n const queryCache = client.getQueryCache()\n const deserializeData =\n options?.defaultOptions?.deserializeData ??\n client.getDefaultOptions().hydrate?.deserializeData\n\n dehydratedState.mutations?.forEach(({ state, ...mutationOptions }) => {\n mutationCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.mutations,\n ...options?.defaultOptions?.mutations,\n ...mutationOptions,\n },\n state,\n )\n })\n\n dehydratedState.queries?.forEach(\n ({\n queryKey,\n state,\n queryHash,\n meta,\n promise,\n dehydratedAt,\n queryType,\n }) => {\n const syncData = promise ? tryResolveSync(promise) : undefined\n const rawData = state.data === undefined ? syncData?.data : state.data\n const data =\n rawData === undefined\n ? rawData\n : deserializeData\n ? deserializeData(rawData)\n : rawData\n\n let query = queryCache.get(queryHash)\n const existingQueryIsPending = query?.state.status === 'pending'\n const existingQueryIsFetching = query?.state.fetchStatus === 'fetching'\n\n // Do not hydrate if an existing query exists with newer data\n if (query) {\n const hasNewerSyncData =\n syncData && dehydratedAt > query.state.dataUpdatedAt\n if (\n state.dataUpdatedAt > query.state.dataUpdatedAt ||\n hasNewerSyncData\n ) {\n // Omit fetchStatus from dehydrated state so that query stays in its current fetchStatus\n const { fetchStatus: _ignored, ...serializedState } = state\n query.setState({\n ...serializedState,\n data,\n // If the query was pending at the moment of dehydration, but resolved to have data\n // before hydration, we can assume the query should be hydrated as successful.\n //\n // Since you can opt into dehydrating failed queries, and those can have data from\n // previous successful fetches, we make sure we only do this for pending queries.\n ...(state.status === 'pending' &&\n data !== undefined && {\n status: 'success' as const,\n dataUpdatedAt: dehydratedAt,\n // Preserve existing fetchStatus if the existing query is actively fetching.\n ...(!existingQueryIsFetching && {\n fetchStatus: 'idle' as const,\n }),\n }),\n })\n }\n } else {\n // Restore query\n query = queryCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.queries,\n ...options?.defaultOptions?.queries,\n queryKey,\n queryHash,\n meta,\n _type: queryType,\n },\n // Reset fetch status to idle to avoid\n // query being stuck in fetching state upon hydration\n {\n ...state,\n data,\n fetchStatus: 'idle',\n // Like above, if the query was pending at the moment of dehydration but has data,\n // we can assume it should be hydrated as successful.\n status:\n state.status === 'pending' && data !== undefined\n ? 'success'\n : state.status,\n ...(state.status === 'pending' &&\n data !== undefined && {\n dataUpdatedAt: dehydratedAt,\n }),\n },\n )\n }\n\n if (\n promise &&\n // If the data was synchronously available, there is no need to set up\n // a retryer and thus no reason to call fetch\n !syncData &&\n !existingQueryIsPending &&\n !existingQueryIsFetching &&\n // Only hydrate if dehydration is newer than any existing data,\n // this is always true for new queries\n dehydratedAt > query.state.dataUpdatedAt\n ) {\n // This doesn't actually fetch - it just creates a retryer\n // which will re-use the passed `initialPromise`\n query\n .fetch(undefined, {\n // RSC transformed promises are not thenable\n initialPromise: Promise.resolve(promise).then(deserializeData),\n })\n // Avoid unhandled promise rejections\n .catch(noop)\n }\n },\n )\n}\n"],"mappings":";;;AAkBA,SAAS,eAAe,SAA+B;CACrD,IAAI;CASJ,QAP2B,MAAM,WAAW;EAC1C,OAAO;EACP,OAAO;CACT,GAAGA,cAAAA,IAIM,CAAC,EAAE,QAAQA,cAAAA,IAAI;CAExB,IAAI,SAAS,KAAA,GACX,OAAO,EAAE,KAAK;AAIlB;AAkEA,SAAS,kBAAkB,UAAwC;CACjE,OAAO;EACL,aAAa,SAAS,QAAQ;EAC9B,OAAO,SAAS;EAChB,GAAI,SAAS,QAAQ,SAAS,EAAE,OAAO,SAAS,QAAQ,MAAM;EAC9D,GAAI,SAAS,QAAQ,EAAE,MAAM,SAAS,KAAK;CAC7C;AACF;AAEA,SAAS,iBACP,OACA,eACA,oBAC8B;CAC9B,MAAM,UAAU,MAAM,SAAS,KAAK,aAAa,CAAC,CAAC,OAAO,UAAU;EAClE,IAAI,qBAAqB,KAAK,MAAM,OAElC,OAAO,QAAQ,OAAO,KAAK;EAG7B,IAAI,QAAQ,IAAI,aAAa,cAC3B,QAAQ,MACN,+DAA+D,MAAM,UAAU,KAAK,MAAM,kDAC5F;EAEF,OAAO,QAAQ,uBAAO,IAAI,MAAM,UAAU,CAAC;CAC7C,CAAC;CAMD,SAAS,MAAMA,cAAAA,IAAI;CAEnB,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,eACd,OACA,eACA,oBACiB;CACjB,OAAO;EACL,cAAc,KAAK,IAAI;EACvB,OAAO;GACL,GAAG,MAAM;GACT,GAAI,MAAM,MAAM,SAAS,KAAA,KAAa,EACpC,MAAM,gBACF,cAAc,MAAM,MAAM,IAAI,IAC9B,MAAM,MAAM,KAClB;EACF;EACA,UAAU,MAAM;EAChB,WAAW,MAAM;EACjB,GAAI,MAAM,MAAM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