@trpc/react-query 10.8.1 → 10.8.2

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.
@@ -143,7 +143,7 @@ const TRPCContext = /*#__PURE__*/ React.createContext(null);
143
143
  queryFn: ()=>{
144
144
  return client.query(path, input);
145
145
  },
146
- ...rest[1]
146
+ ...rest[0]
147
147
  };
148
148
  return options;
149
149
  });
@@ -199,69 +199,95 @@ function getClientArgs(pathAndInput, opts) {
199
199
  ssrContext: ssrContext || null,
200
200
  ssrState,
201
201
  fetchQuery: React.useCallback((pathAndInput, opts)=>{
202
- return queryClient.fetchQuery(getArrayQueryKey.getArrayQueryKey(pathAndInput, 'query'), ()=>client.query(...getClientArgs(pathAndInput, opts)), opts);
202
+ return queryClient.fetchQuery({
203
+ ...opts,
204
+ queryKey: getArrayQueryKey.getArrayQueryKey(pathAndInput, 'query'),
205
+ queryFn: ()=>client.query(...getClientArgs(pathAndInput, opts))
206
+ });
203
207
  }, [
204
208
  client,
205
209
  queryClient
206
210
  ]),
207
211
  fetchInfiniteQuery: React.useCallback((pathAndInput, opts)=>{
208
- return queryClient.fetchInfiniteQuery(getArrayQueryKey.getArrayQueryKey(pathAndInput, 'infinite'), ({ pageParam })=>{
209
- const [path, input] = pathAndInput;
210
- const actualInput = {
211
- ...input,
212
- cursor: pageParam
213
- };
214
- return client.query(...getClientArgs([
215
- path,
216
- actualInput
217
- ], opts));
218
- }, opts);
212
+ return queryClient.fetchInfiniteQuery({
213
+ ...opts,
214
+ queryKey: getArrayQueryKey.getArrayQueryKey(pathAndInput, 'infinite'),
215
+ queryFn: ({ pageParam })=>{
216
+ const [path, input] = pathAndInput;
217
+ const actualInput = {
218
+ ...input,
219
+ cursor: pageParam
220
+ };
221
+ return client.query(...getClientArgs([
222
+ path,
223
+ actualInput
224
+ ], opts));
225
+ }
226
+ });
219
227
  }, [
220
228
  client,
221
229
  queryClient
222
230
  ]),
223
231
  prefetchQuery: React.useCallback((pathAndInput, opts)=>{
224
- return queryClient.prefetchQuery(getArrayQueryKey.getArrayQueryKey(pathAndInput, 'query'), ()=>client.query(...getClientArgs(pathAndInput, opts)), opts);
232
+ return queryClient.prefetchQuery({
233
+ ...opts,
234
+ queryKey: getArrayQueryKey.getArrayQueryKey(pathAndInput, 'query'),
235
+ queryFn: ()=>client.query(...getClientArgs(pathAndInput, opts))
236
+ });
225
237
  }, [
226
238
  client,
227
239
  queryClient
228
240
  ]),
229
241
  prefetchInfiniteQuery: React.useCallback((pathAndInput, opts)=>{
230
- return queryClient.prefetchInfiniteQuery(getArrayQueryKey.getArrayQueryKey(pathAndInput, 'infinite'), ({ pageParam })=>{
231
- const [path, input] = pathAndInput;
232
- const actualInput = {
233
- ...input,
234
- cursor: pageParam
235
- };
236
- return client.query(...getClientArgs([
237
- path,
238
- actualInput
239
- ], opts));
240
- }, opts);
242
+ return queryClient.prefetchInfiniteQuery({
243
+ ...opts,
244
+ queryKey: getArrayQueryKey.getArrayQueryKey(pathAndInput, 'infinite'),
245
+ queryFn: ({ pageParam })=>{
246
+ const [path, input] = pathAndInput;
247
+ const actualInput = {
248
+ ...input,
249
+ cursor: pageParam
250
+ };
251
+ return client.query(...getClientArgs([
252
+ path,
253
+ actualInput
254
+ ], opts));
255
+ }
256
+ });
241
257
  }, [
242
258
  client,
243
259
  queryClient
244
260
  ]),
245
- invalidateQueries: React.useCallback((...args)=>{
246
- const [queryKey, ...rest] = args;
247
- return queryClient.invalidateQueries(getArrayQueryKey.getArrayQueryKey(queryKey, 'any'), ...rest);
261
+ invalidateQueries: React.useCallback((queryKey, filters, options)=>{
262
+ return queryClient.invalidateQueries({
263
+ ...filters,
264
+ queryKey: getArrayQueryKey.getArrayQueryKey(queryKey, 'any')
265
+ }, options);
248
266
  }, [
249
267
  queryClient
250
268
  ]),
251
269
  resetQueries: React.useCallback((...args)=>{
252
- const [queryKey, ...rest] = args;
253
- return queryClient.resetQueries(getArrayQueryKey.getArrayQueryKey(queryKey, 'any'), ...rest);
270
+ const [queryKey, filters, options] = args;
271
+ return queryClient.resetQueries({
272
+ ...filters,
273
+ queryKey: getArrayQueryKey.getArrayQueryKey(queryKey, 'any')
274
+ }, options);
254
275
  }, [
255
276
  queryClient
256
277
  ]),
257
278
  refetchQueries: React.useCallback((...args)=>{
258
- const [queryKey, ...rest] = args;
259
- return queryClient.refetchQueries(getArrayQueryKey.getArrayQueryKey(queryKey, 'any'), ...rest);
279
+ const [queryKey, filters, options] = args;
280
+ return queryClient.refetchQueries({
281
+ ...filters,
282
+ queryKey: getArrayQueryKey.getArrayQueryKey(queryKey, 'any')
283
+ }, options);
260
284
  }, [
261
285
  queryClient
262
286
  ]),
263
287
  cancelQuery: React.useCallback((pathAndInput)=>{
264
- return queryClient.cancelQueries(getArrayQueryKey.getArrayQueryKey(pathAndInput, 'any'));
288
+ return queryClient.cancelQueries({
289
+ queryKey: getArrayQueryKey.getArrayQueryKey(pathAndInput, 'any')
290
+ });
265
291
  }, [
266
292
  queryClient
267
293
  ]),
@@ -314,20 +340,22 @@ function getClientArgs(pathAndInput, opts) {
314
340
  const ssrOpts = useSSRQueryOptionsIfNeeded(pathAndInput, 'query', opts);
315
341
  // request option should take priority over global
316
342
  const shouldAbortOnUnmount = opts?.trpc?.abortOnUnmount ?? abortOnUnmount;
317
- const hook = reactQuery.useQuery(getArrayQueryKey.getArrayQueryKey(pathAndInput, 'query'), (queryFunctionContext)=>{
318
- const actualOpts = {
319
- ...ssrOpts,
320
- trpc: {
321
- ...ssrOpts?.trpc,
322
- ...shouldAbortOnUnmount ? {
323
- signal: queryFunctionContext.signal
324
- } : {}
325
- }
326
- };
327
- return client.query(...getClientArgs(pathAndInput, actualOpts));
328
- }, {
329
- context: ReactQueryContext,
330
- ...ssrOpts
343
+ const hook = reactQuery.useQuery({
344
+ ...ssrOpts,
345
+ queryKey: getArrayQueryKey.getArrayQueryKey(pathAndInput, 'query'),
346
+ queryFn: (queryFunctionContext)=>{
347
+ const actualOpts = {
348
+ ...ssrOpts,
349
+ trpc: {
350
+ ...ssrOpts?.trpc,
351
+ ...shouldAbortOnUnmount ? {
352
+ signal: queryFunctionContext.signal
353
+ } : {}
354
+ }
355
+ };
356
+ return client.query(...getClientArgs(pathAndInput, actualOpts));
357
+ },
358
+ context: ReactQueryContext
331
359
  });
332
360
  hook.trpc = useHookResult({
333
361
  path: pathAndInput[0]
@@ -340,15 +368,16 @@ function getClientArgs(pathAndInput, opts) {
340
368
  const queryClient = reactQuery.useQueryClient({
341
369
  context: ReactQueryContext
342
370
  });
343
- const hook = reactQuery.useMutation((input)=>{
344
- const actualPath = Array.isArray(path) ? path[0] : path;
345
- return client.mutation(...getClientArgs([
346
- actualPath,
347
- input
348
- ], opts));
349
- }, {
350
- context: ReactQueryContext,
371
+ const hook = reactQuery.useMutation({
351
372
  ...opts,
373
+ mutationFn: (input)=>{
374
+ const actualPath = Array.isArray(path) ? path[0] : path;
375
+ return client.mutation(...getClientArgs([
376
+ actualPath,
377
+ input
378
+ ], opts));
379
+ },
380
+ context: ReactQueryContext,
352
381
  onSuccess (...args) {
353
382
  const originalFn = ()=>opts?.onSuccess?.(...args);
354
383
  return mutationSuccessOverride({
@@ -410,28 +439,30 @@ function getClientArgs(pathAndInput, opts) {
410
439
  const ssrOpts = useSSRQueryOptionsIfNeeded(pathAndInput, 'infinite', opts);
411
440
  // request option should take priority over global
412
441
  const shouldAbortOnUnmount = opts?.trpc?.abortOnUnmount ?? abortOnUnmount;
413
- const hook = reactQuery.useInfiniteQuery(getArrayQueryKey.getArrayQueryKey(pathAndInput, 'infinite'), (queryFunctionContext)=>{
414
- const actualOpts = {
415
- ...ssrOpts,
416
- trpc: {
417
- ...ssrOpts?.trpc,
418
- ...shouldAbortOnUnmount ? {
419
- signal: queryFunctionContext.signal
420
- } : {}
421
- }
422
- };
423
- const actualInput = {
424
- ...input ?? {},
425
- cursor: queryFunctionContext.pageParam
426
- };
427
- // FIXME as any shouldn't be needed as client should be untyped too
428
- return client.query(...getClientArgs([
429
- path,
430
- actualInput
431
- ], actualOpts));
432
- }, {
433
- context: ReactQueryContext,
434
- ...ssrOpts
442
+ const hook = reactQuery.useInfiniteQuery({
443
+ ...ssrOpts,
444
+ queryKey: getArrayQueryKey.getArrayQueryKey(pathAndInput, 'infinite'),
445
+ queryFn: (queryFunctionContext)=>{
446
+ const actualOpts = {
447
+ ...ssrOpts,
448
+ trpc: {
449
+ ...ssrOpts?.trpc,
450
+ ...shouldAbortOnUnmount ? {
451
+ signal: queryFunctionContext.signal
452
+ } : {}
453
+ }
454
+ };
455
+ const actualInput = {
456
+ ...input ?? {},
457
+ cursor: queryFunctionContext.pageParam
458
+ };
459
+ // FIXME as any shouldn't be needed as client should be untyped too
460
+ return client.query(...getClientArgs([
461
+ path,
462
+ actualInput
463
+ ], actualOpts));
464
+ },
465
+ context: ReactQueryContext
435
466
  });
436
467
  hook.trpc = useHookResult({
437
468
  path
@@ -137,7 +137,7 @@ const TRPCContext = /*#__PURE__*/ createContext(null);
137
137
  queryFn: ()=>{
138
138
  return client.query(path, input);
139
139
  },
140
- ...rest[1]
140
+ ...rest[0]
141
141
  };
142
142
  return options;
143
143
  });
@@ -193,69 +193,95 @@ function getClientArgs(pathAndInput, opts) {
193
193
  ssrContext: ssrContext || null,
194
194
  ssrState,
195
195
  fetchQuery: useCallback((pathAndInput, opts)=>{
196
- return queryClient.fetchQuery(getArrayQueryKey(pathAndInput, 'query'), ()=>client.query(...getClientArgs(pathAndInput, opts)), opts);
196
+ return queryClient.fetchQuery({
197
+ ...opts,
198
+ queryKey: getArrayQueryKey(pathAndInput, 'query'),
199
+ queryFn: ()=>client.query(...getClientArgs(pathAndInput, opts))
200
+ });
197
201
  }, [
198
202
  client,
199
203
  queryClient
200
204
  ]),
201
205
  fetchInfiniteQuery: useCallback((pathAndInput, opts)=>{
202
- return queryClient.fetchInfiniteQuery(getArrayQueryKey(pathAndInput, 'infinite'), ({ pageParam })=>{
203
- const [path, input] = pathAndInput;
204
- const actualInput = {
205
- ...input,
206
- cursor: pageParam
207
- };
208
- return client.query(...getClientArgs([
209
- path,
210
- actualInput
211
- ], opts));
212
- }, opts);
206
+ return queryClient.fetchInfiniteQuery({
207
+ ...opts,
208
+ queryKey: getArrayQueryKey(pathAndInput, 'infinite'),
209
+ queryFn: ({ pageParam })=>{
210
+ const [path, input] = pathAndInput;
211
+ const actualInput = {
212
+ ...input,
213
+ cursor: pageParam
214
+ };
215
+ return client.query(...getClientArgs([
216
+ path,
217
+ actualInput
218
+ ], opts));
219
+ }
220
+ });
213
221
  }, [
214
222
  client,
215
223
  queryClient
216
224
  ]),
217
225
  prefetchQuery: useCallback((pathAndInput, opts)=>{
218
- return queryClient.prefetchQuery(getArrayQueryKey(pathAndInput, 'query'), ()=>client.query(...getClientArgs(pathAndInput, opts)), opts);
226
+ return queryClient.prefetchQuery({
227
+ ...opts,
228
+ queryKey: getArrayQueryKey(pathAndInput, 'query'),
229
+ queryFn: ()=>client.query(...getClientArgs(pathAndInput, opts))
230
+ });
219
231
  }, [
220
232
  client,
221
233
  queryClient
222
234
  ]),
223
235
  prefetchInfiniteQuery: useCallback((pathAndInput, opts)=>{
224
- return queryClient.prefetchInfiniteQuery(getArrayQueryKey(pathAndInput, 'infinite'), ({ pageParam })=>{
225
- const [path, input] = pathAndInput;
226
- const actualInput = {
227
- ...input,
228
- cursor: pageParam
229
- };
230
- return client.query(...getClientArgs([
231
- path,
232
- actualInput
233
- ], opts));
234
- }, opts);
236
+ return queryClient.prefetchInfiniteQuery({
237
+ ...opts,
238
+ queryKey: getArrayQueryKey(pathAndInput, 'infinite'),
239
+ queryFn: ({ pageParam })=>{
240
+ const [path, input] = pathAndInput;
241
+ const actualInput = {
242
+ ...input,
243
+ cursor: pageParam
244
+ };
245
+ return client.query(...getClientArgs([
246
+ path,
247
+ actualInput
248
+ ], opts));
249
+ }
250
+ });
235
251
  }, [
236
252
  client,
237
253
  queryClient
238
254
  ]),
239
- invalidateQueries: useCallback((...args)=>{
240
- const [queryKey, ...rest] = args;
241
- return queryClient.invalidateQueries(getArrayQueryKey(queryKey, 'any'), ...rest);
255
+ invalidateQueries: useCallback((queryKey, filters, options)=>{
256
+ return queryClient.invalidateQueries({
257
+ ...filters,
258
+ queryKey: getArrayQueryKey(queryKey, 'any')
259
+ }, options);
242
260
  }, [
243
261
  queryClient
244
262
  ]),
245
263
  resetQueries: useCallback((...args)=>{
246
- const [queryKey, ...rest] = args;
247
- return queryClient.resetQueries(getArrayQueryKey(queryKey, 'any'), ...rest);
264
+ const [queryKey, filters, options] = args;
265
+ return queryClient.resetQueries({
266
+ ...filters,
267
+ queryKey: getArrayQueryKey(queryKey, 'any')
268
+ }, options);
248
269
  }, [
249
270
  queryClient
250
271
  ]),
251
272
  refetchQueries: useCallback((...args)=>{
252
- const [queryKey, ...rest] = args;
253
- return queryClient.refetchQueries(getArrayQueryKey(queryKey, 'any'), ...rest);
273
+ const [queryKey, filters, options] = args;
274
+ return queryClient.refetchQueries({
275
+ ...filters,
276
+ queryKey: getArrayQueryKey(queryKey, 'any')
277
+ }, options);
254
278
  }, [
255
279
  queryClient
256
280
  ]),
257
281
  cancelQuery: useCallback((pathAndInput)=>{
258
- return queryClient.cancelQueries(getArrayQueryKey(pathAndInput, 'any'));
282
+ return queryClient.cancelQueries({
283
+ queryKey: getArrayQueryKey(pathAndInput, 'any')
284
+ });
259
285
  }, [
260
286
  queryClient
261
287
  ]),
@@ -308,20 +334,22 @@ function getClientArgs(pathAndInput, opts) {
308
334
  const ssrOpts = useSSRQueryOptionsIfNeeded(pathAndInput, 'query', opts);
309
335
  // request option should take priority over global
310
336
  const shouldAbortOnUnmount = opts?.trpc?.abortOnUnmount ?? abortOnUnmount;
311
- const hook = useQuery(getArrayQueryKey(pathAndInput, 'query'), (queryFunctionContext)=>{
312
- const actualOpts = {
313
- ...ssrOpts,
314
- trpc: {
315
- ...ssrOpts?.trpc,
316
- ...shouldAbortOnUnmount ? {
317
- signal: queryFunctionContext.signal
318
- } : {}
319
- }
320
- };
321
- return client.query(...getClientArgs(pathAndInput, actualOpts));
322
- }, {
323
- context: ReactQueryContext,
324
- ...ssrOpts
337
+ const hook = useQuery({
338
+ ...ssrOpts,
339
+ queryKey: getArrayQueryKey(pathAndInput, 'query'),
340
+ queryFn: (queryFunctionContext)=>{
341
+ const actualOpts = {
342
+ ...ssrOpts,
343
+ trpc: {
344
+ ...ssrOpts?.trpc,
345
+ ...shouldAbortOnUnmount ? {
346
+ signal: queryFunctionContext.signal
347
+ } : {}
348
+ }
349
+ };
350
+ return client.query(...getClientArgs(pathAndInput, actualOpts));
351
+ },
352
+ context: ReactQueryContext
325
353
  });
326
354
  hook.trpc = useHookResult({
327
355
  path: pathAndInput[0]
@@ -334,15 +362,16 @@ function getClientArgs(pathAndInput, opts) {
334
362
  const queryClient = useQueryClient({
335
363
  context: ReactQueryContext
336
364
  });
337
- const hook = useMutation((input)=>{
338
- const actualPath = Array.isArray(path) ? path[0] : path;
339
- return client.mutation(...getClientArgs([
340
- actualPath,
341
- input
342
- ], opts));
343
- }, {
344
- context: ReactQueryContext,
365
+ const hook = useMutation({
345
366
  ...opts,
367
+ mutationFn: (input)=>{
368
+ const actualPath = Array.isArray(path) ? path[0] : path;
369
+ return client.mutation(...getClientArgs([
370
+ actualPath,
371
+ input
372
+ ], opts));
373
+ },
374
+ context: ReactQueryContext,
346
375
  onSuccess (...args) {
347
376
  const originalFn = ()=>opts?.onSuccess?.(...args);
348
377
  return mutationSuccessOverride({
@@ -404,28 +433,30 @@ function getClientArgs(pathAndInput, opts) {
404
433
  const ssrOpts = useSSRQueryOptionsIfNeeded(pathAndInput, 'infinite', opts);
405
434
  // request option should take priority over global
406
435
  const shouldAbortOnUnmount = opts?.trpc?.abortOnUnmount ?? abortOnUnmount;
407
- const hook = useInfiniteQuery(getArrayQueryKey(pathAndInput, 'infinite'), (queryFunctionContext)=>{
408
- const actualOpts = {
409
- ...ssrOpts,
410
- trpc: {
411
- ...ssrOpts?.trpc,
412
- ...shouldAbortOnUnmount ? {
413
- signal: queryFunctionContext.signal
414
- } : {}
415
- }
416
- };
417
- const actualInput = {
418
- ...input ?? {},
419
- cursor: queryFunctionContext.pageParam
420
- };
421
- // FIXME as any shouldn't be needed as client should be untyped too
422
- return client.query(...getClientArgs([
423
- path,
424
- actualInput
425
- ], actualOpts));
426
- }, {
427
- context: ReactQueryContext,
428
- ...ssrOpts
436
+ const hook = useInfiniteQuery({
437
+ ...ssrOpts,
438
+ queryKey: getArrayQueryKey(pathAndInput, 'infinite'),
439
+ queryFn: (queryFunctionContext)=>{
440
+ const actualOpts = {
441
+ ...ssrOpts,
442
+ trpc: {
443
+ ...ssrOpts?.trpc,
444
+ ...shouldAbortOnUnmount ? {
445
+ signal: queryFunctionContext.signal
446
+ } : {}
447
+ }
448
+ };
449
+ const actualInput = {
450
+ ...input ?? {},
451
+ cursor: queryFunctionContext.pageParam
452
+ };
453
+ // FIXME as any shouldn't be needed as client should be untyped too
454
+ return client.query(...getClientArgs([
455
+ path,
456
+ actualInput
457
+ ], actualOpts));
458
+ },
459
+ context: ReactQueryContext
429
460
  });
430
461
  hook.trpc = useHookResult({
431
462
  path
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var client = require('@trpc/client');
6
6
  var shared = require('@trpc/server/shared');
7
7
  var React = require('react');
8
- var createHooksInternal = require('./createHooksInternal-d8e5577b.js');
8
+ var createHooksInternal = require('./createHooksInternal-57a3cf21.js');
9
9
  require('@tanstack/react-query');
10
10
  require('./getArrayQueryKey-4bdb5cc2.js');
11
11
 
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  export * from '@trpc/client';
2
2
  import { createFlatProxy } from '@trpc/server/shared';
3
3
  import { useMemo } from 'react';
4
- import { c as createHooksInternal, a as createReactQueryUtilsProxy, b as createReactProxyDecoration } from './createHooksInternal-9c1f8ad9.mjs';
4
+ import { c as createHooksInternal, a as createReactQueryUtilsProxy, b as createReactProxyDecoration } from './createHooksInternal-b83f2ee6.mjs';
5
5
  import '@tanstack/react-query';
6
6
  import './getArrayQueryKey-86134f8b.mjs';
7
7
 
@@ -1 +1 @@
1
- {"version":3,"file":"createHooksInternal.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/createHooksInternal.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,mBAAmB,EAAoB,MAAM,cAAc,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAI3D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,sBAAsB,EAAuB,MAAM,UAAU,CAAC;AACvE,OAAO,EACL,YAAY,EACZ,YAAY,EAEZ,kBAAkB,EAClB,2BAA2B,EAC3B,0BAA0B,EAC1B,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,SAAS,SAAS,EACzB,WAAW,GAAG,OAAO,EACrB,MAAM,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC;;;;6BAiNxB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC;;wBA+C1C,MAAM,GAAG,CAAC,MAAM,CAAC;oCAsCT;QAEZ,IAAI,EAAE,MAAM;QACZ,GAAG,IAAI,EAAE,OAAO,EAAE;KACnB;;qCA4Ca;QAEZ,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC;KAC5B;EAoHJ;AAED;;;GAGG;AACH,cAAc,kCAAkC,CAAC"}
1
+ {"version":3,"file":"createHooksInternal.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/createHooksInternal.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,mBAAmB,EAAoB,MAAM,cAAc,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAI3D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,sBAAsB,EAAuB,MAAM,UAAU,CAAC;AACvE,OAAO,EACL,YAAY,EACZ,YAAY,EAEZ,kBAAkB,EAClB,2BAA2B,EAC3B,0BAA0B,EAC1B,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,SAAS,SAAS,EACzB,WAAW,GAAG,OAAO,EACrB,MAAM,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC;;;;6BAwNxB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC;;wBAiD1C,MAAM,GAAG,CAAC,MAAM,CAAC;oCAoCT;QAEZ,IAAI,EAAE,MAAM;QACZ,GAAG,IAAI,EAAE,OAAO,EAAE;KACnB;;qCA4Ca;QAEZ,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC;KAC5B;EAqHJ;AAED;;;GAGG;AACH,cAAc,kCAAkC,CAAC"}
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var createHooksInternal = require('../createHooksInternal-d8e5577b.js');
5
+ var createHooksInternal = require('../createHooksInternal-57a3cf21.js');
6
6
  var queryClient = require('../queryClient-358a9a75.js');
7
7
  require('@trpc/server/shared');
8
8
  require('../getArrayQueryKey-4bdb5cc2.js');
@@ -1,4 +1,4 @@
1
- export { T as TRPCContext, f as contextProps, c as createHooksInternal, b as createReactProxyDecoration, a as createReactQueryUtilsProxy, e as createRootHooks, d as createUseQueriesProxy, g as getClientArgs } from '../createHooksInternal-9c1f8ad9.mjs';
1
+ export { T as TRPCContext, f as contextProps, c as createHooksInternal, b as createReactProxyDecoration, a as createReactQueryUtilsProxy, e as createRootHooks, d as createUseQueriesProxy, g as getClientArgs } from '../createHooksInternal-b83f2ee6.mjs';
2
2
  export { g as getQueryClient } from '../queryClient-4d766c0c.mjs';
3
3
  import '@trpc/server/shared';
4
4
  import '../getArrayQueryKey-86134f8b.mjs';
package/dist/ssg/index.js CHANGED
@@ -18,47 +18,59 @@ var queryClient = require('../queryClient-358a9a75.js');
18
18
  const queryClient$1 = queryClient.getQueryClient(opts);
19
19
  const serialize = transformer ? ('input' in transformer ? transformer.input : transformer).serialize : (obj)=>obj;
20
20
  const prefetchQuery = async (...pathAndInput)=>{
21
- return queryClient$1.prefetchQuery(getArrayQueryKey.getArrayQueryKey(pathAndInput, 'query'), ()=>{
22
- return server.callProcedure({
23
- procedures: router._def.procedures,
24
- path: pathAndInput[0],
25
- rawInput: pathAndInput[1],
26
- ctx,
27
- type: 'query'
28
- });
21
+ return queryClient$1.prefetchQuery({
22
+ queryKey: getArrayQueryKey.getArrayQueryKey(pathAndInput, 'query'),
23
+ queryFn: ()=>{
24
+ return server.callProcedure({
25
+ procedures: router._def.procedures,
26
+ path: pathAndInput[0],
27
+ rawInput: pathAndInput[1],
28
+ ctx,
29
+ type: 'query'
30
+ });
31
+ }
29
32
  });
30
33
  };
31
34
  const prefetchInfiniteQuery = async (...pathAndInput)=>{
32
- return queryClient$1.prefetchInfiniteQuery(getArrayQueryKey.getArrayQueryKey(pathAndInput, 'infinite'), ()=>{
33
- return server.callProcedure({
34
- procedures: router._def.procedures,
35
- path: pathAndInput[0],
36
- rawInput: pathAndInput[1],
37
- ctx,
38
- type: 'query'
39
- });
35
+ return queryClient$1.prefetchInfiniteQuery({
36
+ queryKey: getArrayQueryKey.getArrayQueryKey(pathAndInput, 'infinite'),
37
+ queryFn: ()=>{
38
+ return server.callProcedure({
39
+ procedures: router._def.procedures,
40
+ path: pathAndInput[0],
41
+ rawInput: pathAndInput[1],
42
+ ctx,
43
+ type: 'query'
44
+ });
45
+ }
40
46
  });
41
47
  };
42
48
  const fetchQuery = async (...pathAndInput)=>{
43
- return queryClient$1.fetchQuery(getArrayQueryKey.getArrayQueryKey(pathAndInput, 'query'), ()=>{
44
- return server.callProcedure({
45
- procedures: router._def.procedures,
46
- path: pathAndInput[0],
47
- rawInput: pathAndInput[1],
48
- ctx,
49
- type: 'query'
50
- });
49
+ return queryClient$1.fetchQuery({
50
+ queryKey: getArrayQueryKey.getArrayQueryKey(pathAndInput, 'query'),
51
+ queryFn: ()=>{
52
+ return server.callProcedure({
53
+ procedures: router._def.procedures,
54
+ path: pathAndInput[0],
55
+ rawInput: pathAndInput[1],
56
+ ctx,
57
+ type: 'query'
58
+ });
59
+ }
51
60
  });
52
61
  };
53
62
  const fetchInfiniteQuery = async (...pathAndInput)=>{
54
- return queryClient$1.fetchInfiniteQuery(getArrayQueryKey.getArrayQueryKey(pathAndInput, 'infinite'), ()=>{
55
- return server.callProcedure({
56
- procedures: router._def.procedures,
57
- path: pathAndInput[0],
58
- rawInput: pathAndInput[1],
59
- ctx,
60
- type: 'query'
61
- });
63
+ return queryClient$1.fetchInfiniteQuery({
64
+ queryKey: getArrayQueryKey.getArrayQueryKey(pathAndInput, 'infinite'),
65
+ queryFn: ()=>{
66
+ return server.callProcedure({
67
+ procedures: router._def.procedures,
68
+ path: pathAndInput[0],
69
+ rawInput: pathAndInput[1],
70
+ ctx,
71
+ type: 'query'
72
+ });
73
+ }
62
74
  });
63
75
  };
64
76
  function _dehydrate(opts = {
@@ -14,47 +14,59 @@ import { g as getQueryClient } from '../queryClient-4d766c0c.mjs';
14
14
  const queryClient = getQueryClient(opts);
15
15
  const serialize = transformer ? ('input' in transformer ? transformer.input : transformer).serialize : (obj)=>obj;
16
16
  const prefetchQuery = async (...pathAndInput)=>{
17
- return queryClient.prefetchQuery(getArrayQueryKey(pathAndInput, 'query'), ()=>{
18
- return callProcedure({
19
- procedures: router._def.procedures,
20
- path: pathAndInput[0],
21
- rawInput: pathAndInput[1],
22
- ctx,
23
- type: 'query'
24
- });
17
+ return queryClient.prefetchQuery({
18
+ queryKey: getArrayQueryKey(pathAndInput, 'query'),
19
+ queryFn: ()=>{
20
+ return callProcedure({
21
+ procedures: router._def.procedures,
22
+ path: pathAndInput[0],
23
+ rawInput: pathAndInput[1],
24
+ ctx,
25
+ type: 'query'
26
+ });
27
+ }
25
28
  });
26
29
  };
27
30
  const prefetchInfiniteQuery = async (...pathAndInput)=>{
28
- return queryClient.prefetchInfiniteQuery(getArrayQueryKey(pathAndInput, 'infinite'), ()=>{
29
- return callProcedure({
30
- procedures: router._def.procedures,
31
- path: pathAndInput[0],
32
- rawInput: pathAndInput[1],
33
- ctx,
34
- type: 'query'
35
- });
31
+ return queryClient.prefetchInfiniteQuery({
32
+ queryKey: getArrayQueryKey(pathAndInput, 'infinite'),
33
+ queryFn: ()=>{
34
+ return callProcedure({
35
+ procedures: router._def.procedures,
36
+ path: pathAndInput[0],
37
+ rawInput: pathAndInput[1],
38
+ ctx,
39
+ type: 'query'
40
+ });
41
+ }
36
42
  });
37
43
  };
38
44
  const fetchQuery = async (...pathAndInput)=>{
39
- return queryClient.fetchQuery(getArrayQueryKey(pathAndInput, 'query'), ()=>{
40
- return callProcedure({
41
- procedures: router._def.procedures,
42
- path: pathAndInput[0],
43
- rawInput: pathAndInput[1],
44
- ctx,
45
- type: 'query'
46
- });
45
+ return queryClient.fetchQuery({
46
+ queryKey: getArrayQueryKey(pathAndInput, 'query'),
47
+ queryFn: ()=>{
48
+ return callProcedure({
49
+ procedures: router._def.procedures,
50
+ path: pathAndInput[0],
51
+ rawInput: pathAndInput[1],
52
+ ctx,
53
+ type: 'query'
54
+ });
55
+ }
47
56
  });
48
57
  };
49
58
  const fetchInfiniteQuery = async (...pathAndInput)=>{
50
- return queryClient.fetchInfiniteQuery(getArrayQueryKey(pathAndInput, 'infinite'), ()=>{
51
- return callProcedure({
52
- procedures: router._def.procedures,
53
- path: pathAndInput[0],
54
- rawInput: pathAndInput[1],
55
- ctx,
56
- type: 'query'
57
- });
59
+ return queryClient.fetchInfiniteQuery({
60
+ queryKey: getArrayQueryKey(pathAndInput, 'infinite'),
61
+ queryFn: ()=>{
62
+ return callProcedure({
63
+ procedures: router._def.procedures,
64
+ path: pathAndInput[0],
65
+ rawInput: pathAndInput[1],
66
+ ctx,
67
+ type: 'query'
68
+ });
69
+ }
58
70
  });
59
71
  };
60
72
  function _dehydrate(opts = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/react-query",
3
- "version": "10.8.1",
3
+ "version": "10.8.2",
4
4
  "description": "tRPC React lib",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -55,15 +55,15 @@
55
55
  },
56
56
  "peerDependencies": {
57
57
  "@tanstack/react-query": "^4.3.8",
58
- "@trpc/client": "10.8.1",
59
- "@trpc/server": "10.8.1",
58
+ "@trpc/client": "10.8.2",
59
+ "@trpc/server": "10.8.2",
60
60
  "react": ">=16.8.0",
61
61
  "react-dom": ">=16.8.0"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@tanstack/react-query": "^4.3.8",
65
- "@trpc/client": "10.8.1",
66
- "@trpc/server": "10.8.1",
65
+ "@trpc/client": "10.8.2",
66
+ "@trpc/server": "10.8.2",
67
67
  "@types/express": "^4.17.12",
68
68
  "@types/node": "^18.7.20",
69
69
  "eslint": "^8.30.0",
@@ -78,5 +78,5 @@
78
78
  "publishConfig": {
79
79
  "access": "public"
80
80
  },
81
- "gitHead": "2a130c7cac7557ee740a687bade81a3f5747cf56"
81
+ "gitHead": "2be6d09a08fc3a32b86286271ab8b4881b6bc98b"
82
82
  }
@@ -78,96 +78,103 @@ export function createRootHooks<
78
78
  ssrState,
79
79
  fetchQuery: useCallback(
80
80
  (pathAndInput, opts) => {
81
- return queryClient.fetchQuery(
82
- getArrayQueryKey(pathAndInput, 'query'),
83
- () =>
81
+ return queryClient.fetchQuery({
82
+ ...opts,
83
+ queryKey: getArrayQueryKey(pathAndInput, 'query'),
84
+ queryFn: () =>
84
85
  (client as any).query(...getClientArgs(pathAndInput, opts)),
85
- opts,
86
- );
86
+ });
87
87
  },
88
88
  [client, queryClient],
89
89
  ),
90
90
  fetchInfiniteQuery: useCallback(
91
91
  (pathAndInput, opts) => {
92
- return queryClient.fetchInfiniteQuery(
93
- getArrayQueryKey(pathAndInput, 'infinite'),
94
- ({ pageParam }) => {
92
+ return queryClient.fetchInfiniteQuery({
93
+ ...opts,
94
+ queryKey: getArrayQueryKey(pathAndInput, 'infinite'),
95
+ queryFn: ({ pageParam }) => {
95
96
  const [path, input] = pathAndInput;
96
- const actualInput = { ...(input as any), cursor: pageParam };
97
+ const actualInput = { ...input, cursor: pageParam };
97
98
  return (client as any).query(
98
99
  ...getClientArgs([path, actualInput], opts),
99
100
  );
100
101
  },
101
- opts,
102
- );
102
+ });
103
103
  },
104
104
  [client, queryClient],
105
105
  ),
106
106
  prefetchQuery: useCallback(
107
107
  (pathAndInput, opts) => {
108
- return queryClient.prefetchQuery(
109
- getArrayQueryKey(pathAndInput, 'query'),
110
- () =>
108
+ return queryClient.prefetchQuery({
109
+ ...opts,
110
+ queryKey: getArrayQueryKey(pathAndInput, 'query'),
111
+ queryFn: () =>
111
112
  (client as any).query(...getClientArgs(pathAndInput, opts)),
112
- opts,
113
- );
113
+ });
114
114
  },
115
115
  [client, queryClient],
116
116
  ),
117
117
  prefetchInfiniteQuery: useCallback(
118
118
  (pathAndInput, opts) => {
119
- return queryClient.prefetchInfiniteQuery(
120
- getArrayQueryKey(pathAndInput, 'infinite'),
121
- ({ pageParam }) => {
119
+ return queryClient.prefetchInfiniteQuery({
120
+ ...opts,
121
+ queryKey: getArrayQueryKey(pathAndInput, 'infinite'),
122
+ queryFn: ({ pageParam }) => {
122
123
  const [path, input] = pathAndInput;
123
- const actualInput = { ...(input as any), cursor: pageParam };
124
+ const actualInput = { ...input, cursor: pageParam };
124
125
  return (client as any).query(
125
126
  ...getClientArgs([path, actualInput], opts),
126
127
  );
127
128
  },
128
- opts,
129
- );
129
+ });
130
130
  },
131
131
  [client, queryClient],
132
132
  ),
133
133
  invalidateQueries: useCallback(
134
- (...args: any[]) => {
135
- const [queryKey, ...rest] = args;
136
-
134
+ (queryKey, filters, options) => {
137
135
  return queryClient.invalidateQueries(
138
- getArrayQueryKey(queryKey, 'any'),
139
- ...rest,
136
+ {
137
+ ...filters,
138
+ queryKey: getArrayQueryKey(queryKey as any, 'any'),
139
+ },
140
+ options,
140
141
  );
141
142
  },
142
143
  [queryClient],
143
144
  ),
144
145
  resetQueries: useCallback(
145
146
  (...args: any[]) => {
146
- const [queryKey, ...rest] = args;
147
+ const [queryKey, filters, options] = args;
147
148
 
148
149
  return queryClient.resetQueries(
149
- getArrayQueryKey(queryKey, 'any'),
150
- ...rest,
150
+ {
151
+ ...filters,
152
+ queryKey: getArrayQueryKey(queryKey, 'any'),
153
+ },
154
+ options,
151
155
  );
152
156
  },
153
157
  [queryClient],
154
158
  ),
155
159
  refetchQueries: useCallback(
156
160
  (...args: any[]) => {
157
- const [queryKey, ...rest] = args;
161
+ const [queryKey, filters, options] = args;
158
162
 
159
163
  return queryClient.refetchQueries(
160
- getArrayQueryKey(queryKey, 'any'),
161
- ...rest,
164
+ {
165
+ ...filters,
166
+ queryKey: getArrayQueryKey(queryKey, 'any'),
167
+ },
168
+ options,
162
169
  );
163
170
  },
164
171
  [queryClient],
165
172
  ),
166
173
  cancelQuery: useCallback(
167
174
  (pathAndInput) => {
168
- return queryClient.cancelQueries(
169
- getArrayQueryKey(pathAndInput, 'any'),
170
- );
175
+ return queryClient.cancelQueries({
176
+ queryKey: getArrayQueryKey(pathAndInput, 'any'),
177
+ });
171
178
  },
172
179
  [queryClient],
173
180
  ),
@@ -269,9 +276,10 @@ export function createRootHooks<
269
276
  // request option should take priority over global
270
277
  const shouldAbortOnUnmount = opts?.trpc?.abortOnUnmount ?? abortOnUnmount;
271
278
 
272
- const hook = __useQuery(
273
- getArrayQueryKey(pathAndInput, 'query') as any,
274
- (queryFunctionContext) => {
279
+ const hook = __useQuery({
280
+ ...ssrOpts,
281
+ queryKey: getArrayQueryKey(pathAndInput, 'query') as any,
282
+ queryFn: (queryFunctionContext) => {
275
283
  const actualOpts = {
276
284
  ...ssrOpts,
277
285
  trpc: {
@@ -286,8 +294,9 @@ export function createRootHooks<
286
294
  ...getClientArgs(pathAndInput, actualOpts),
287
295
  );
288
296
  },
289
- { context: ReactQueryContext, ...ssrOpts },
290
- ) as UseTRPCQueryResult<unknown, TError>;
297
+ context: ReactQueryContext,
298
+ }) as UseTRPCQueryResult<unknown, TError>;
299
+
291
300
  hook.trpc = useHookResult({
292
301
  path: pathAndInput[0],
293
302
  });
@@ -303,28 +312,26 @@ export function createRootHooks<
303
312
  const { client } = useContext();
304
313
  const queryClient = useQueryClient({ context: ReactQueryContext });
305
314
 
306
- const hook = __useMutation(
307
- (input) => {
315
+ const hook = __useMutation({
316
+ ...opts,
317
+ mutationFn: (input) => {
308
318
  const actualPath = Array.isArray(path) ? path[0] : path;
309
319
 
310
320
  return (client.mutation as any)(
311
321
  ...getClientArgs([actualPath, input], opts),
312
322
  );
313
323
  },
314
- {
315
- context: ReactQueryContext,
316
- ...opts,
317
- onSuccess(...args) {
318
- const originalFn = () => opts?.onSuccess?.(...args);
319
-
320
- return mutationSuccessOverride({
321
- originalFn,
322
- queryClient,
323
- meta: opts?.meta ?? {},
324
- });
325
- },
324
+ context: ReactQueryContext,
325
+ onSuccess(...args) {
326
+ const originalFn = () => opts?.onSuccess?.(...args);
327
+
328
+ return mutationSuccessOverride({
329
+ originalFn,
330
+ queryClient,
331
+ meta: opts?.meta ?? {},
332
+ });
326
333
  },
327
- ) as UseTRPCMutationResult<unknown, TError, unknown, unknown>;
334
+ }) as UseTRPCMutationResult<unknown, TError, unknown, unknown>;
328
335
 
329
336
  hook.trpc = useHookResult({
330
337
  path: Array.isArray(path) ? path[0] : path,
@@ -416,9 +423,10 @@ export function createRootHooks<
416
423
  // request option should take priority over global
417
424
  const shouldAbortOnUnmount = opts?.trpc?.abortOnUnmount ?? abortOnUnmount;
418
425
 
419
- const hook = __useInfiniteQuery(
420
- getArrayQueryKey(pathAndInput, 'infinite') as any,
421
- (queryFunctionContext) => {
426
+ const hook = __useInfiniteQuery({
427
+ ...ssrOpts,
428
+ queryKey: getArrayQueryKey(pathAndInput, 'infinite') as any,
429
+ queryFn: (queryFunctionContext) => {
422
430
  const actualOpts = {
423
431
  ...ssrOpts,
424
432
  trpc: {
@@ -439,8 +447,8 @@ export function createRootHooks<
439
447
  ...getClientArgs([path, actualInput], actualOpts),
440
448
  );
441
449
  },
442
- { context: ReactQueryContext, ...ssrOpts },
443
- ) as UseTRPCInfiniteQueryResult<unknown, TError>;
450
+ context: ReactQueryContext,
451
+ }) as UseTRPCInfiniteQueryResult<unknown, TError>;
444
452
 
445
453
  hook.trpc = useHookResult({
446
454
  path,
@@ -75,7 +75,7 @@ export function createUseQueriesProxy<TRouter extends AnyRouter>(
75
75
  queryFn: () => {
76
76
  return client.query(path, input);
77
77
  },
78
- ...(rest[1] as any),
78
+ ...(rest[0] as any),
79
79
  };
80
80
 
81
81
  return options;
package/src/ssg/ssg.ts CHANGED
@@ -44,9 +44,9 @@ export function createSSGHelpers<TRouter extends AnyRouter>(
44
44
  >(
45
45
  ...pathAndInput: [path: TPath, ...args: inferHandlerInput<TProcedure>]
46
46
  ) => {
47
- return queryClient.prefetchQuery(
48
- getArrayQueryKey(pathAndInput, 'query'),
49
- () => {
47
+ return queryClient.prefetchQuery({
48
+ queryKey: getArrayQueryKey(pathAndInput, 'query'),
49
+ queryFn: () => {
50
50
  return callProcedure({
51
51
  procedures: router._def.procedures,
52
52
  path: pathAndInput[0],
@@ -55,7 +55,7 @@ export function createSSGHelpers<TRouter extends AnyRouter>(
55
55
  type: 'query',
56
56
  });
57
57
  },
58
- );
58
+ });
59
59
  };
60
60
 
61
61
  const prefetchInfiniteQuery = async <
@@ -64,9 +64,9 @@ export function createSSGHelpers<TRouter extends AnyRouter>(
64
64
  >(
65
65
  ...pathAndInput: [path: TPath, ...args: inferHandlerInput<TProcedure>]
66
66
  ) => {
67
- return queryClient.prefetchInfiniteQuery(
68
- getArrayQueryKey(pathAndInput, 'infinite'),
69
- () => {
67
+ return queryClient.prefetchInfiniteQuery({
68
+ queryKey: getArrayQueryKey(pathAndInput, 'infinite'),
69
+ queryFn: () => {
70
70
  return callProcedure({
71
71
  procedures: router._def.procedures,
72
72
  path: pathAndInput[0],
@@ -75,7 +75,7 @@ export function createSSGHelpers<TRouter extends AnyRouter>(
75
75
  type: 'query',
76
76
  });
77
77
  },
78
- );
78
+ });
79
79
  };
80
80
 
81
81
  const fetchQuery = async <
@@ -85,9 +85,9 @@ export function createSSGHelpers<TRouter extends AnyRouter>(
85
85
  >(
86
86
  ...pathAndInput: [path: TPath, ...args: inferHandlerInput<TProcedure>]
87
87
  ): Promise<TOutput> => {
88
- return queryClient.fetchQuery(
89
- getArrayQueryKey(pathAndInput, 'query'),
90
- () => {
88
+ return queryClient.fetchQuery({
89
+ queryKey: getArrayQueryKey(pathAndInput, 'query'),
90
+ queryFn: () => {
91
91
  return callProcedure({
92
92
  procedures: router._def.procedures,
93
93
  path: pathAndInput[0],
@@ -96,7 +96,7 @@ export function createSSGHelpers<TRouter extends AnyRouter>(
96
96
  type: 'query',
97
97
  });
98
98
  },
99
- );
99
+ });
100
100
  };
101
101
 
102
102
  const fetchInfiniteQuery = async <
@@ -106,9 +106,9 @@ export function createSSGHelpers<TRouter extends AnyRouter>(
106
106
  >(
107
107
  ...pathAndInput: [path: TPath, ...args: inferHandlerInput<TProcedure>]
108
108
  ): Promise<InfiniteData<TOutput>> => {
109
- return queryClient.fetchInfiniteQuery(
110
- getArrayQueryKey(pathAndInput, 'infinite'),
111
- () => {
109
+ return queryClient.fetchInfiniteQuery({
110
+ queryKey: getArrayQueryKey(pathAndInput, 'infinite'),
111
+ queryFn: () => {
112
112
  return callProcedure({
113
113
  procedures: router._def.procedures,
114
114
  path: pathAndInput[0],
@@ -117,7 +117,7 @@ export function createSSGHelpers<TRouter extends AnyRouter>(
117
117
  type: 'query',
118
118
  });
119
119
  },
120
- );
120
+ });
121
121
  };
122
122
 
123
123
  function _dehydrate(