@trpc/react-query 11.0.0-alpha-tmp-export-from-main.213 → 11.0.0-alpha-tmp-export-from-main.217

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.
Files changed (39) hide show
  1. package/dist/createTRPCQueryUtils.js +16 -0
  2. package/dist/createTRPCQueryUtils.mjs +14 -0
  3. package/dist/createTRPCReact.js +58 -0
  4. package/dist/createTRPCReact.mjs +36 -0
  5. package/dist/index.js +10 -64
  6. package/dist/index.mjs +3 -40
  7. package/dist/internals/context.js +33 -0
  8. package/dist/internals/context.mjs +11 -0
  9. package/dist/internals/getClientArgs.js +16 -0
  10. package/dist/internals/getClientArgs.mjs +14 -0
  11. package/dist/internals/getQueryKey.d.ts.map +1 -1
  12. package/dist/internals/getQueryKey.js +57 -0
  13. package/dist/internals/getQueryKey.mjs +54 -0
  14. package/dist/internals/useHookResult.js +32 -0
  15. package/dist/internals/useHookResult.mjs +11 -0
  16. package/dist/server/index.js +2 -102
  17. package/dist/server/index.mjs +1 -103
  18. package/dist/server/ssgProxy.js +107 -0
  19. package/dist/server/ssgProxy.mjs +105 -0
  20. package/dist/{createHooksInternal-5d2fa367.js → shared/hooks/createHooksInternal.js} +28 -183
  21. package/dist/{createHooksInternal-e0b0564e.mjs → shared/hooks/createHooksInternal.mjs} +8 -158
  22. package/dist/shared/index.js +13 -15
  23. package/dist/shared/index.mjs +7 -7
  24. package/dist/shared/proxy/decorationProxy.js +31 -0
  25. package/dist/shared/proxy/decorationProxy.mjs +29 -0
  26. package/dist/shared/proxy/useQueriesProxy.js +25 -0
  27. package/dist/shared/proxy/useQueriesProxy.mjs +23 -0
  28. package/dist/shared/proxy/utilsProxy.js +89 -0
  29. package/dist/{utilsProxy-61a4601f.mjs → shared/proxy/utilsProxy.mjs} +3 -51
  30. package/dist/{queryClient-4d766c0c.mjs → shared/queryClient.mjs} +1 -1
  31. package/dist/utils/createUtilityFunctions.js +94 -0
  32. package/dist/utils/createUtilityFunctions.mjs +92 -0
  33. package/package.json +6 -6
  34. package/src/internals/getQueryKey.ts +19 -1
  35. package/dist/createHooksInternal-4285c71a.js +0 -470
  36. package/dist/queryClient-1c8d7d8a.js +0 -8
  37. package/dist/utilsProxy-0b88c1e3.js +0 -161
  38. package/dist/utilsProxy-ff357a62.js +0 -128
  39. /package/dist/{queryClient-358a9a75.js → shared/queryClient.js} +0 -0
@@ -1,103 +1 @@
1
- import { dehydrate } from '@tanstack/react-query';
2
- import { TRPCUntypedClient, getUntypedClient } from '@trpc/client';
3
- import { callProcedure, createFlatProxy, createRecursiveProxy } from '@trpc/core';
4
- import { b as getQueryKeyInternal, d as getQueryType } from '../utilsProxy-61a4601f.mjs';
5
- import 'react';
6
- import { g as getQueryClient } from '../queryClient-4d766c0c.mjs';
7
-
8
- /**
9
- * Create functions you can use for server-side rendering / static generation
10
- * @link https://trpc.io/docs/v11/client/nextjs/server-side-helpers
11
- */ function createServerSideHelpers(opts) {
12
- const queryClient = getQueryClient(opts);
13
- const resolvedOpts = (()=>{
14
- if ('router' in opts) {
15
- const { transformer , ctx , router } = opts;
16
- return {
17
- serialize: transformer ? ('input' in transformer ? transformer.input : transformer).serialize : (obj)=>obj,
18
- query: (queryOpts)=>{
19
- return callProcedure({
20
- procedures: router._def.procedures,
21
- path: queryOpts.path,
22
- getRawInput: async ()=>queryOpts.input,
23
- ctx,
24
- type: 'query'
25
- });
26
- }
27
- };
28
- }
29
- const { client } = opts;
30
- const untypedClient = client instanceof TRPCUntypedClient ? client : getUntypedClient(client);
31
- return {
32
- query: (queryOpts)=>untypedClient.query(queryOpts.path, queryOpts.input),
33
- serialize: (obj)=>untypedClient.runtime.transformer.serialize(obj)
34
- };
35
- })();
36
- function _dehydrate(opts = {
37
- shouldDehydrateQuery () {
38
- // makes sure to serialize errors
39
- return true;
40
- }
41
- }) {
42
- const before = dehydrate(queryClient, opts);
43
- const after = resolvedOpts.serialize(before);
44
- return after;
45
- }
46
- return createFlatProxy((key)=>{
47
- if (key === 'queryClient') return queryClient;
48
- if (key === 'dehydrate') return _dehydrate;
49
- return createRecursiveProxy((opts)=>{
50
- const args = opts.args;
51
- const input = args[0];
52
- const arrayPath = [
53
- key,
54
- ...opts.path
55
- ];
56
- const utilName = arrayPath.pop();
57
- const queryFn = ()=>resolvedOpts.query({
58
- path: arrayPath.join('.'),
59
- input
60
- });
61
- const queryKey = getQueryKeyInternal(arrayPath, input, getQueryType(utilName));
62
- const helperMap = {
63
- fetch: ()=>{
64
- const args1 = args[1];
65
- return queryClient.fetchQuery({
66
- ...args1,
67
- queryKey,
68
- queryFn
69
- });
70
- },
71
- fetchInfinite: ()=>{
72
- const args1 = args[1];
73
- return queryClient.fetchInfiniteQuery({
74
- ...args1,
75
- queryKey,
76
- queryFn,
77
- initialPageParam: args1?.initialCursor ?? null
78
- });
79
- },
80
- prefetch: ()=>{
81
- const args1 = args[1];
82
- return queryClient.prefetchQuery({
83
- ...args1,
84
- queryKey,
85
- queryFn
86
- });
87
- },
88
- prefetchInfinite: ()=>{
89
- const args1 = args[1];
90
- return queryClient.prefetchInfiniteQuery({
91
- ...args1,
92
- queryKey,
93
- queryFn,
94
- initialPageParam: args1?.initialCursor ?? null
95
- });
96
- }
97
- };
98
- return helperMap[utilName]();
99
- });
100
- });
101
- }
102
-
103
- export { createServerSideHelpers };
1
+ export { createServerSideHelpers } from './ssgProxy.mjs';
@@ -0,0 +1,107 @@
1
+ 'use strict';
2
+
3
+ var reactQuery = require('@tanstack/react-query');
4
+ var client = require('@trpc/client');
5
+ var core = require('@trpc/core');
6
+ var getQueryKey = require('../internals/getQueryKey.js');
7
+ var utilsProxy = require('../shared/proxy/utilsProxy.js');
8
+ require('react');
9
+ require('../internals/context.js');
10
+ var queryClient = require('../shared/queryClient.js');
11
+
12
+ /**
13
+ * Create functions you can use for server-side rendering / static generation
14
+ * @link https://trpc.io/docs/v11/client/nextjs/server-side-helpers
15
+ */ function createServerSideHelpers(opts) {
16
+ const queryClient$1 = queryClient.getQueryClient(opts);
17
+ const resolvedOpts = (()=>{
18
+ if ('router' in opts) {
19
+ const { transformer , ctx , router } = opts;
20
+ return {
21
+ serialize: transformer ? ('input' in transformer ? transformer.input : transformer).serialize : (obj)=>obj,
22
+ query: (queryOpts)=>{
23
+ return core.callProcedure({
24
+ procedures: router._def.procedures,
25
+ path: queryOpts.path,
26
+ getRawInput: async ()=>queryOpts.input,
27
+ ctx,
28
+ type: 'query'
29
+ });
30
+ }
31
+ };
32
+ }
33
+ const { client: client$1 } = opts;
34
+ const untypedClient = client$1 instanceof client.TRPCUntypedClient ? client$1 : client.getUntypedClient(client$1);
35
+ return {
36
+ query: (queryOpts)=>untypedClient.query(queryOpts.path, queryOpts.input),
37
+ serialize: (obj)=>untypedClient.runtime.transformer.serialize(obj)
38
+ };
39
+ })();
40
+ function _dehydrate(opts = {
41
+ shouldDehydrateQuery () {
42
+ // makes sure to serialize errors
43
+ return true;
44
+ }
45
+ }) {
46
+ const before = reactQuery.dehydrate(queryClient$1, opts);
47
+ const after = resolvedOpts.serialize(before);
48
+ return after;
49
+ }
50
+ return core.createFlatProxy((key)=>{
51
+ if (key === 'queryClient') return queryClient$1;
52
+ if (key === 'dehydrate') return _dehydrate;
53
+ return core.createRecursiveProxy((opts)=>{
54
+ const args = opts.args;
55
+ const input = args[0];
56
+ const arrayPath = [
57
+ key,
58
+ ...opts.path
59
+ ];
60
+ const utilName = arrayPath.pop();
61
+ const queryFn = ()=>resolvedOpts.query({
62
+ path: arrayPath.join('.'),
63
+ input
64
+ });
65
+ const queryKey = getQueryKey.getQueryKeyInternal(arrayPath, input, utilsProxy.getQueryType(utilName));
66
+ const helperMap = {
67
+ fetch: ()=>{
68
+ const args1 = args[1];
69
+ return queryClient$1.fetchQuery({
70
+ ...args1,
71
+ queryKey,
72
+ queryFn
73
+ });
74
+ },
75
+ fetchInfinite: ()=>{
76
+ const args1 = args[1];
77
+ return queryClient$1.fetchInfiniteQuery({
78
+ ...args1,
79
+ queryKey,
80
+ queryFn,
81
+ initialPageParam: args1?.initialCursor ?? null
82
+ });
83
+ },
84
+ prefetch: ()=>{
85
+ const args1 = args[1];
86
+ return queryClient$1.prefetchQuery({
87
+ ...args1,
88
+ queryKey,
89
+ queryFn
90
+ });
91
+ },
92
+ prefetchInfinite: ()=>{
93
+ const args1 = args[1];
94
+ return queryClient$1.prefetchInfiniteQuery({
95
+ ...args1,
96
+ queryKey,
97
+ queryFn,
98
+ initialPageParam: args1?.initialCursor ?? null
99
+ });
100
+ }
101
+ };
102
+ return helperMap[utilName]();
103
+ });
104
+ });
105
+ }
106
+
107
+ exports.createServerSideHelpers = createServerSideHelpers;
@@ -0,0 +1,105 @@
1
+ import { dehydrate } from '@tanstack/react-query';
2
+ import { TRPCUntypedClient, getUntypedClient } from '@trpc/client';
3
+ import { callProcedure, createFlatProxy, createRecursiveProxy } from '@trpc/core';
4
+ import { getQueryKeyInternal } from '../internals/getQueryKey.mjs';
5
+ import { getQueryType } from '../shared/proxy/utilsProxy.mjs';
6
+ import 'react';
7
+ import '../internals/context.mjs';
8
+ import { getQueryClient } from '../shared/queryClient.mjs';
9
+
10
+ /**
11
+ * Create functions you can use for server-side rendering / static generation
12
+ * @link https://trpc.io/docs/v11/client/nextjs/server-side-helpers
13
+ */ function createServerSideHelpers(opts) {
14
+ const queryClient = getQueryClient(opts);
15
+ const resolvedOpts = (()=>{
16
+ if ('router' in opts) {
17
+ const { transformer , ctx , router } = opts;
18
+ return {
19
+ serialize: transformer ? ('input' in transformer ? transformer.input : transformer).serialize : (obj)=>obj,
20
+ query: (queryOpts)=>{
21
+ return callProcedure({
22
+ procedures: router._def.procedures,
23
+ path: queryOpts.path,
24
+ getRawInput: async ()=>queryOpts.input,
25
+ ctx,
26
+ type: 'query'
27
+ });
28
+ }
29
+ };
30
+ }
31
+ const { client } = opts;
32
+ const untypedClient = client instanceof TRPCUntypedClient ? client : getUntypedClient(client);
33
+ return {
34
+ query: (queryOpts)=>untypedClient.query(queryOpts.path, queryOpts.input),
35
+ serialize: (obj)=>untypedClient.runtime.transformer.serialize(obj)
36
+ };
37
+ })();
38
+ function _dehydrate(opts = {
39
+ shouldDehydrateQuery () {
40
+ // makes sure to serialize errors
41
+ return true;
42
+ }
43
+ }) {
44
+ const before = dehydrate(queryClient, opts);
45
+ const after = resolvedOpts.serialize(before);
46
+ return after;
47
+ }
48
+ return createFlatProxy((key)=>{
49
+ if (key === 'queryClient') return queryClient;
50
+ if (key === 'dehydrate') return _dehydrate;
51
+ return createRecursiveProxy((opts)=>{
52
+ const args = opts.args;
53
+ const input = args[0];
54
+ const arrayPath = [
55
+ key,
56
+ ...opts.path
57
+ ];
58
+ const utilName = arrayPath.pop();
59
+ const queryFn = ()=>resolvedOpts.query({
60
+ path: arrayPath.join('.'),
61
+ input
62
+ });
63
+ const queryKey = getQueryKeyInternal(arrayPath, input, getQueryType(utilName));
64
+ const helperMap = {
65
+ fetch: ()=>{
66
+ const args1 = args[1];
67
+ return queryClient.fetchQuery({
68
+ ...args1,
69
+ queryKey,
70
+ queryFn
71
+ });
72
+ },
73
+ fetchInfinite: ()=>{
74
+ const args1 = args[1];
75
+ return queryClient.fetchInfiniteQuery({
76
+ ...args1,
77
+ queryKey,
78
+ queryFn,
79
+ initialPageParam: args1?.initialCursor ?? null
80
+ });
81
+ },
82
+ prefetch: ()=>{
83
+ const args1 = args[1];
84
+ return queryClient.prefetchQuery({
85
+ ...args1,
86
+ queryKey,
87
+ queryFn
88
+ });
89
+ },
90
+ prefetchInfinite: ()=>{
91
+ const args1 = args[1];
92
+ return queryClient.prefetchInfiniteQuery({
93
+ ...args1,
94
+ queryKey,
95
+ queryFn,
96
+ initialPageParam: args1?.initialCursor ?? null
97
+ });
98
+ }
99
+ };
100
+ return helperMap[utilName]();
101
+ });
102
+ });
103
+ }
104
+
105
+ export { createServerSideHelpers };
@@ -1,13 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var core = require('@trpc/core');
4
3
  var reactQuery = require('@tanstack/react-query');
5
4
  var client = require('@trpc/client');
6
5
  var React = require('react');
7
- var utilsProxy = require('./utilsProxy-0b88c1e3.js');
6
+ var context = require('../../internals/context.js');
7
+ var getClientArgs = require('../../internals/getClientArgs.js');
8
+ var getQueryKey = require('../../internals/getQueryKey.js');
9
+ var useHookResult = require('../../internals/useHookResult.js');
10
+ var createUtilityFunctions = require('../../utils/createUtilityFunctions.js');
11
+ var useQueriesProxy = require('../proxy/useQueriesProxy.js');
8
12
 
9
- function _interopNamespace(e) {
10
- if (e && e.__esModule) return e;
13
+ function _interopNamespaceDefault(e) {
11
14
  var n = Object.create(null);
12
15
  if (e) {
13
16
  Object.keys(e).forEach(function (k) {
@@ -20,178 +23,24 @@ function _interopNamespace(e) {
20
23
  }
21
24
  });
22
25
  }
23
- n["default"] = e;
26
+ n.default = e;
24
27
  return Object.freeze(n);
25
28
  }
26
29
 
27
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
28
-
29
- /**
30
- * Create proxy for decorating procedures
31
- * @internal
32
- */ function createReactDecoration(name, hooks) {
33
- return core.createRecursiveProxy(({ path , args })=>{
34
- const pathCopy = [
35
- name,
36
- ...path
37
- ];
38
- // The last arg is for instance `.useMutation` or `.useQuery()`
39
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
40
- const lastArg = pathCopy.pop();
41
- if (lastArg === 'useMutation') {
42
- return hooks[lastArg](pathCopy, ...args);
43
- }
44
- if (lastArg === '_def') {
45
- return {
46
- path: pathCopy
47
- };
48
- }
49
- const [input, ...rest] = args;
50
- const opts = rest[0] || {};
51
- return hooks[lastArg](pathCopy, input, opts);
52
- });
53
- }
54
-
55
- /**
56
- * Create proxy for `useQueries` options
57
- * @internal
58
- */ function createUseQueries(client) {
59
- return core.createRecursiveProxy((opts)=>{
60
- const arrayPath = opts.path;
61
- const dotPath = arrayPath.join('.');
62
- const [input, _opts] = opts.args;
63
- const options = {
64
- queryKey: utilsProxy.getQueryKeyInternal(arrayPath, input, 'query'),
65
- queryFn: ()=>{
66
- return client.query(dotPath, input, _opts?.trpc);
67
- },
68
- ..._opts
69
- };
70
- return options;
71
- });
72
- }
73
-
74
- /**
75
- * @internal
76
- */ function getClientArgs(queryKey, opts, pageParam) {
77
- const path = queryKey[0];
78
- const input = queryKey[1]?.input;
79
- if (pageParam) input.cursor = pageParam;
80
- return [
81
- path.join('.'),
82
- input,
83
- opts?.trpc
84
- ];
85
- }
86
-
87
- /**
88
- * Makes a stable reference of the `trpc` prop
89
- */ function useHookResult(value) {
90
- const ref = React__namespace.useRef(value);
91
- ref.current.path = value.path;
92
- return ref.current;
93
- }
94
-
95
- /**
96
- * Creates a set of utility functions that can be used to interact with `react-query`
97
- * @param opts the `TRPCClient` and `QueryClient` to use
98
- * @returns a set of utility functions that can be used to interact with `react-query`
99
- * @internal
100
- */ function createUtilityFunctions(opts) {
101
- const { client: client$1 , queryClient } = opts;
102
- const untypedClient = client$1 instanceof client.TRPCUntypedClient ? client$1 : client.getUntypedClient(client$1);
103
- return {
104
- fetchQuery: (queryKey, opts)=>{
105
- return queryClient.fetchQuery({
106
- ...opts,
107
- queryKey,
108
- queryFn: ()=>untypedClient.query(...getClientArgs(queryKey, opts))
109
- });
110
- },
111
- fetchInfiniteQuery: (queryKey, opts)=>{
112
- return queryClient.fetchInfiniteQuery({
113
- ...opts,
114
- queryKey,
115
- queryFn: ({ pageParam })=>{
116
- return untypedClient.query(...getClientArgs(queryKey, opts, pageParam));
117
- },
118
- initialPageParam: opts?.initialCursor ?? null
119
- });
120
- },
121
- prefetchQuery: (queryKey, opts)=>{
122
- return queryClient.prefetchQuery({
123
- ...opts,
124
- queryKey,
125
- queryFn: ()=>untypedClient.query(...getClientArgs(queryKey, opts))
126
- });
127
- },
128
- prefetchInfiniteQuery: (queryKey, opts)=>{
129
- return queryClient.prefetchInfiniteQuery({
130
- ...opts,
131
- queryKey,
132
- queryFn: ({ pageParam })=>{
133
- return untypedClient.query(...getClientArgs(queryKey, opts, pageParam));
134
- },
135
- initialPageParam: opts?.initialCursor ?? null
136
- });
137
- },
138
- ensureQueryData: (queryKey, opts)=>{
139
- return queryClient.ensureQueryData({
140
- ...opts,
141
- queryKey,
142
- queryFn: ()=>untypedClient.query(...getClientArgs(queryKey, opts))
143
- });
144
- },
145
- invalidateQueries: (queryKey, filters, options)=>{
146
- return queryClient.invalidateQueries({
147
- ...filters,
148
- queryKey
149
- }, options);
150
- },
151
- resetQueries: (queryKey, filters, options)=>{
152
- return queryClient.resetQueries({
153
- ...filters,
154
- queryKey
155
- }, options);
156
- },
157
- refetchQueries: (queryKey, filters, options)=>{
158
- return queryClient.refetchQueries({
159
- ...filters,
160
- queryKey
161
- }, options);
162
- },
163
- cancelQuery: (queryKey, options)=>{
164
- return queryClient.cancelQueries({
165
- queryKey
166
- }, options);
167
- },
168
- setQueryData: (queryKey, updater, options)=>{
169
- return queryClient.setQueryData(queryKey, updater, options);
170
- },
171
- getQueryData: (queryKey)=>{
172
- return queryClient.getQueryData(queryKey);
173
- },
174
- setInfiniteQueryData: (queryKey, updater, options)=>{
175
- return queryClient.setQueryData(queryKey, updater, options);
176
- },
177
- getInfiniteQueryData: (queryKey)=>{
178
- return queryClient.getQueryData(queryKey);
179
- }
180
- };
181
- }
30
+ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
182
31
 
183
32
  /**
184
33
  * @internal
185
34
  */ function createRootHooks(config) {
186
35
  const mutationSuccessOverride = config?.overrides?.useMutation?.onSuccess ?? ((options)=>options.originalFn());
187
- const Context = config?.context ?? utilsProxy.TRPCContext;
36
+ const Context = config?.context ?? context.TRPCContext;
188
37
  const createClient = (opts)=>{
189
38
  return client.createTRPCUntypedClient(opts);
190
39
  };
191
40
  const TRPCProvider = (props)=>{
192
41
  const { abortOnUnmount =false , client , queryClient , ssrContext } = props;
193
42
  const [ssrState, setSSRState] = React__namespace.useState(props.ssrState ?? false);
194
- const fns = React__namespace.useMemo(()=>createUtilityFunctions({
43
+ const fns = React__namespace.useMemo(()=>createUtilityFunctions.createUtilityFunctions({
195
44
  client,
196
45
  queryClient
197
46
  }), [
@@ -244,7 +93,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
244
93
  function useQuery(path, input, opts) {
245
94
  const context = useContext();
246
95
  const { abortOnUnmount , client , ssrState , queryClient , prefetchQuery } = context;
247
- const queryKey = utilsProxy.getQueryKeyInternal(path, input, 'query');
96
+ const queryKey = getQueryKey.getQueryKeyInternal(path, input, 'query');
248
97
  const defaultOpts = queryClient.getQueryDefaults(queryKey);
249
98
  if (typeof window === 'undefined' && ssrState === 'prepass' && opts?.trpc?.ssr !== false && (opts?.enabled ?? defaultOpts?.enabled) !== false && !queryClient.getQueryCache().find({
250
99
  queryKey
@@ -269,17 +118,17 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
269
118
  } : {}
270
119
  }
271
120
  };
272
- return client.query(...getClientArgs(queryKey, actualOpts));
121
+ return client.query(...getClientArgs.getClientArgs(queryKey, actualOpts));
273
122
  }
274
123
  }, queryClient);
275
- hook.trpc = useHookResult({
124
+ hook.trpc = useHookResult.useHookResult({
276
125
  path: path.join('.')
277
126
  });
278
127
  return hook;
279
128
  }
280
129
  function useSuspenseQuery(path, input, opts) {
281
130
  const context = useContext();
282
- const queryKey = utilsProxy.getQueryKeyInternal(path, input, 'query');
131
+ const queryKey = getQueryKey.getQueryKeyInternal(path, input, 'query');
283
132
  const shouldAbortOnUnmount = opts?.trpc?.abortOnUnmount ?? config?.abortOnUnmount ?? context.abortOnUnmount;
284
133
  const hook = reactQuery.useSuspenseQuery({
285
134
  ...opts,
@@ -292,10 +141,10 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
292
141
  } : {}
293
142
  }
294
143
  };
295
- return context.client.query(...getClientArgs(queryKey, actualOpts));
144
+ return context.client.query(...getClientArgs.getClientArgs(queryKey, actualOpts));
296
145
  }
297
146
  }, context.queryClient);
298
- hook.trpc = useHookResult({
147
+ hook.trpc = useHookResult.useHookResult({
299
148
  path: path.join('.')
300
149
  });
301
150
  return [
@@ -314,7 +163,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
314
163
  ...opts,
315
164
  mutationKey: mutationKey,
316
165
  mutationFn: (input)=>{
317
- return client.mutation(...getClientArgs([
166
+ return client.mutation(...getClientArgs.getClientArgs([
318
167
  path,
319
168
  {
320
169
  input
@@ -330,14 +179,14 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
330
179
  });
331
180
  }
332
181
  }, queryClient);
333
- hook.trpc = useHookResult({
182
+ hook.trpc = useHookResult.useHookResult({
334
183
  path: path.join('.')
335
184
  });
336
185
  return hook;
337
186
  }
338
187
  /* istanbul ignore next -- @preserve */ function useSubscription(path, input, opts) {
339
188
  const enabled = opts?.enabled ?? true;
340
- const queryKey = reactQuery.hashKey(utilsProxy.getQueryKeyInternal(path, input, 'any'));
189
+ const queryKey = reactQuery.hashKey(getQueryKey.getQueryKeyInternal(path, input, 'any'));
341
190
  const { client } = useContext();
342
191
  const optsRef = React__namespace.useRef(opts);
343
192
  optsRef.current = opts;
@@ -375,7 +224,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
375
224
  }
376
225
  function useInfiniteQuery(path, input, opts) {
377
226
  const { client , ssrState , prefetchInfiniteQuery , queryClient , abortOnUnmount , } = useContext();
378
- const queryKey = utilsProxy.getQueryKeyInternal(path, input, 'infinite');
227
+ const queryKey = getQueryKey.getQueryKeyInternal(path, input, 'infinite');
379
228
  const defaultOpts = queryClient.getQueryDefaults(queryKey);
380
229
  if (typeof window === 'undefined' && ssrState === 'prepass' && opts?.trpc?.ssr !== false && (opts?.enabled ?? defaultOpts?.enabled) !== false && !queryClient.getQueryCache().find({
381
230
  queryKey
@@ -406,17 +255,17 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
406
255
  } : {}
407
256
  }
408
257
  };
409
- return client.query(...getClientArgs(queryKey, actualOpts, queryFunctionContext.pageParam ?? opts.initialCursor));
258
+ return client.query(...getClientArgs.getClientArgs(queryKey, actualOpts, queryFunctionContext.pageParam ?? opts.initialCursor));
410
259
  }
411
260
  }, queryClient);
412
- hook.trpc = useHookResult({
261
+ hook.trpc = useHookResult.useHookResult({
413
262
  path: path.join('.')
414
263
  });
415
264
  return hook;
416
265
  }
417
266
  function useSuspenseInfiniteQuery(path, input, opts) {
418
267
  const context = useContext();
419
- const queryKey = utilsProxy.getQueryKeyInternal(path, input, 'infinite');
268
+ const queryKey = getQueryKey.getQueryKeyInternal(path, input, 'infinite');
420
269
  const defaultOpts = context.queryClient.getQueryDefaults(queryKey);
421
270
  const ssrOpts = useSSRQueryOptionsIfNeeded(queryKey, {
422
271
  ...defaultOpts,
@@ -438,10 +287,10 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
438
287
  } : {}
439
288
  }
440
289
  };
441
- return context.client.query(...getClientArgs(queryKey, actualOpts, queryFunctionContext.pageParam ?? opts.initialCursor));
290
+ return context.client.query(...getClientArgs.getClientArgs(queryKey, actualOpts, queryFunctionContext.pageParam ?? opts.initialCursor));
442
291
  }
443
292
  }, context.queryClient);
444
- hook.trpc = useHookResult({
293
+ hook.trpc = useHookResult.useHookResult({
445
294
  path: path.join('.')
446
295
  });
447
296
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -452,7 +301,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
452
301
  }
453
302
  const useQueries = (queriesCallback)=>{
454
303
  const { ssrState , queryClient , prefetchQuery , client } = useContext();
455
- const proxy = createUseQueries(client);
304
+ const proxy = useQueriesProxy.createUseQueries(client);
456
305
  const queries = queriesCallback(proxy);
457
306
  if (typeof window === 'undefined' && ssrState === 'prepass') {
458
307
  for (const query of queries){
@@ -473,7 +322,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
473
322
  };
474
323
  const useSuspenseQueries = (queriesCallback)=>{
475
324
  const { queryClient , client } = useContext();
476
- const proxy = createUseQueries(client);
325
+ const proxy = useQueriesProxy.createUseQueries(client);
477
326
  const queries = queriesCallback(proxy);
478
327
  const hook = reactQuery.useSuspenseQueries({
479
328
  queries: queries.map((query)=>({
@@ -515,8 +364,4 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
515
364
  };
516
365
  }
517
366
 
518
- exports.createReactDecoration = createReactDecoration;
519
367
  exports.createRootHooks = createRootHooks;
520
- exports.createUseQueries = createUseQueries;
521
- exports.createUtilityFunctions = createUtilityFunctions;
522
- exports.getClientArgs = getClientArgs;