@trpc/react-query 10.0.0-proxy-beta.21 → 10.0.0-proxy-beta.23

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/dist/index.js CHANGED
@@ -39,8 +39,8 @@ function createTRPCReact(opts) {
39
39
  // interop:
40
40
  /**
41
41
  * @deprecated use `createTRPCReact` instead
42
- */ function createReactQueryHooks() {
43
- const trpc = createHooksInternal.createHooksInternal();
42
+ */ function createReactQueryHooks(opts) {
43
+ const trpc = createHooksInternal.createHooksInternal(opts);
44
44
  const proxy = createHooksInternalProxy(trpc);
45
45
  return {
46
46
  ...trpc,
package/dist/index.mjs CHANGED
@@ -35,8 +35,8 @@ function createTRPCReact(opts) {
35
35
  // interop:
36
36
  /**
37
37
  * @deprecated use `createTRPCReact` instead
38
- */ function createReactQueryHooks() {
39
- const trpc = createHooksInternal();
38
+ */ function createReactQueryHooks(opts) {
39
+ const trpc = createHooksInternal(opts);
40
40
  const proxy = createHooksInternalProxy(trpc);
41
41
  return {
42
42
  ...trpc,
@@ -43,11 +43,11 @@ export declare const contextProps: (keyof ProxyTRPCContextProps<any, any>)[];
43
43
  /** @internal */
44
44
  export interface TRPCContextState<TRouter extends AnyRouter, TSSRContext = undefined> extends Required<TRPCContextProps<TRouter, TSSRContext>> {
45
45
  /**
46
- * @link https://react-query.tanstack.com/guides/prefetching
46
+ * @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientfetchquery
47
47
  */
48
48
  fetchQuery<TPath extends keyof TRouter['_def']['queries'] & string, TProcedure extends TRouter['_def']['queries'][TPath], TOutput extends inferProcedureOutput<TProcedure>, TInput extends inferProcedureInput<TProcedure>>(pathAndInput: [path: TPath, ...args: inferHandlerInput<TProcedure>], opts?: TRPCFetchQueryOptions<TInput, TRPCClientError<TRouter>, TOutput>): Promise<TOutput>;
49
49
  /**
50
- * @link https://react-query.tanstack.com/guides/prefetching
50
+ * @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientfetchinfinitequery
51
51
  */
52
52
  fetchInfiniteQuery<TPath extends keyof TRouter['_def']['queries'] & string, TProcedure extends TRouter['_def']['queries'][TPath], TOutput extends inferProcedureOutput<TProcedure>, TInput extends inferProcedureInput<TProcedure>>(pathAndInput: [path: TPath, ...args: inferHandlerInput<TProcedure>], opts?: TRPCFetchInfiniteQueryOptions<TInput, TRPCClientError<TRouter>, TOutput>): Promise<InfiniteData<TOutput>>;
53
53
  /**
@@ -55,7 +55,7 @@ export interface TRPCContextState<TRouter extends AnyRouter, TSSRContext = undef
55
55
  */
56
56
  prefetchQuery<TPath extends keyof TRouter['_def']['queries'] & string, TProcedure extends TRouter['_def']['queries'][TPath], TOutput extends inferProcedureOutput<TProcedure>, TInput extends inferProcedureInput<TProcedure>>(pathAndInput: [path: TPath, ...args: inferHandlerInput<TProcedure>], opts?: TRPCFetchQueryOptions<TInput, TRPCClientError<TRouter>, TOutput>): Promise<void>;
57
57
  /**
58
- * @link https://react-query.tanstack.com/guides/prefetching
58
+ * @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientprefetchinfinitequery
59
59
  */
60
60
  prefetchInfiniteQuery<TPath extends keyof TRouter['_def']['queries'] & string, TProcedure extends TRouter['_def']['queries'][TPath], TOutput extends inferProcedureOutput<TProcedure>, TInput extends inferProcedureInput<TProcedure>>(pathAndInput: [path: TPath, ...args: inferHandlerInput<TProcedure>], opts?: TRPCFetchInfiniteQueryOptions<TInput, TRPCClientError<TRouter>, TOutput>): Promise<void>;
61
61
  /**
@@ -87,7 +87,7 @@ export interface TRPCContextState<TRouter extends AnyRouter, TSSRContext = undef
87
87
  */
88
88
  getQueryData<TPath extends keyof TRouter['_def']['queries'] & string, TInput extends inferProcedureInput<TRouter['_def']['queries'][TPath]>, TOutput extends inferProcedureOutput<TRouter['_def']['queries'][TPath]>>(pathAndInput: [TPath, TInput?]): TOutput | undefined;
89
89
  /**
90
- * @link https://react-query.tanstack.com/reference/QueryClient#queryclientgetquerydata
90
+ * @link https://react-query.tanstack.com/reference/QueryClient#queryclientsetquerydata
91
91
  */
92
92
  setInfiniteQueryData<TPath extends keyof TRouter['_def']['queries'] & string, TInput extends inferProcedureInput<TRouter['_def']['queries'][TPath]>, TOutput extends inferProcedureOutput<TRouter['_def']['queries'][TPath]>>(pathAndInput: [TPath, TInput?], updater: Updater<InfiniteData<TOutput> | undefined, InfiniteData<TOutput> | undefined>, options?: SetDataOptions): void;
93
93
  /**
package/dist/interop.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import { AnyRouter } from '@trpc/server';
2
2
  import { CreateTRPCReact } from './createTRPCReact';
3
+ import { CreateTRPCReactOptions } from './shared';
3
4
  import { CreateReactQueryHooks } from './shared/hooks/createHooksInternal';
4
5
  /**
5
6
  * @deprecated use `createTRPCReact` instead
6
7
  */
7
- export declare function createReactQueryHooks<TRouter extends AnyRouter, TSSRContext = unknown>(): CreateReactQueryHooks<TRouter, TSSRContext> & {
8
+ export declare function createReactQueryHooks<TRouter extends AnyRouter, TSSRContext = unknown>(opts?: CreateTRPCReactOptions<TRouter>): CreateReactQueryHooks<TRouter, TSSRContext> & {
8
9
  proxy: CreateTRPCReact<TRouter, TSSRContext>;
9
10
  };
10
11
  //# sourceMappingURL=interop.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interop.d.ts","sourceRoot":"","sources":["../src/interop.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAA4B,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EACL,qBAAqB,EAEtB,MAAM,oCAAoC,CAAC;AAE5C;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,SAAS,SAAS,EACzB,WAAW,GAAG,OAAO,KAClB,qBAAqB,CAAC,OAAO,EAAE,WAAW,CAAC,GAAG;IACjD,KAAK,EAAE,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;CAC9C,CAQA"}
1
+ {"version":3,"file":"interop.d.ts","sourceRoot":"","sources":["../src/interop.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAA4B,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EACL,qBAAqB,EAEtB,MAAM,oCAAoC,CAAC;AAE5C;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,SAAS,SAAS,EACzB,WAAW,GAAG,OAAO,EAErB,IAAI,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC,GACrC,qBAAqB,CAAC,OAAO,EAAE,WAAW,CAAC,GAAG;IAC/C,KAAK,EAAE,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;CAC9C,CAQA"}
@@ -1,6 +1,7 @@
1
1
  export * from './proxy/decorationProxy';
2
2
  export * from './proxy/utilsProxy';
3
- export type { DecorateProcedure, DecoratedProcedureRecord, } from '../createTRPCReact';
3
+ export type { DecoratedProcedureRecord, DecorateProcedure, } from '../createTRPCReact';
4
4
  export * from './hooks/createHooksInternal';
5
5
  export * from './queryClient';
6
+ export * from './types';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/react-query/src/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,YAAY,EACV,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/react-query/src/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,YAAY,EACV,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/react-query",
3
- "version": "10.0.0-proxy-beta.21",
3
+ "version": "10.0.0-proxy-beta.23",
4
4
  "description": "tRPC React lib",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -51,15 +51,15 @@
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@tanstack/react-query": "^4.3.8",
54
- "@trpc/client": "10.0.0-proxy-beta.21",
55
- "@trpc/server": "10.0.0-proxy-beta.21",
54
+ "@trpc/client": "10.0.0-proxy-beta.23",
55
+ "@trpc/server": "10.0.0-proxy-beta.23",
56
56
  "react": ">=16.8.0",
57
57
  "react-dom": ">=16.8.0"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@tanstack/react-query": "^4.3.8",
61
- "@trpc/client": "10.0.0-proxy-beta.21",
62
- "@trpc/server": "10.0.0-proxy-beta.21",
61
+ "@trpc/client": "10.0.0-proxy-beta.23",
62
+ "@trpc/server": "10.0.0-proxy-beta.23",
63
63
  "@types/express": "^4.17.12",
64
64
  "@types/node": "^18.7.20",
65
65
  "express": "^4.17.1",
@@ -71,5 +71,5 @@
71
71
  "publishConfig": {
72
72
  "access": "public"
73
73
  },
74
- "gitHead": "fe59220aff5619507f2cf1a7bd9fd6a6489cc364"
74
+ "gitHead": "db5bcc057408128808369eb138347428f89fa6ef"
75
75
  }
@@ -78,7 +78,7 @@ export interface TRPCContextState<
78
78
  TSSRContext = undefined,
79
79
  > extends Required<TRPCContextProps<TRouter, TSSRContext>> {
80
80
  /**
81
- * @link https://react-query.tanstack.com/guides/prefetching
81
+ * @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientfetchquery
82
82
  */
83
83
  fetchQuery<
84
84
  TPath extends keyof TRouter['_def']['queries'] & string,
@@ -90,7 +90,7 @@ export interface TRPCContextState<
90
90
  opts?: TRPCFetchQueryOptions<TInput, TRPCClientError<TRouter>, TOutput>,
91
91
  ): Promise<TOutput>;
92
92
  /**
93
- * @link https://react-query.tanstack.com/guides/prefetching
93
+ * @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientfetchinfinitequery
94
94
  */
95
95
  fetchInfiniteQuery<
96
96
  TPath extends keyof TRouter['_def']['queries'] & string,
@@ -119,7 +119,7 @@ export interface TRPCContextState<
119
119
  ): Promise<void>;
120
120
 
121
121
  /**
122
- * @link https://react-query.tanstack.com/guides/prefetching
122
+ * @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientprefetchinfinitequery
123
123
  */
124
124
  prefetchInfiniteQuery<
125
125
  TPath extends keyof TRouter['_def']['queries'] & string,
@@ -206,7 +206,7 @@ export interface TRPCContextState<
206
206
  pathAndInput: [TPath, TInput?],
207
207
  ): TOutput | undefined;
208
208
  /**
209
- * @link https://react-query.tanstack.com/reference/QueryClient#queryclientgetquerydata
209
+ * @link https://react-query.tanstack.com/reference/QueryClient#queryclientsetquerydata
210
210
  */
211
211
  setInfiniteQueryData<
212
212
  TPath extends keyof TRouter['_def']['queries'] & string,
package/src/interop.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  // interop:
2
2
  import { AnyRouter } from '@trpc/server';
3
3
  import { CreateTRPCReact, createHooksInternalProxy } from './createTRPCReact';
4
+ import { CreateTRPCReactOptions } from './shared';
4
5
  import {
5
6
  CreateReactQueryHooks,
6
7
  createHooksInternal,
@@ -12,10 +13,12 @@ import {
12
13
  export function createReactQueryHooks<
13
14
  TRouter extends AnyRouter,
14
15
  TSSRContext = unknown,
15
- >(): CreateReactQueryHooks<TRouter, TSSRContext> & {
16
+ >(
17
+ opts?: CreateTRPCReactOptions<TRouter>,
18
+ ): CreateReactQueryHooks<TRouter, TSSRContext> & {
16
19
  proxy: CreateTRPCReact<TRouter, TSSRContext>;
17
20
  } {
18
- const trpc = createHooksInternal<TRouter, TSSRContext>();
21
+ const trpc = createHooksInternal<TRouter, TSSRContext>(opts);
19
22
  const proxy = createHooksInternalProxy<TRouter, TSSRContext>(trpc);
20
23
 
21
24
  return {
@@ -1,8 +1,9 @@
1
1
  export * from './proxy/decorationProxy';
2
2
  export * from './proxy/utilsProxy';
3
3
  export type {
4
- DecorateProcedure,
5
4
  DecoratedProcedureRecord,
5
+ DecorateProcedure,
6
6
  } from '../createTRPCReact';
7
7
  export * from './hooks/createHooksInternal';
8
8
  export * from './queryClient';
9
+ export * from './types';