@trpc/react-query 10.38.2 → 10.38.4

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.
@@ -135,14 +135,14 @@ function createReactQueryUtilsProxy(context) {
135
135
  function createUseQueriesProxy(client) {
136
136
  return createRecursiveProxy((opts) => {
137
137
  const path = opts.path.join('.');
138
- const [input, ...rest] = opts.args;
138
+ const [input, _opts] = opts.args;
139
139
  const queryKey = getQueryKeyInternal(path, input);
140
140
  const options = {
141
141
  queryKey,
142
142
  queryFn: () => {
143
- return client.query(path, input);
143
+ return client.query(path, input, _opts?.trpc);
144
144
  },
145
- ...rest[0],
145
+ ..._opts,
146
146
  };
147
147
  return options;
148
148
  });
@@ -160,14 +160,14 @@ const TRPCContext = /*#__PURE__*/ React.createContext(null);
160
160
  */ function createUseQueriesProxy(client) {
161
161
  return shared.createRecursiveProxy((opts)=>{
162
162
  const path = opts.path.join('.');
163
- const [input, ...rest] = opts.args;
163
+ const [input, _opts] = opts.args;
164
164
  const queryKey = getQueryKeyInternal(path, input);
165
165
  const options = {
166
166
  queryKey,
167
167
  queryFn: ()=>{
168
- return client.query(path, input);
168
+ return client.query(path, input, _opts?.trpc);
169
169
  },
170
- ...rest[0]
170
+ ..._opts
171
171
  };
172
172
  return options;
173
173
  });
@@ -154,14 +154,14 @@ const TRPCContext = /*#__PURE__*/ createContext(null);
154
154
  */ function createUseQueriesProxy(client) {
155
155
  return createRecursiveProxy((opts)=>{
156
156
  const path = opts.path.join('.');
157
- const [input, ...rest] = opts.args;
157
+ const [input, _opts] = opts.args;
158
158
  const queryKey = getQueryKeyInternal(path, input);
159
159
  const options = {
160
160
  queryKey,
161
161
  queryFn: ()=>{
162
- return client.query(path, input);
162
+ return client.query(path, input, _opts?.trpc);
163
163
  },
164
- ...rest[0]
164
+ ..._opts
165
165
  };
166
166
  return options;
167
167
  });
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var client = require('@trpc/client');
6
- var createHooksInternal = require('./createHooksInternal-201f0ad5.js');
6
+ var createHooksInternal = require('./createHooksInternal-e243b95f.js');
7
7
  var shared = require('@trpc/server/shared');
8
8
  var React = require('react');
9
9
  require('@tanstack/react-query');
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from '@trpc/client';
2
- import { c as createHooksInternal, a as createReactQueryUtilsProxy, b as createReactProxyDecoration } from './createHooksInternal-7ba6fd69.mjs';
3
- export { g as getQueryKey } from './createHooksInternal-7ba6fd69.mjs';
2
+ import { c as createHooksInternal, a as createReactQueryUtilsProxy, b as createReactProxyDecoration } from './createHooksInternal-f1d4019d.mjs';
3
+ export { g as getQueryKey } from './createHooksInternal-f1d4019d.mjs';
4
4
  import { createFlatProxy } from '@trpc/server/shared';
5
5
  import { useMemo } from 'react';
6
6
  import '@tanstack/react-query';
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var createHooksInternal = require('../createHooksInternal-201f0ad5.js');
5
+ var createHooksInternal = require('../createHooksInternal-e243b95f.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, h as contextProps, c as createHooksInternal, b as createReactProxyDecoration, a as createReactQueryUtilsProxy, f as createRootHooks, e as createUseQueriesProxy, d as getClientArgs } from '../createHooksInternal-7ba6fd69.mjs';
1
+ export { T as TRPCContext, h as contextProps, c as createHooksInternal, b as createReactProxyDecoration, a as createReactQueryUtilsProxy, f as createRootHooks, e as createUseQueriesProxy, d as getClientArgs } from '../createHooksInternal-f1d4019d.mjs';
2
2
  export { g as getQueryClient } from '../queryClient-4d766c0c.mjs';
3
3
  import '@trpc/server/shared';
4
4
  import '../getArrayQueryKey-86134f8b.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"use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ACnB,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EACzB,iBAAiB,GAAG,SAAS,CAC9B,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GACjD,yBAAyB,CACvB,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAC/B,GAAG,KAAK,GAAG,IAAI,GAAG,MAAM,GAAG,CAC5B,GACD,eAAe,CACb,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAC/B,GAAG,KAAK,GAAG,IAAI,GAAG,MAAM,EAAE,CAC3B;CACN,CAAC;AAEF;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,SAAS,EAC7D,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,0CA0B5B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/react-query",
3
- "version": "10.38.2",
3
+ "version": "10.38.4",
4
4
  "description": "The tRPC React library",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -64,15 +64,15 @@
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@tanstack/react-query": "^4.18.0",
67
- "@trpc/client": "10.38.2",
68
- "@trpc/server": "10.38.2",
67
+ "@trpc/client": "10.38.4",
68
+ "@trpc/server": "10.38.4",
69
69
  "react": ">=16.8.0",
70
70
  "react-dom": ">=16.8.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@tanstack/react-query": "^4.18.0",
74
- "@trpc/client": "10.38.2",
75
- "@trpc/server": "10.38.2",
74
+ "@trpc/client": "10.38.4",
75
+ "@trpc/server": "10.38.4",
76
76
  "@types/express": "^4.17.17",
77
77
  "@types/node": "^18.16.16",
78
78
  "@types/react": "^18.2.8",
@@ -91,5 +91,5 @@
91
91
  "funding": [
92
92
  "https://trpc.io/sponsor"
93
93
  ],
94
- "gitHead": "3ae64cc8b8c73306d6b022dec9eae769b246b0fb"
94
+ "gitHead": "fe2a7fc857dfec9740cd6334bc0021f2d99b61e3"
95
95
  }
@@ -13,6 +13,7 @@ import {
13
13
  } from '@trpc/server/shared';
14
14
  import { getQueryKeyInternal } from '../../internals/getQueryKey';
15
15
  import { TrpcQueryOptionsForUseQueries } from '../../internals/useQueries';
16
+ import { TRPCReactRequestOptions } from '../hooks/types';
16
17
 
17
18
  type GetQueryOptions<TProcedure extends AnyProcedure, TPath extends string> = <
18
19
  TData = inferTransformedProcedureOutput<TProcedure>,
@@ -63,16 +64,24 @@ export function createUseQueriesProxy<TRouter extends AnyRouter>(
63
64
  ) {
64
65
  return createRecursiveProxy((opts) => {
65
66
  const path = opts.path.join('.');
66
- const [input, ...rest] = opts.args;
67
+ const [input, _opts] = opts.args as [
68
+ unknown,
69
+ (
70
+ | undefined
71
+ | {
72
+ trpc?: TRPCReactRequestOptions;
73
+ }
74
+ ),
75
+ ];
67
76
 
68
77
  const queryKey = getQueryKeyInternal(path, input);
69
78
 
70
79
  const options: QueryOptions = {
71
80
  queryKey,
72
81
  queryFn: () => {
73
- return client.query(path, input);
82
+ return client.query(path, input, _opts?.trpc);
74
83
  },
75
- ...(rest[0] as any),
84
+ ...(_opts as any),
76
85
  };
77
86
 
78
87
  return options;