@orpc/tanstack-query 2.0.0-beta.49 → 2.0.0-beta.50

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.
@@ -1,160 +1,105 @@
1
- import { setOwn, stringifyJSON } from '@orpc/shared';
1
+ import { setOwn, stringifyJSON } from "@orpc/shared";
2
+ // src/structural-sharing.ts
2
3
  /**
3
- * Creates a `structuralSharing` function that works like TanStack Query's default, but also keeps
4
- * the previous reference for equal `Date`, `URL`, `Map` and `Set` values, which oRPC's serializer
5
- * recreates on every response, and for custom types that serialize the same with a type-aware
6
- * serializer like `RPCJsonSerializer`.
7
- *
8
- * Used by default in `.queryOptions`, `.liveOptions` and `.infiniteOptions`, pass `structuralSharing: false` to opt out.
9
- *
10
- * @see {@link https://orpc.dev/docs/integrations/tanstack-query#structural-sharing | TanStack Query Integration - Structural Sharing}
11
- */
12
- export function createStructuralSharing(serializer) {
13
- return (oldData, newData) => replaceEqualDeep(oldData, newData, 0, serializer);
4
+ * Creates a `structuralSharing` function that works like TanStack Query's default, but also keeps
5
+ * the previous reference for equal `Date`, `URL`, `Map` and `Set` values, which oRPC's serializer
6
+ * recreates on every response, and for custom types that serialize the same with a type-aware
7
+ * serializer like `RPCJsonSerializer`.
8
+ *
9
+ * Used by default in `.queryOptions`, `.liveOptions` and `.infiniteOptions`, pass `structuralSharing: false` to opt out.
10
+ *
11
+ * @see {@link https://orpc.dev/docs/integrations/tanstack-query#structural-sharing | TanStack Query Integration - Structural Sharing}
12
+ */
13
+ function createStructuralSharing(serializer) {
14
+ return (oldData, newData) => replaceEqualDeep(oldData, newData, 0, serializer);
14
15
  }
15
16
  function replaceEqualDeep(a, b, depth, serializer) {
16
- if (Object.is(a, b)) {
17
- return a;
18
- }
19
- if (depth > 500 || typeof a !== 'object' || typeof b !== 'object' || a === null || b === null) {
20
- return b;
21
- }
22
- const proto = Object.getPrototypeOf(a);
23
- if (proto !== Object.getPrototypeOf(b)) {
24
- return b;
25
- }
26
- if ((proto === Date.prototype ||
27
- proto === URL.prototype ||
28
- proto === Set.prototype ||
29
- proto === Map.prototype) &&
30
- !hasOwnEnumerableKey(a) &&
31
- !hasOwnEnumerableKey(b)) {
32
- return replaceEqualBuiltIn(a, b, proto, depth, serializer);
33
- }
34
- if (Array.isArray(a)) {
35
- return isPlainArray(a) && isPlainArray(b) ? replaceEqualArray(a, b, depth, serializer) : b;
36
- }
37
- // same rule as isPlainObject, but reusing the prototype read above is about 15% faster
38
- if (proto === Object.prototype || proto === null || !proto.constructor) {
39
- return replaceEqualObject(a, b, proto, depth, serializer);
40
- }
41
- return replaceEqualSerialized(a, b, depth, serializer);
17
+ if (Object.is(a, b)) return a;
18
+ if (depth > 500 || typeof a !== "object" || typeof b !== "object" || a === null || b === null) return b;
19
+ const proto = Object.getPrototypeOf(a);
20
+ if (proto !== Object.getPrototypeOf(b)) return b;
21
+ if ((proto === Date.prototype || proto === URL.prototype || proto === Set.prototype || proto === Map.prototype) && !hasOwnEnumerableKey(a) && !hasOwnEnumerableKey(b)) return replaceEqualBuiltIn(a, b, proto, depth, serializer);
22
+ if (Array.isArray(a)) return isPlainArray(a) && isPlainArray(b) ? replaceEqualArray(a, b, depth, serializer) : b;
23
+ if (proto === Object.prototype || proto === null || !proto.constructor) return replaceEqualObject(a, b, proto, depth, serializer);
24
+ return replaceEqualSerialized(a, b, depth, serializer);
42
25
  }
43
26
  function replaceEqualArray(a, b, depth, serializer) {
44
- let copy;
45
- for (let i = 0; i < b.length; i++) {
46
- let value = b[i];
47
- if (i < a.length) {
48
- const aValue = a[i];
49
- if (typeof aValue === 'object' && typeof value === 'object') {
50
- value = replaceEqualDeep(aValue, value, depth + 1, serializer);
51
- }
52
- if (copy === undefined && Object.is(value, aValue)) {
53
- continue;
54
- }
55
- }
56
- copy ??= copyArrayPrefix(a, i);
57
- copy.push(value);
58
- }
59
- return copy ?? (a.length === b.length ? a : copyArrayPrefix(a, b.length));
27
+ let copy;
28
+ for (let i = 0; i < b.length; i++) {
29
+ let value = b[i];
30
+ if (i < a.length) {
31
+ const aValue = a[i];
32
+ if (typeof aValue === "object" && typeof value === "object") value = replaceEqualDeep(aValue, value, depth + 1, serializer);
33
+ if (copy === void 0 && Object.is(value, aValue)) continue;
34
+ }
35
+ copy ??= copyArrayPrefix(a, i);
36
+ copy.push(value);
37
+ }
38
+ return copy ?? (a.length === b.length ? a : copyArrayPrefix(a, b.length));
60
39
  }
61
40
  function copyArrayPrefix(a, end) {
62
- const copy = [];
63
- for (let i = 0; i < end; i++) {
64
- copy.push(a[i]);
65
- }
66
- return copy;
41
+ const copy = [];
42
+ for (let i = 0; i < end; i++) copy.push(a[i]);
43
+ return copy;
67
44
  }
68
45
  function replaceEqualObject(a, b, proto, depth, serializer) {
69
- const bKeys = Object.keys(b);
70
- let copy;
71
- for (let i = 0; i < bKeys.length; i++) {
72
- const key = bKeys[i];
73
- let value = b[key];
74
- if (Object.hasOwn(a, key)) {
75
- const aValue = a[key];
76
- if (typeof aValue === 'object' && typeof value === 'object') {
77
- value = replaceEqualDeep(aValue, value, depth + 1, serializer);
78
- }
79
- if (copy === undefined && Object.is(value, aValue)) {
80
- continue;
81
- }
82
- }
83
- copy ??= copyObjectPrefix(a, bKeys, i, proto);
84
- assign(copy, key, value);
85
- }
86
- return (copy ??
87
- (Object.keys(a).length === bKeys.length ? a : copyObjectPrefix(a, bKeys, bKeys.length, proto)));
46
+ const bKeys = Object.keys(b);
47
+ let copy;
48
+ for (let i = 0; i < bKeys.length; i++) {
49
+ const key = bKeys[i];
50
+ let value = b[key];
51
+ if (Object.hasOwn(a, key)) {
52
+ const aValue = a[key];
53
+ if (typeof aValue === "object" && typeof value === "object") value = replaceEqualDeep(aValue, value, depth + 1, serializer);
54
+ if (copy === void 0 && Object.is(value, aValue)) continue;
55
+ }
56
+ copy ??= copyObjectPrefix(a, bKeys, i, proto);
57
+ assign(copy, key, value);
58
+ }
59
+ return copy ?? (Object.keys(a).length === bKeys.length ? a : copyObjectPrefix(a, bKeys, bKeys.length, proto));
88
60
  }
89
61
  function copyObjectPrefix(a, keys, end, proto) {
90
- const copy = proto === Object.prototype ? {} : Object.create(proto);
91
- for (let i = 0; i < end; i++) {
92
- assign(copy, keys[i], a[keys[i]]);
93
- }
94
- return copy;
62
+ const copy = proto === Object.prototype ? {} : Object.create(proto);
63
+ for (let i = 0; i < end; i++) assign(copy, keys[i], a[keys[i]]);
64
+ return copy;
95
65
  }
96
66
  function assign(object, key, value) {
97
- // same as always calling setOwn, but a plain assignment keeps the copy loops about 30% faster
98
- if (key === '__proto__') {
99
- setOwn(object, key, value);
100
- }
101
- else {
102
- object[key] = value;
103
- }
67
+ if (key === "__proto__") setOwn(object, key, value);
68
+ else object[key] = value;
104
69
  }
105
70
  function replaceEqualBuiltIn(a, b, proto, depth, serializer) {
106
- if (proto === Date.prototype) {
107
- return Object.is(a.getTime(), b.getTime()) ? a : b;
108
- }
109
- if (proto === URL.prototype) {
110
- return a.href === b.href ? a : b;
111
- }
112
- if (a.size !== b.size) {
113
- return b;
114
- }
115
- if (proto === Set.prototype) {
116
- const aValues = a.values();
117
- for (const bValue of b.values()) {
118
- const aValue = aValues.next().value;
119
- if (!Object.is(replaceEqualDeep(aValue, bValue, depth + 1, serializer), aValue)) {
120
- return b;
121
- }
122
- }
123
- return a;
124
- }
125
- const aKeys = a.keys();
126
- const aValues = a.values();
127
- const bValues = b.values();
128
- for (const bKey of b.keys()) {
129
- const aKey = aKeys.next().value;
130
- const aValue = aValues.next().value;
131
- if (!Object.is(replaceEqualDeep(aKey, bKey, depth + 1, serializer), aKey) ||
132
- !Object.is(replaceEqualDeep(aValue, bValues.next().value, depth + 1, serializer), aValue)) {
133
- return b;
134
- }
135
- }
136
- return a;
71
+ if (proto === Date.prototype) return Object.is(a.getTime(), b.getTime()) ? a : b;
72
+ if (proto === URL.prototype) return a.href === b.href ? a : b;
73
+ if (a.size !== b.size) return b;
74
+ if (proto === Set.prototype) {
75
+ const aValues = a.values();
76
+ for (const bValue of b.values()) {
77
+ const aValue = aValues.next().value;
78
+ if (!Object.is(replaceEqualDeep(aValue, bValue, depth + 1, serializer), aValue)) return b;
79
+ }
80
+ return a;
81
+ }
82
+ const aKeys = a.keys();
83
+ const aValues = a.values();
84
+ const bValues = b.values();
85
+ for (const bKey of b.keys()) {
86
+ const aKey = aKeys.next().value;
87
+ const aValue = aValues.next().value;
88
+ if (!Object.is(replaceEqualDeep(aKey, bKey, depth + 1, serializer), aKey) || !Object.is(replaceEqualDeep(aValue, bValues.next().value, depth + 1, serializer), aValue)) return b;
89
+ }
90
+ return a;
137
91
  }
138
92
  function replaceEqualSerialized(a, b, depth, serializer) {
139
- const aSerialized = serializer?.serializeJson(a);
140
- if (!aSerialized?.meta?.length) {
141
- return b;
142
- }
143
- const bSerialized = serializer.serializeJson(b);
144
- return stringifyJSON(aSerialized.meta) === stringifyJSON(bSerialized.meta) &&
145
- Object.is(replaceEqualDeep(aSerialized.json, bSerialized.json, depth + 1, serializer), aSerialized.json)
146
- ? a
147
- : b;
93
+ const aSerialized = serializer?.serializeJson(a);
94
+ if (!aSerialized?.meta?.length) return b;
95
+ const bSerialized = serializer.serializeJson(b);
96
+ return stringifyJSON(aSerialized.meta) === stringifyJSON(bSerialized.meta) && Object.is(replaceEqualDeep(aSerialized.json, bSerialized.json, depth + 1, serializer), aSerialized.json) ? a : b;
148
97
  }
149
98
  function hasOwnEnumerableKey(value) {
150
- // for...in avoids the array allocation of Object.keys, which matters on this hot path
151
- for (const key in value) {
152
- if (Object.hasOwn(value, key)) {
153
- return true;
154
- }
155
- }
156
- return false;
99
+ for (const key in value) if (Object.hasOwn(value, key)) return true;
100
+ return false;
157
101
  }
158
102
  function isPlainArray(value) {
159
- return value.length === Object.keys(value).length;
103
+ return value.length === Object.keys(value).length;
160
104
  }
105
+ export { createStructuralSharing };
package/dist/types.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import type { ClientContext } from '@orpc/client';
2
- import type { DataTag, InfiniteData, InfiniteQueryObserverOptions, MutationObserverOptions, QueryFunction, QueryKey, QueryObserverOptions, SkipToken } from '@tanstack/query-core';
3
- import type { SerializableStreamedQueryOptions, SettleOnFirstDataOptions } from './stream-query.ts';
1
+ import { SerializableStreamedQueryOptions, SettleOnFirstDataOptions } from "./stream-query.js";
2
+ import { ClientContext } from "@orpc/client";
3
+ import { DataTag, InfiniteData, InfiniteQueryObserverOptions, MutationObserverOptions, QueryFunction, QueryKey, QueryObserverOptions, SkipToken } from "@tanstack/query-core";
4
4
  export type InferStreamedQueryOutput<TOutput> = TOutput extends AsyncIterable<infer U> ? U[] : never;
5
5
  export type InferLiveQueryOutput<TOutput> = TOutput extends AsyncIterable<infer U> ? U : never;
6
- export type OperationType = 'query' | 'streamed' | 'live' | 'infinite' | 'mutation';
6
+ export type OperationType = "query" | "streamed" | "live" | "infinite" | "mutation";
7
7
  /**
8
8
  * The symbol under which TanStack Query utils attach operation details
9
9
  * (key and operation type) to the client context.
@@ -18,70 +18,70 @@ export declare const OPERATION_CONTEXT_SYMBOL: unique symbol;
18
18
  * @see {@link https://orpc.dev/docs/integrations/tanstack-query#client-context | TanStack Query Integration - Client Context}
19
19
  */
20
20
  export interface OperationContext {
21
- [OPERATION_CONTEXT_SYMBOL]?: {
22
- key: QueryKey;
23
- type: OperationType;
24
- };
21
+ [OPERATION_CONTEXT_SYMBOL]?: {
22
+ key: QueryKey;
23
+ type: OperationType;
24
+ };
25
25
  }
26
26
  export type QueryKeyOptions<TInput> = (undefined extends TInput ? {
27
- input?: TInput | SkipToken;
27
+ input?: TInput | SkipToken;
28
28
  } : {
29
- input: TInput | SkipToken;
29
+ input: TInput | SkipToken;
30
30
  }) | {
31
- queryKey: QueryKey;
31
+ queryKey: QueryKey;
32
32
  };
33
33
  export type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData, TInitialData> = (undefined extends TInput ? {
34
- input?: TInput | SkipToken;
34
+ input?: TInput | SkipToken;
35
35
  } : {
36
- input: TInput | SkipToken;
36
+ input: TInput | SkipToken;
37
37
  }) & (object extends TClientContext ? {
38
- context?: TClientContext | undefined;
38
+ context?: TClientContext | undefined;
39
39
  } : {
40
- context: TClientContext;
41
- }) & Omit<QueryObserverOptions<TOutput, TError, TSelectData>, 'queryKey' | '_defaulted' | '_optimisticResults'> & {
42
- queryKey?: QueryKey | undefined;
43
- initialData?: TInitialData;
40
+ context: TClientContext;
41
+ }) & Omit<QueryObserverOptions<TOutput, TError, TSelectData>, "queryKey" | "_defaulted" | "_optimisticResults"> & {
42
+ queryKey?: QueryKey | undefined;
43
+ initialData?: TInitialData;
44
44
  };
45
- export type QueryOptionsOut<TOutput, TError, TSelectData, TInitialData> = Pick<QueryObserverOptions<TOutput, TError, TSelectData, TOutput, DataTag<QueryKey, TOutput, TError>>, 'queryKey' | 'throwOnError' | 'select' | 'retryDelay'> & (undefined extends TInitialData ? object : {
46
- initialData: TInitialData;
45
+ export type QueryOptionsOut<TOutput, TError, TSelectData, TInitialData> = Pick<QueryObserverOptions<TOutput, TError, TSelectData, TOutput, DataTag<QueryKey, TOutput, TError>>, "queryKey" | "throwOnError" | "select" | "retryDelay"> & (undefined extends TInitialData ? object : {
46
+ initialData: TInitialData;
47
47
  }) & {
48
- queryFn: QueryFunction<TOutput, DataTag<QueryKey, TOutput, TError>>;
48
+ queryFn: QueryFunction<TOutput, DataTag<QueryKey, TOutput, TError>>;
49
49
  };
50
50
  export type StreamedKeyOptions<TInput> = ((undefined extends TInput ? {
51
- input?: TInput | SkipToken;
51
+ input?: TInput | SkipToken;
52
52
  } : {
53
- input: TInput | SkipToken;
53
+ input: TInput | SkipToken;
54
54
  }) & {
55
- queryFnOptions?: SerializableStreamedQueryOptions | undefined;
55
+ queryFnOptions?: SerializableStreamedQueryOptions | undefined;
56
56
  }) | {
57
- queryKey: QueryKey;
57
+ queryKey: QueryKey;
58
58
  };
59
59
  export type StreamedOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData, TInitialData> = QueryOptionsIn<TClientContext, TInput, TOutput, TError, TSelectData, TInitialData> & {
60
- queryFnOptions?: SerializableStreamedQueryOptions | undefined;
60
+ queryFnOptions?: SerializableStreamedQueryOptions | undefined;
61
61
  } & SettleOnFirstDataOptions;
62
62
  export type StreamedOptionsOut<TOutput, TError, TSelectData, TInitialData> = QueryOptionsOut<TOutput, TError, TSelectData, TInitialData>;
63
63
  export type LiveOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData, TInitialData> = QueryOptionsIn<TClientContext, TInput, TOutput, TError, TSelectData, TInitialData> & SettleOnFirstDataOptions;
64
- export type InfiniteKeyOptions<TInput, TPageParam> = Pick<InfiniteOptionsIn<any, TInput, any, any, any, TPageParam, any>, 'input' | 'initialPageParam'> | {
65
- queryKey: QueryKey;
64
+ export type InfiniteKeyOptions<TInput, TPageParam> = Pick<InfiniteOptionsIn<any, TInput, any, any, any, TPageParam, any>, "input" | "initialPageParam"> | {
65
+ queryKey: QueryKey;
66
66
  };
67
67
  export type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData, TPageParam, TInitialData> = {
68
- input: ((pageParam: TPageParam) => TInput) | SkipToken;
69
- initialData?: TInitialData;
70
- queryKey?: QueryKey | undefined;
68
+ input: ((pageParam: TPageParam) => TInput) | SkipToken;
69
+ initialData?: TInitialData;
70
+ queryKey?: QueryKey | undefined;
71
71
  } & (object extends TClientContext ? {
72
- context?: TClientContext | undefined;
72
+ context?: TClientContext | undefined;
73
73
  } : {
74
- context: TClientContext;
75
- }) & Omit<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, QueryKey, TPageParam>, 'queryKey' | '_defaulted' | '_optimisticResults'>;
76
- export type InfiniteOptionsOut<TOutput, TError, TSelectData, TPageParam, TInitialData> = Pick<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, DataTag<QueryKey, InfiniteData<TOutput, TPageParam>, TError>, TPageParam>, 'queryKey' | 'select' | 'throwOnError' | 'retryDelay' | 'initialPageParam' | 'getNextPageParam' | 'getPreviousPageParam'> & (undefined extends TInitialData ? object : {
77
- initialData: TInitialData;
74
+ context: TClientContext;
75
+ }) & Omit<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, QueryKey, TPageParam>, "queryKey" | "_defaulted" | "_optimisticResults">;
76
+ export type InfiniteOptionsOut<TOutput, TError, TSelectData, TPageParam, TInitialData> = Pick<InfiniteQueryObserverOptions<TOutput, TError, TSelectData, DataTag<QueryKey, InfiniteData<TOutput, TPageParam>, TError>, TPageParam>, "queryKey" | "select" | "throwOnError" | "retryDelay" | "initialPageParam" | "getNextPageParam" | "getPreviousPageParam"> & (undefined extends TInitialData ? object : {
77
+ initialData: TInitialData;
78
78
  }) & {
79
- queryFn: QueryFunction<TOutput, DataTag<QueryKey, InfiniteData<TOutput, TPageParam>, TError>, TPageParam>;
79
+ queryFn: QueryFunction<TOutput, DataTag<QueryKey, InfiniteData<TOutput, TPageParam>, TError>, TPageParam>;
80
80
  };
81
- export type MutationKeyOptions = Pick<MutationOptionsIn<any, any, any, any, any>, 'mutationKey'>;
81
+ export type MutationKeyOptions = Pick<MutationOptionsIn<any, any, any, any, any>, "mutationKey">;
82
82
  export type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TMutationContext> = (object extends TClientContext ? {
83
- context?: TClientContext | undefined;
83
+ context?: TClientContext | undefined;
84
84
  } : {
85
- context: TClientContext;
85
+ context: TClientContext;
86
86
  }) & MutationOptionsOut<TInput, TOutput, TError, TMutationContext>;
87
- export type MutationOptionsOut<TInput, TOutput, TError, TMutationContext> = MutationObserverOptions<TOutput, TError, TInput, TMutationContext>;
87
+ export type MutationOptionsOut<TInput, TOutput, TError, TMutationContext> = MutationObserverOptions<TOutput, TError, TInput, TMutationContext>;
package/dist/types.js CHANGED
@@ -1,7 +1,9 @@
1
+ // src/types.ts
1
2
  /**
2
- * The symbol under which TanStack Query utils attach operation details
3
- * (key and operation type) to the client context.
4
- *
5
- * @see {@link https://orpc.dev/docs/integrations/tanstack-query#client-context | TanStack Query Integration - Client Context}
6
- */
7
- export const OPERATION_CONTEXT_SYMBOL = /* @__PURE__ */ Symbol.for('ORPC_TANSTACK_QUERY_OPERATION_CONTEXT');
3
+ * The symbol under which TanStack Query utils attach operation details
4
+ * (key and operation type) to the client context.
5
+ *
6
+ * @see {@link https://orpc.dev/docs/integrations/tanstack-query#client-context | TanStack Query Integration - Client Context}
7
+ */
8
+ const OPERATION_CONTEXT_SYMBOL = /* @__PURE__ */ Symbol.for("ORPC_TANSTACK_QUERY_OPERATION_CONTEXT");
9
+ export { OPERATION_CONTEXT_SYMBOL };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orpc/tanstack-query",
3
- "version": "2.0.0-beta.49",
3
+ "version": "2.0.0-beta.50",
4
4
  "description": "TanStack Query integration for oRPC: typesafe queries, mutations, streaming, and SSR for React, Vue, Solid, Svelte, and Angular",
5
5
  "keywords": [
6
6
  "angular-query",
@@ -41,10 +41,10 @@
41
41
  }
42
42
  },
43
43
  "dependencies": {
44
- "@orpc/client": "2.0.0-beta.49",
45
- "@orpc/contract": "2.0.0-beta.49",
46
- "@orpc/openapi": "2.0.0-beta.49",
47
- "@orpc/shared": "2.0.0-beta.49"
44
+ "@orpc/client": "2.0.0-beta.50",
45
+ "@orpc/contract": "2.0.0-beta.50",
46
+ "@orpc/openapi": "2.0.0-beta.50",
47
+ "@orpc/shared": "2.0.0-beta.50"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@angular/core": "^22.2.4",
@@ -1,4 +0,0 @@
1
- import type { Promisable } from '@orpc/shared';
2
- import type { QueryFunction, QueryFunctionContext, QueryKey } from '@tanstack/query-core';
3
- import type { SettleOnFirstDataOptions } from './stream-query.ts';
4
- export declare function liveQuery<TQueryFnData = unknown, TQueryKey extends QueryKey = QueryKey>(queryFn: (context: QueryFunctionContext<TQueryKey>) => Promisable<AsyncIterable<TQueryFnData>>, { settleOnFirstData }?: SettleOnFirstDataOptions): QueryFunction<TQueryFnData, TQueryKey>;