@trpc/react-query 11.0.0-next.92 → 11.0.0-rc.329
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/README.md +4 -4
- package/dist/bundle-analysis.json +83 -51
- package/dist/createTRPCQueryUtils.d.ts +4 -0
- package/dist/createTRPCQueryUtils.d.ts.map +1 -0
- package/dist/createTRPCQueryUtils.js +16 -0
- package/dist/createTRPCQueryUtils.mjs +14 -0
- package/dist/createTRPCReact.d.ts +55 -40
- package/dist/createTRPCReact.d.ts.map +1 -1
- package/dist/createTRPCReact.js +58 -0
- package/dist/createTRPCReact.mjs +36 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -36
- package/dist/index.mjs +3 -35
- package/dist/internals/context.d.ts +23 -18
- package/dist/internals/context.d.ts.map +1 -1
- package/dist/internals/context.js +33 -0
- package/dist/internals/context.mjs +11 -0
- package/dist/internals/getClientArgs.d.ts +8 -2
- package/dist/internals/getClientArgs.d.ts.map +1 -1
- package/dist/internals/getClientArgs.js +24 -0
- package/dist/internals/getClientArgs.mjs +22 -0
- package/dist/internals/getQueryKey.d.ts +8 -13
- package/dist/internals/getQueryKey.d.ts.map +1 -1
- package/dist/internals/getQueryKey.js +60 -0
- package/dist/internals/getQueryKey.mjs +57 -0
- package/dist/internals/useHookResult.d.ts +4 -6
- package/dist/internals/useHookResult.d.ts.map +1 -1
- package/dist/internals/useHookResult.js +35 -0
- package/dist/internals/useHookResult.mjs +14 -0
- package/dist/internals/useQueries.d.ts +32 -4
- package/dist/internals/useQueries.d.ts.map +1 -1
- package/dist/server/index.js +2 -103
- package/dist/server/index.mjs +1 -104
- package/dist/server/ssgProxy.d.ts +21 -21
- package/dist/server/ssgProxy.d.ts.map +1 -1
- package/dist/server/ssgProxy.js +109 -0
- package/dist/server/ssgProxy.mjs +107 -0
- package/dist/shared/hooks/createHooksInternal.d.ts +8 -31
- package/dist/shared/hooks/createHooksInternal.d.ts.map +1 -1
- package/dist/{createHooksInternal-e2034194.js → shared/hooks/createHooksInternal.js} +98 -226
- package/dist/{createHooksInternal-3d8ebfcf.mjs → shared/hooks/createHooksInternal.mjs} +70 -210
- package/dist/shared/hooks/types.d.ts +11 -7
- package/dist/shared/hooks/types.d.ts.map +1 -1
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +14 -15
- package/dist/shared/index.mjs +7 -7
- package/dist/shared/polymorphism/mutationLike.d.ts +6 -7
- package/dist/shared/polymorphism/mutationLike.d.ts.map +1 -1
- package/dist/shared/polymorphism/queryLike.d.ts +10 -7
- package/dist/shared/polymorphism/queryLike.d.ts.map +1 -1
- package/dist/shared/polymorphism/routerLike.d.ts +6 -6
- package/dist/shared/polymorphism/routerLike.d.ts.map +1 -1
- package/dist/shared/polymorphism/utilsLike.d.ts +3 -3
- package/dist/shared/polymorphism/utilsLike.d.ts.map +1 -1
- package/dist/shared/proxy/decorationProxy.d.ts +2 -2
- package/dist/shared/proxy/decorationProxy.d.ts.map +1 -1
- package/dist/shared/proxy/decorationProxy.js +31 -0
- package/dist/shared/proxy/decorationProxy.mjs +29 -0
- package/dist/shared/proxy/useQueriesProxy.d.ts +14 -8
- package/dist/shared/proxy/useQueriesProxy.d.ts.map +1 -1
- package/dist/shared/proxy/useQueriesProxy.js +25 -0
- package/dist/shared/proxy/useQueriesProxy.mjs +23 -0
- package/dist/shared/proxy/utilsProxy.d.ts +28 -24
- package/dist/shared/proxy/utilsProxy.d.ts.map +1 -1
- package/dist/shared/proxy/utilsProxy.js +89 -0
- package/dist/shared/proxy/utilsProxy.mjs +85 -0
- package/dist/shared/queryClient.d.ts +2 -1
- package/dist/shared/queryClient.d.ts.map +1 -1
- package/dist/{queryClient-4d766c0c.mjs → shared/queryClient.mjs} +1 -1
- package/dist/shared/types.d.ts +2 -2
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/utils/createUtilityFunctions.d.ts +23 -0
- package/dist/utils/createUtilityFunctions.d.ts.map +1 -0
- package/dist/utils/createUtilityFunctions.js +100 -0
- package/dist/utils/createUtilityFunctions.mjs +98 -0
- package/dist/utils/inferReactQueryProcedure.d.ts +11 -10
- package/dist/utils/inferReactQueryProcedure.d.ts.map +1 -1
- package/package.json +18 -18
- package/src/createTRPCQueryUtils.tsx +11 -0
- package/src/createTRPCReact.tsx +139 -163
- package/src/index.ts +6 -1
- package/src/internals/context.tsx +27 -18
- package/src/internals/getClientArgs.ts +16 -4
- package/src/internals/getQueryKey.ts +51 -62
- package/src/internals/useHookResult.ts +12 -13
- package/src/internals/useQueries.ts +129 -4
- package/src/server/ssgProxy.ts +59 -57
- package/src/shared/hooks/createHooksInternal.tsx +115 -246
- package/src/shared/hooks/types.ts +15 -7
- package/src/shared/index.ts +5 -2
- package/src/shared/polymorphism/mutationLike.ts +21 -15
- package/src/shared/polymorphism/queryLike.ts +34 -14
- package/src/shared/polymorphism/routerLike.ts +29 -15
- package/src/shared/polymorphism/utilsLike.ts +6 -3
- package/src/shared/proxy/decorationProxy.ts +3 -3
- package/src/shared/proxy/useQueriesProxy.ts +65 -28
- package/src/shared/proxy/utilsProxy.ts +113 -86
- package/src/shared/queryClient.ts +2 -1
- package/src/shared/types.ts +5 -2
- package/src/utils/createUtilityFunctions.ts +137 -0
- package/src/utils/inferReactQueryProcedure.ts +38 -28
- package/dist/createHooksInternal-dce6e141.js +0 -435
- package/dist/queryClient-1c8d7d8a.js +0 -8
- package/dist/utilsProxy-00894da2.mjs +0 -121
- package/dist/utilsProxy-27bd93c1.js +0 -128
- package/dist/utilsProxy-7e396600.js +0 -114
- /package/dist/{queryClient-358a9a75.js → shared/queryClient.js} +0 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var client = require('@trpc/client');
|
|
4
|
+
var getClientArgs = require('../internals/getClientArgs.js');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Creates a set of utility functions that can be used to interact with `react-query`
|
|
8
|
+
* @param opts the `TRPCClient` and `QueryClient` to use
|
|
9
|
+
* @returns a set of utility functions that can be used to interact with `react-query`
|
|
10
|
+
* @internal
|
|
11
|
+
*/ function createUtilityFunctions(opts) {
|
|
12
|
+
const { client: client$1 , queryClient } = opts;
|
|
13
|
+
const untypedClient = client$1 instanceof client.TRPCUntypedClient ? client$1 : client.getUntypedClient(client$1);
|
|
14
|
+
return {
|
|
15
|
+
fetchQuery: (queryKey, opts)=>{
|
|
16
|
+
return queryClient.fetchQuery({
|
|
17
|
+
...opts,
|
|
18
|
+
queryKey,
|
|
19
|
+
queryFn: ()=>untypedClient.query(...getClientArgs.getClientArgs(queryKey, opts))
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
fetchInfiniteQuery: (queryKey, opts)=>{
|
|
23
|
+
return queryClient.fetchInfiniteQuery({
|
|
24
|
+
...opts,
|
|
25
|
+
queryKey,
|
|
26
|
+
queryFn: ({ pageParam , direction })=>{
|
|
27
|
+
return untypedClient.query(...getClientArgs.getClientArgs(queryKey, opts, {
|
|
28
|
+
pageParam,
|
|
29
|
+
direction
|
|
30
|
+
}));
|
|
31
|
+
},
|
|
32
|
+
initialPageParam: opts?.initialCursor ?? null
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
prefetchQuery: (queryKey, opts)=>{
|
|
36
|
+
return queryClient.prefetchQuery({
|
|
37
|
+
...opts,
|
|
38
|
+
queryKey,
|
|
39
|
+
queryFn: ()=>untypedClient.query(...getClientArgs.getClientArgs(queryKey, opts))
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
prefetchInfiniteQuery: (queryKey, opts)=>{
|
|
43
|
+
return queryClient.prefetchInfiniteQuery({
|
|
44
|
+
...opts,
|
|
45
|
+
queryKey,
|
|
46
|
+
queryFn: ({ pageParam , direction })=>{
|
|
47
|
+
return untypedClient.query(...getClientArgs.getClientArgs(queryKey, opts, {
|
|
48
|
+
pageParam,
|
|
49
|
+
direction
|
|
50
|
+
}));
|
|
51
|
+
},
|
|
52
|
+
initialPageParam: opts?.initialCursor ?? null
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
ensureQueryData: (queryKey, opts)=>{
|
|
56
|
+
return queryClient.ensureQueryData({
|
|
57
|
+
...opts,
|
|
58
|
+
queryKey,
|
|
59
|
+
queryFn: ()=>untypedClient.query(...getClientArgs.getClientArgs(queryKey, opts))
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
invalidateQueries: (queryKey, filters, options)=>{
|
|
63
|
+
return queryClient.invalidateQueries({
|
|
64
|
+
...filters,
|
|
65
|
+
queryKey
|
|
66
|
+
}, options);
|
|
67
|
+
},
|
|
68
|
+
resetQueries: (queryKey, filters, options)=>{
|
|
69
|
+
return queryClient.resetQueries({
|
|
70
|
+
...filters,
|
|
71
|
+
queryKey
|
|
72
|
+
}, options);
|
|
73
|
+
},
|
|
74
|
+
refetchQueries: (queryKey, filters, options)=>{
|
|
75
|
+
return queryClient.refetchQueries({
|
|
76
|
+
...filters,
|
|
77
|
+
queryKey
|
|
78
|
+
}, options);
|
|
79
|
+
},
|
|
80
|
+
cancelQuery: (queryKey, options)=>{
|
|
81
|
+
return queryClient.cancelQueries({
|
|
82
|
+
queryKey
|
|
83
|
+
}, options);
|
|
84
|
+
},
|
|
85
|
+
setQueryData: (queryKey, updater, options)=>{
|
|
86
|
+
return queryClient.setQueryData(queryKey, updater, options);
|
|
87
|
+
},
|
|
88
|
+
getQueryData: (queryKey)=>{
|
|
89
|
+
return queryClient.getQueryData(queryKey);
|
|
90
|
+
},
|
|
91
|
+
setInfiniteQueryData: (queryKey, updater, options)=>{
|
|
92
|
+
return queryClient.setQueryData(queryKey, updater, options);
|
|
93
|
+
},
|
|
94
|
+
getInfiniteQueryData: (queryKey)=>{
|
|
95
|
+
return queryClient.getQueryData(queryKey);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
exports.createUtilityFunctions = createUtilityFunctions;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { TRPCUntypedClient, getUntypedClient } from '@trpc/client';
|
|
2
|
+
import { getClientArgs } from '../internals/getClientArgs.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Creates a set of utility functions that can be used to interact with `react-query`
|
|
6
|
+
* @param opts the `TRPCClient` and `QueryClient` to use
|
|
7
|
+
* @returns a set of utility functions that can be used to interact with `react-query`
|
|
8
|
+
* @internal
|
|
9
|
+
*/ function createUtilityFunctions(opts) {
|
|
10
|
+
const { client , queryClient } = opts;
|
|
11
|
+
const untypedClient = client instanceof TRPCUntypedClient ? client : getUntypedClient(client);
|
|
12
|
+
return {
|
|
13
|
+
fetchQuery: (queryKey, opts)=>{
|
|
14
|
+
return queryClient.fetchQuery({
|
|
15
|
+
...opts,
|
|
16
|
+
queryKey,
|
|
17
|
+
queryFn: ()=>untypedClient.query(...getClientArgs(queryKey, opts))
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
fetchInfiniteQuery: (queryKey, opts)=>{
|
|
21
|
+
return queryClient.fetchInfiniteQuery({
|
|
22
|
+
...opts,
|
|
23
|
+
queryKey,
|
|
24
|
+
queryFn: ({ pageParam , direction })=>{
|
|
25
|
+
return untypedClient.query(...getClientArgs(queryKey, opts, {
|
|
26
|
+
pageParam,
|
|
27
|
+
direction
|
|
28
|
+
}));
|
|
29
|
+
},
|
|
30
|
+
initialPageParam: opts?.initialCursor ?? null
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
prefetchQuery: (queryKey, opts)=>{
|
|
34
|
+
return queryClient.prefetchQuery({
|
|
35
|
+
...opts,
|
|
36
|
+
queryKey,
|
|
37
|
+
queryFn: ()=>untypedClient.query(...getClientArgs(queryKey, opts))
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
prefetchInfiniteQuery: (queryKey, opts)=>{
|
|
41
|
+
return queryClient.prefetchInfiniteQuery({
|
|
42
|
+
...opts,
|
|
43
|
+
queryKey,
|
|
44
|
+
queryFn: ({ pageParam , direction })=>{
|
|
45
|
+
return untypedClient.query(...getClientArgs(queryKey, opts, {
|
|
46
|
+
pageParam,
|
|
47
|
+
direction
|
|
48
|
+
}));
|
|
49
|
+
},
|
|
50
|
+
initialPageParam: opts?.initialCursor ?? null
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
ensureQueryData: (queryKey, opts)=>{
|
|
54
|
+
return queryClient.ensureQueryData({
|
|
55
|
+
...opts,
|
|
56
|
+
queryKey,
|
|
57
|
+
queryFn: ()=>untypedClient.query(...getClientArgs(queryKey, opts))
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
invalidateQueries: (queryKey, filters, options)=>{
|
|
61
|
+
return queryClient.invalidateQueries({
|
|
62
|
+
...filters,
|
|
63
|
+
queryKey
|
|
64
|
+
}, options);
|
|
65
|
+
},
|
|
66
|
+
resetQueries: (queryKey, filters, options)=>{
|
|
67
|
+
return queryClient.resetQueries({
|
|
68
|
+
...filters,
|
|
69
|
+
queryKey
|
|
70
|
+
}, options);
|
|
71
|
+
},
|
|
72
|
+
refetchQueries: (queryKey, filters, options)=>{
|
|
73
|
+
return queryClient.refetchQueries({
|
|
74
|
+
...filters,
|
|
75
|
+
queryKey
|
|
76
|
+
}, options);
|
|
77
|
+
},
|
|
78
|
+
cancelQuery: (queryKey, options)=>{
|
|
79
|
+
return queryClient.cancelQueries({
|
|
80
|
+
queryKey
|
|
81
|
+
}, options);
|
|
82
|
+
},
|
|
83
|
+
setQueryData: (queryKey, updater, options)=>{
|
|
84
|
+
return queryClient.setQueryData(queryKey, updater, options);
|
|
85
|
+
},
|
|
86
|
+
getQueryData: (queryKey)=>{
|
|
87
|
+
return queryClient.getQueryData(queryKey);
|
|
88
|
+
},
|
|
89
|
+
setInfiniteQueryData: (queryKey, updater, options)=>{
|
|
90
|
+
return queryClient.setQueryData(queryKey, updater, options);
|
|
91
|
+
},
|
|
92
|
+
getInfiniteQueryData: (queryKey)=>{
|
|
93
|
+
return queryClient.getQueryData(queryKey);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export { createUtilityFunctions };
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { TRPCClientErrorLike } from '@trpc/client';
|
|
2
|
-
import { AnyMutationProcedure, AnyProcedure, AnyQueryProcedure,
|
|
3
|
-
import {
|
|
4
|
-
import { UseTRPCMutationOptions, UseTRPCMutationResult, UseTRPCQueryOptions, UseTRPCQueryResult } from '../shared';
|
|
1
|
+
import type { TRPCClientErrorLike } from '@trpc/client';
|
|
2
|
+
import type { AnyMutationProcedure, AnyProcedure, AnyQueryProcedure, AnyRootTypes, AnyRouter, inferProcedureInput, inferTransformedProcedureOutput, RouterRecord } from '@trpc/server/unstable-core-do-not-import';
|
|
3
|
+
import type { UseTRPCMutationOptions, UseTRPCMutationResult, UseTRPCQueryOptions, UseTRPCQueryResult } from '../shared';
|
|
5
4
|
/**
|
|
6
5
|
* @internal
|
|
7
6
|
*/
|
|
8
|
-
export type InferQueryOptions<
|
|
7
|
+
export type InferQueryOptions<TRoot extends AnyRootTypes, TProcedure extends AnyProcedure, TData = inferTransformedProcedureOutput<TRoot, TProcedure>> = Omit<UseTRPCQueryOptions<inferTransformedProcedureOutput<TRoot, TProcedure>, inferTransformedProcedureOutput<TRoot, TProcedure>, TRPCClientErrorLike<TRoot>, TData>, 'select'>;
|
|
9
8
|
/**
|
|
10
9
|
* @internal
|
|
11
10
|
*/
|
|
12
|
-
export type InferMutationOptions<
|
|
11
|
+
export type InferMutationOptions<TRoot extends AnyRootTypes, TProcedure extends AnyProcedure> = UseTRPCMutationOptions<inferProcedureInput<TProcedure>, TRPCClientErrorLike<TRoot>, inferTransformedProcedureOutput<TRoot, TProcedure>>;
|
|
13
12
|
/**
|
|
14
13
|
* @internal
|
|
15
14
|
*/
|
|
16
|
-
export type InferQueryResult<
|
|
15
|
+
export type InferQueryResult<TRoot extends AnyRootTypes, TProcedure extends AnyProcedure> = UseTRPCQueryResult<inferTransformedProcedureOutput<TRoot, TProcedure>, TRPCClientErrorLike<TRoot>>;
|
|
17
16
|
/**
|
|
18
17
|
* @internal
|
|
19
18
|
*/
|
|
20
|
-
export type InferMutationResult<
|
|
21
|
-
|
|
22
|
-
[TKey in keyof
|
|
19
|
+
export type InferMutationResult<TRoot extends AnyRootTypes, TProcedure extends AnyProcedure, TContext = unknown> = UseTRPCMutationResult<inferTransformedProcedureOutput<TRoot, TProcedure>, TRPCClientErrorLike<TRoot>, inferProcedureInput<TProcedure>, TContext>;
|
|
20
|
+
type inferReactQueryProcedureOptionsInner<TRoot extends AnyRootTypes, TRecord extends RouterRecord> = {
|
|
21
|
+
[TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends RouterRecord ? inferReactQueryProcedureOptionsInner<TRoot, $Value> : $Value extends AnyMutationProcedure ? InferMutationOptions<TRoot, $Value> : $Value extends AnyQueryProcedure ? InferQueryOptions<TRoot, $Value> : never : never;
|
|
23
22
|
};
|
|
23
|
+
export type inferReactQueryProcedureOptions<TRouter extends AnyRouter> = inferReactQueryProcedureOptionsInner<TRouter['_def']['_config']['$types'], TRouter['_def']['record']>;
|
|
24
|
+
export {};
|
|
24
25
|
//# sourceMappingURL=inferReactQueryProcedure.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inferReactQueryProcedure.d.ts","sourceRoot":"","sources":["../../src/utils/inferReactQueryProcedure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"inferReactQueryProcedure.d.ts","sourceRoot":"","sources":["../../src/utils/inferReactQueryProcedure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EACV,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,mBAAmB,EACnB,+BAA+B,EAC/B,YAAY,EACb,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,WAAW,CAAC;AAEnB;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAC3B,KAAK,SAAS,YAAY,EAC1B,UAAU,SAAS,YAAY,EAC/B,KAAK,GAAG,+BAA+B,CAAC,KAAK,EAAE,UAAU,CAAC,IACxD,IAAI,CACN,mBAAmB,CACjB,+BAA+B,CAAC,KAAK,EAAE,UAAU,CAAC,EAClD,+BAA+B,CAAC,KAAK,EAAE,UAAU,CAAC,EAClD,mBAAmB,CAAC,KAAK,CAAC,EAC1B,KAAK,CACN,EACD,QAAQ,CACT,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,CAC9B,KAAK,SAAS,YAAY,EAC1B,UAAU,SAAS,YAAY,IAC7B,sBAAsB,CACxB,mBAAmB,CAAC,UAAU,CAAC,EAC/B,mBAAmB,CAAC,KAAK,CAAC,EAC1B,+BAA+B,CAAC,KAAK,EAAE,UAAU,CAAC,CACnD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAC1B,KAAK,SAAS,YAAY,EAC1B,UAAU,SAAS,YAAY,IAC7B,kBAAkB,CACpB,+BAA+B,CAAC,KAAK,EAAE,UAAU,CAAC,EAClD,mBAAmB,CAAC,KAAK,CAAC,CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAC7B,KAAK,SAAS,YAAY,EAC1B,UAAU,SAAS,YAAY,EAC/B,QAAQ,GAAG,OAAO,IAChB,qBAAqB,CACvB,+BAA+B,CAAC,KAAK,EAAE,UAAU,CAAC,EAClD,mBAAmB,CAAC,KAAK,CAAC,EAC1B,mBAAmB,CAAC,UAAU,CAAC,EAC/B,QAAQ,CACT,CAAC;AAEF,KAAK,oCAAoC,CACvC,KAAK,SAAS,YAAY,EAC1B,OAAO,SAAS,YAAY,IAC1B;KACD,IAAI,IAAI,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,MAAM,MAAM,GACvD,MAAM,SAAS,YAAY,GACzB,oCAAoC,CAAC,KAAK,EAAE,MAAM,CAAC,GACnD,MAAM,SAAS,oBAAoB,GACnC,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,GACnC,MAAM,SAAS,iBAAiB,GAChC,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,GAChC,KAAK,GACP,KAAK;CACV,CAAC;AAEF,MAAM,MAAM,+BAA+B,CAAC,OAAO,SAAS,SAAS,IACnE,oCAAoC,CAClC,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EACpC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAC1B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/react-query",
|
|
3
|
-
"version": "11.0.0-
|
|
3
|
+
"version": "11.0.0-rc.329+fdcb4a7d8",
|
|
4
4
|
"description": "The tRPC React library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"build": "rollup --config rollup.config.ts --configPlugin rollup-plugin-swc3",
|
|
18
18
|
"dev": "pnpm build --watch",
|
|
19
19
|
"codegen-entrypoints": "tsx entrypoints.script.ts",
|
|
20
|
-
"lint": "eslint --cache --ext \".js,.ts,.tsx\" --ignore-path ../../.gitignore
|
|
21
|
-
"ts-watch": "tsc --
|
|
20
|
+
"lint": "eslint --cache --ext \".js,.ts,.tsx\" --ignore-path ../../.gitignore src",
|
|
21
|
+
"ts-watch": "tsc --watch"
|
|
22
22
|
},
|
|
23
23
|
"exports": {
|
|
24
24
|
"./package.json": "./package.json",
|
|
@@ -57,26 +57,26 @@
|
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@tanstack/react-query": "^5.
|
|
61
|
-
"@trpc/client": "11.0.0-
|
|
62
|
-
"@trpc/server": "11.0.0-
|
|
63
|
-
"react": ">=
|
|
64
|
-
"react-dom": ">=
|
|
60
|
+
"@tanstack/react-query": "^5.25.0",
|
|
61
|
+
"@trpc/client": "11.0.0-rc.329+fdcb4a7d8",
|
|
62
|
+
"@trpc/server": "11.0.0-rc.329+fdcb4a7d8",
|
|
63
|
+
"react": ">=18.2.0",
|
|
64
|
+
"react-dom": ">=18.2.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@tanstack/react-query": "^5.
|
|
68
|
-
"@trpc/client": "11.0.0-
|
|
69
|
-
"@trpc/server": "11.0.0-
|
|
67
|
+
"@tanstack/react-query": "^5.25.0",
|
|
68
|
+
"@trpc/client": "11.0.0-rc.329+fdcb4a7d8",
|
|
69
|
+
"@trpc/server": "11.0.0-rc.329+fdcb4a7d8",
|
|
70
70
|
"@types/express": "^4.17.17",
|
|
71
|
-
"@types/node": "^
|
|
72
|
-
"@types/react": "^18.2.
|
|
73
|
-
"eslint": "^8.
|
|
71
|
+
"@types/node": "^20.10.0",
|
|
72
|
+
"@types/react": "^18.2.33",
|
|
73
|
+
"eslint": "^8.56.0",
|
|
74
74
|
"express": "^4.17.1",
|
|
75
|
-
"next": "^
|
|
75
|
+
"next": "^14.1.4",
|
|
76
76
|
"react": "^18.2.0",
|
|
77
77
|
"react-dom": "^18.2.0",
|
|
78
|
-
"rollup": "^
|
|
79
|
-
"tsx": "^
|
|
78
|
+
"rollup": "^4.9.5",
|
|
79
|
+
"tsx": "^4.0.0",
|
|
80
80
|
"zod": "^3.0.0"
|
|
81
81
|
},
|
|
82
82
|
"publishConfig": {
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"funding": [
|
|
86
86
|
"https://trpc.io/sponsor"
|
|
87
87
|
],
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "fdcb4a7d8168d19f9bcbc816b80db815b06a134c"
|
|
89
89
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AnyRouter } from '@trpc/server/unstable-core-do-not-import';
|
|
2
|
+
import { createQueryUtilsProxy } from './shared';
|
|
3
|
+
import type { CreateQueryUtilsOptions } from './utils/createUtilityFunctions';
|
|
4
|
+
import { createUtilityFunctions } from './utils/createUtilityFunctions';
|
|
5
|
+
|
|
6
|
+
export function createTRPCQueryUtils<TRouter extends AnyRouter>(
|
|
7
|
+
opts: CreateQueryUtilsOptions<TRouter>,
|
|
8
|
+
) {
|
|
9
|
+
const utils = createUtilityFunctions(opts);
|
|
10
|
+
return createQueryUtilsProxy<TRouter>(utils);
|
|
11
|
+
}
|