@orpc/react-query 1.3.0 → 1.4.1

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 CHANGED
@@ -63,7 +63,7 @@ You can find the full documentation [here](https://orpc.unnoq.com).
63
63
 
64
64
  ## `@orpc/react-query`
65
65
 
66
- Integration with [React Query](https://tanstack.com/query/latest/docs/framework/react/overview). Read the [documentation](https://orpc.unnoq.com/docs/tanstack-query/react) for more information.
66
+ Integration with [React Query](https://tanstack.com/query/latest/docs/framework/react/overview). Read the [documentation](https://orpc.unnoq.com/docs/integrations/tanstack-query-old/react) for more information.
67
67
 
68
68
  ```ts
69
69
  export function Example() {
package/dist/index.d.mts CHANGED
@@ -1,13 +1,8 @@
1
1
  import { ClientContext, Client, NestedClient } from '@orpc/client';
2
+ import { OperationType, OperationKeyOptions } from '@orpc/tanstack-query';
3
+ export { OperationKeyOptions as BuildKeyOptions, OperationType as KeyType, generateOperationKey as buildKey } from '@orpc/tanstack-query';
2
4
  import { QueryKey, SkipToken, UseQueryOptions, QueryFunctionContext, experimental_streamedQuery, UseInfiniteQueryOptions, UseMutationOptions, InfiniteData } from '@tanstack/react-query';
3
- import { PartialDeep, SetOptional, MaybeOptionalOptions } from '@orpc/shared';
4
-
5
- type KeyType = 'query' | 'streamed' | 'infinite' | 'mutation' | undefined;
6
- interface BuildKeyOptions<TType extends KeyType, TInput> {
7
- type?: TType;
8
- input?: TType extends 'mutation' ? never : PartialDeep<TInput>;
9
- }
10
- declare function buildKey<TType extends KeyType, TInput>(path: string[], options?: BuildKeyOptions<TType, TInput>): QueryKey;
5
+ import { SetOptional, MaybeOptionalOptions } from '@orpc/shared';
11
6
 
12
7
  /**
13
8
  * Utils at any level (procedure or router)
@@ -16,9 +11,9 @@ interface GeneralUtils<TInput> {
16
11
  /**
17
12
  * Generate a query/mutation key for checking status, invalidate, set, get, etc.
18
13
  *
19
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#query-mutation-key Tanstack Query/Mutation Key Docs}
14
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-mutation-key Tanstack Query/Mutation Key Docs}
20
15
  */
21
- key<UType extends KeyType = undefined>(options?: BuildKeyOptions<UType, TInput>): QueryKey;
16
+ key<UType extends OperationType>(options?: OperationKeyOptions<UType, TInput>): QueryKey;
22
17
  }
23
18
  declare function createGeneralUtils<TInput>(path: string[]): GeneralUtils<TInput>;
24
19
 
@@ -35,11 +30,14 @@ interface QueryOptionsBase<TOutput, TError> {
35
30
  queryKey: QueryKey;
36
31
  queryFn(ctx: QueryFunctionContext): Promise<TOutput>;
37
32
  throwOnError?(error: TError): boolean;
33
+ retryDelay?: (count: number, error: TError) => number;
38
34
  enabled: boolean;
39
35
  }
40
36
  type experimental_StreamedQueryOptions = Omit<Parameters<typeof experimental_streamedQuery>[0], 'queryFn'>;
41
37
  type experimental_InferStreamedOutput<TOutput> = TOutput extends AsyncIterable<infer U> ? U[] : never;
42
- type experimental_StreamedOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData> = QueryOptionsIn<TClientContext, TInput, TOutput, TError, TSelectData> & experimental_StreamedQueryOptions;
38
+ type experimental_StreamedOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData> = QueryOptionsIn<TClientContext, TInput, TOutput, TError, TSelectData> & {
39
+ queryFnOptions?: experimental_StreamedQueryOptions;
40
+ };
43
41
  interface experimental_StreamedOptionsBase<TOutput, TError> extends QueryOptionsBase<TOutput, TError> {
44
42
  }
45
43
  type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData, TPageParam> = {
@@ -48,11 +46,12 @@ type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TE
48
46
  context?: TClientContext;
49
47
  } : {
50
48
  context: TClientContext;
51
- }) & SetOptional<UseInfiniteQueryOptions<TOutput, TError, TSelectData, TOutput, QueryKey, TPageParam>, 'queryKey'>;
49
+ }) & SetOptional<UseInfiniteQueryOptions<TOutput, TError, TSelectData, QueryKey, TPageParam>, 'queryKey'>;
52
50
  interface InfiniteOptionsBase<TOutput, TError, TPageParam> {
53
51
  queryKey: QueryKey;
54
52
  queryFn(ctx: QueryFunctionContext<QueryKey, TPageParam>): Promise<TOutput>;
55
53
  throwOnError?(error: TError): boolean;
54
+ retryDelay?: (count: number, error: TError) => number;
56
55
  enabled: boolean;
57
56
  }
58
57
  type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TMutationContext> = (Record<never, never> extends TClientContext ? {
@@ -66,32 +65,32 @@ interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput,
66
65
  /**
67
66
  * Calling corresponding procedure client
68
67
  *
69
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#calling-procedure-clients Tanstack Calling Procedure Client Docs}
68
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#calling-procedure-clients Tanstack Calling Procedure Client Docs}
70
69
  */
71
70
  call: Client<TClientContext, TInput, TOutput, TError>;
72
71
  /**
73
72
  * Generate options used for useQuery/useSuspenseQuery/prefetchQuery/...
74
73
  *
75
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#query-options-utility Tanstack Query Options Utility Docs}
74
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-options-utility Tanstack Query Options Utility Docs}
76
75
  */
77
76
  queryOptions<U, USelectData = TOutput>(...rest: MaybeOptionalOptions<U & QueryOptionsIn<TClientContext, TInput, TOutput, TError, USelectData>>): NoInfer<U & Omit<QueryOptionsBase<TOutput, TError>, keyof U>>;
78
77
  /**
79
78
  * Generate [Event Iterator](https://orpc.unnoq.com/docs/event-iterator) options used for useQuery/useSuspenseQuery/prefetchQuery/...
80
79
  * Built on top of [steamedQuery](https://tanstack.com/query/latest/docs/reference/streamedQuery)
81
80
  *
82
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#streamed-query-options-utility Tanstack Streamed Query Options Utility Docs}
81
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#streamed-query-options-utility Tanstack Streamed Query Options Utility Docs}
83
82
  */
84
83
  experimental_streamedOptions<U, USelectData = experimental_InferStreamedOutput<TOutput>>(...rest: MaybeOptionalOptions<U & experimental_StreamedOptionsIn<TClientContext, TInput, experimental_InferStreamedOutput<TOutput>, TError, USelectData>>): NoInfer<U & Omit<experimental_StreamedOptionsBase<experimental_InferStreamedOutput<TOutput>, TError>, keyof U>>;
85
84
  /**
86
85
  * Generate options used for useInfiniteQuery/useSuspenseInfiniteQuery/prefetchInfiniteQuery/...
87
86
  *
88
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#infinite-query-options-utility Tanstack Infinite Query Options Utility Docs}
87
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#infinite-query-options-utility Tanstack Infinite Query Options Utility Docs}
89
88
  */
90
89
  infiniteOptions<U, UPageParam, USelectData = InfiniteData<TOutput, UPageParam>>(options: U & InfiniteOptionsIn<TClientContext, TInput, TOutput, TError, USelectData, UPageParam>): NoInfer<U & Omit<InfiniteOptionsBase<TOutput, TError, UPageParam>, keyof U>>;
91
90
  /**
92
91
  * Generate options used for useMutation/...
93
92
  *
94
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#mutation-options Tanstack Mutation Options Docs}
93
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#mutation-options Tanstack Mutation Options Docs}
95
94
  */
96
95
  mutationOptions<UMutationContext>(...rest: MaybeOptionalOptions<MutationOptionsIn<TClientContext, TInput, TOutput, TError, UMutationContext>>): MutationOptions<TInput, TOutput, TError, UMutationContext>;
97
96
  }
@@ -110,9 +109,9 @@ interface CreateRouterUtilsOptions {
110
109
  * Create a router utils from a client.
111
110
  *
112
111
  * @info Both client-side and server-side clients are supported.
113
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/react Tanstack Query React Docs}
112
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/react Tanstack Query React Docs}
114
113
  */
115
114
  declare function createRouterUtils<T extends NestedClient<any>>(client: T, options?: CreateRouterUtilsOptions): RouterUtils<T>;
116
115
 
117
- export { buildKey, createGeneralUtils, createRouterUtils as createORPCReactQueryUtils, createProcedureUtils, createRouterUtils };
118
- export type { BuildKeyOptions, CreateProcedureUtilsOptions, CreateRouterUtilsOptions, GeneralUtils, InfiniteOptionsBase, InfiniteOptionsIn, KeyType, MutationOptions, MutationOptionsIn, ProcedureUtils, QueryOptionsBase, QueryOptionsIn, RouterUtils, experimental_InferStreamedOutput, experimental_StreamedOptionsBase, experimental_StreamedOptionsIn };
116
+ export { createGeneralUtils, createRouterUtils as createORPCReactQueryUtils, createProcedureUtils, createRouterUtils };
117
+ export type { CreateProcedureUtilsOptions, CreateRouterUtilsOptions, GeneralUtils, InfiniteOptionsBase, InfiniteOptionsIn, MutationOptions, MutationOptionsIn, ProcedureUtils, QueryOptionsBase, QueryOptionsIn, RouterUtils, experimental_InferStreamedOutput, experimental_StreamedOptionsBase, experimental_StreamedOptionsIn };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,8 @@
1
1
  import { ClientContext, Client, NestedClient } from '@orpc/client';
2
+ import { OperationType, OperationKeyOptions } from '@orpc/tanstack-query';
3
+ export { OperationKeyOptions as BuildKeyOptions, OperationType as KeyType, generateOperationKey as buildKey } from '@orpc/tanstack-query';
2
4
  import { QueryKey, SkipToken, UseQueryOptions, QueryFunctionContext, experimental_streamedQuery, UseInfiniteQueryOptions, UseMutationOptions, InfiniteData } from '@tanstack/react-query';
3
- import { PartialDeep, SetOptional, MaybeOptionalOptions } from '@orpc/shared';
4
-
5
- type KeyType = 'query' | 'streamed' | 'infinite' | 'mutation' | undefined;
6
- interface BuildKeyOptions<TType extends KeyType, TInput> {
7
- type?: TType;
8
- input?: TType extends 'mutation' ? never : PartialDeep<TInput>;
9
- }
10
- declare function buildKey<TType extends KeyType, TInput>(path: string[], options?: BuildKeyOptions<TType, TInput>): QueryKey;
5
+ import { SetOptional, MaybeOptionalOptions } from '@orpc/shared';
11
6
 
12
7
  /**
13
8
  * Utils at any level (procedure or router)
@@ -16,9 +11,9 @@ interface GeneralUtils<TInput> {
16
11
  /**
17
12
  * Generate a query/mutation key for checking status, invalidate, set, get, etc.
18
13
  *
19
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#query-mutation-key Tanstack Query/Mutation Key Docs}
14
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-mutation-key Tanstack Query/Mutation Key Docs}
20
15
  */
21
- key<UType extends KeyType = undefined>(options?: BuildKeyOptions<UType, TInput>): QueryKey;
16
+ key<UType extends OperationType>(options?: OperationKeyOptions<UType, TInput>): QueryKey;
22
17
  }
23
18
  declare function createGeneralUtils<TInput>(path: string[]): GeneralUtils<TInput>;
24
19
 
@@ -35,11 +30,14 @@ interface QueryOptionsBase<TOutput, TError> {
35
30
  queryKey: QueryKey;
36
31
  queryFn(ctx: QueryFunctionContext): Promise<TOutput>;
37
32
  throwOnError?(error: TError): boolean;
33
+ retryDelay?: (count: number, error: TError) => number;
38
34
  enabled: boolean;
39
35
  }
40
36
  type experimental_StreamedQueryOptions = Omit<Parameters<typeof experimental_streamedQuery>[0], 'queryFn'>;
41
37
  type experimental_InferStreamedOutput<TOutput> = TOutput extends AsyncIterable<infer U> ? U[] : never;
42
- type experimental_StreamedOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData> = QueryOptionsIn<TClientContext, TInput, TOutput, TError, TSelectData> & experimental_StreamedQueryOptions;
38
+ type experimental_StreamedOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData> = QueryOptionsIn<TClientContext, TInput, TOutput, TError, TSelectData> & {
39
+ queryFnOptions?: experimental_StreamedQueryOptions;
40
+ };
43
41
  interface experimental_StreamedOptionsBase<TOutput, TError> extends QueryOptionsBase<TOutput, TError> {
44
42
  }
45
43
  type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData, TPageParam> = {
@@ -48,11 +46,12 @@ type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TE
48
46
  context?: TClientContext;
49
47
  } : {
50
48
  context: TClientContext;
51
- }) & SetOptional<UseInfiniteQueryOptions<TOutput, TError, TSelectData, TOutput, QueryKey, TPageParam>, 'queryKey'>;
49
+ }) & SetOptional<UseInfiniteQueryOptions<TOutput, TError, TSelectData, QueryKey, TPageParam>, 'queryKey'>;
52
50
  interface InfiniteOptionsBase<TOutput, TError, TPageParam> {
53
51
  queryKey: QueryKey;
54
52
  queryFn(ctx: QueryFunctionContext<QueryKey, TPageParam>): Promise<TOutput>;
55
53
  throwOnError?(error: TError): boolean;
54
+ retryDelay?: (count: number, error: TError) => number;
56
55
  enabled: boolean;
57
56
  }
58
57
  type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TMutationContext> = (Record<never, never> extends TClientContext ? {
@@ -66,32 +65,32 @@ interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput,
66
65
  /**
67
66
  * Calling corresponding procedure client
68
67
  *
69
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#calling-procedure-clients Tanstack Calling Procedure Client Docs}
68
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#calling-procedure-clients Tanstack Calling Procedure Client Docs}
70
69
  */
71
70
  call: Client<TClientContext, TInput, TOutput, TError>;
72
71
  /**
73
72
  * Generate options used for useQuery/useSuspenseQuery/prefetchQuery/...
74
73
  *
75
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#query-options-utility Tanstack Query Options Utility Docs}
74
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-options-utility Tanstack Query Options Utility Docs}
76
75
  */
77
76
  queryOptions<U, USelectData = TOutput>(...rest: MaybeOptionalOptions<U & QueryOptionsIn<TClientContext, TInput, TOutput, TError, USelectData>>): NoInfer<U & Omit<QueryOptionsBase<TOutput, TError>, keyof U>>;
78
77
  /**
79
78
  * Generate [Event Iterator](https://orpc.unnoq.com/docs/event-iterator) options used for useQuery/useSuspenseQuery/prefetchQuery/...
80
79
  * Built on top of [steamedQuery](https://tanstack.com/query/latest/docs/reference/streamedQuery)
81
80
  *
82
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#streamed-query-options-utility Tanstack Streamed Query Options Utility Docs}
81
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#streamed-query-options-utility Tanstack Streamed Query Options Utility Docs}
83
82
  */
84
83
  experimental_streamedOptions<U, USelectData = experimental_InferStreamedOutput<TOutput>>(...rest: MaybeOptionalOptions<U & experimental_StreamedOptionsIn<TClientContext, TInput, experimental_InferStreamedOutput<TOutput>, TError, USelectData>>): NoInfer<U & Omit<experimental_StreamedOptionsBase<experimental_InferStreamedOutput<TOutput>, TError>, keyof U>>;
85
84
  /**
86
85
  * Generate options used for useInfiniteQuery/useSuspenseInfiniteQuery/prefetchInfiniteQuery/...
87
86
  *
88
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#infinite-query-options-utility Tanstack Infinite Query Options Utility Docs}
87
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#infinite-query-options-utility Tanstack Infinite Query Options Utility Docs}
89
88
  */
90
89
  infiniteOptions<U, UPageParam, USelectData = InfiniteData<TOutput, UPageParam>>(options: U & InfiniteOptionsIn<TClientContext, TInput, TOutput, TError, USelectData, UPageParam>): NoInfer<U & Omit<InfiniteOptionsBase<TOutput, TError, UPageParam>, keyof U>>;
91
90
  /**
92
91
  * Generate options used for useMutation/...
93
92
  *
94
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#mutation-options Tanstack Mutation Options Docs}
93
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#mutation-options Tanstack Mutation Options Docs}
95
94
  */
96
95
  mutationOptions<UMutationContext>(...rest: MaybeOptionalOptions<MutationOptionsIn<TClientContext, TInput, TOutput, TError, UMutationContext>>): MutationOptions<TInput, TOutput, TError, UMutationContext>;
97
96
  }
@@ -110,9 +109,9 @@ interface CreateRouterUtilsOptions {
110
109
  * Create a router utils from a client.
111
110
  *
112
111
  * @info Both client-side and server-side clients are supported.
113
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/react Tanstack Query React Docs}
112
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/react Tanstack Query React Docs}
114
113
  */
115
114
  declare function createRouterUtils<T extends NestedClient<any>>(client: T, options?: CreateRouterUtilsOptions): RouterUtils<T>;
116
115
 
117
- export { buildKey, createGeneralUtils, createRouterUtils as createORPCReactQueryUtils, createProcedureUtils, createRouterUtils };
118
- export type { BuildKeyOptions, CreateProcedureUtilsOptions, CreateRouterUtilsOptions, GeneralUtils, InfiniteOptionsBase, InfiniteOptionsIn, KeyType, MutationOptions, MutationOptionsIn, ProcedureUtils, QueryOptionsBase, QueryOptionsIn, RouterUtils, experimental_InferStreamedOutput, experimental_StreamedOptionsBase, experimental_StreamedOptionsIn };
116
+ export { createGeneralUtils, createRouterUtils as createORPCReactQueryUtils, createProcedureUtils, createRouterUtils };
117
+ export type { CreateProcedureUtilsOptions, CreateRouterUtilsOptions, GeneralUtils, InfiniteOptionsBase, InfiniteOptionsIn, MutationOptions, MutationOptionsIn, ProcedureUtils, QueryOptionsBase, QueryOptionsIn, RouterUtils, experimental_InferStreamedOutput, experimental_StreamedOptionsBase, experimental_StreamedOptionsIn };
package/dist/index.mjs CHANGED
@@ -1,19 +1,12 @@
1
+ import { generateOperationKey } from '@orpc/tanstack-query';
2
+ export { generateOperationKey as buildKey } from '@orpc/tanstack-query';
1
3
  import { isAsyncIteratorObject } from '@orpc/shared';
2
4
  import { skipToken, experimental_streamedQuery } from '@tanstack/react-query';
3
5
 
4
- function buildKey(path, options = {}) {
5
- const withInput = options.input !== void 0 ? { input: options?.input } : {};
6
- const withType = options.type !== void 0 ? { type: options?.type } : {};
7
- return [path, {
8
- ...withInput,
9
- ...withType
10
- }];
11
- }
12
-
13
6
  function createGeneralUtils(path) {
14
7
  return {
15
8
  key(options) {
16
- return buildKey(path, options);
9
+ return generateOperationKey(path, options);
17
10
  }
18
11
  };
19
12
  }
@@ -23,7 +16,7 @@ function createProcedureUtils(client, options) {
23
16
  call: client,
24
17
  queryOptions(...[optionsIn = {}]) {
25
18
  return {
26
- queryKey: buildKey(options.path, { type: "query", input: optionsIn.input }),
19
+ queryKey: generateOperationKey(options.path, { type: "query", input: optionsIn.input }),
27
20
  queryFn: ({ signal }) => {
28
21
  if (optionsIn.input === skipToken) {
29
22
  throw new Error("queryFn should not be called with skipToken used as input");
@@ -37,9 +30,8 @@ function createProcedureUtils(client, options) {
37
30
  experimental_streamedOptions(...[optionsIn = {}]) {
38
31
  return {
39
32
  enabled: optionsIn.input !== skipToken,
40
- queryKey: buildKey(options.path, { type: "streamed", input: optionsIn.input }),
33
+ queryKey: generateOperationKey(options.path, { type: "streamed", input: optionsIn.input, fnOptions: optionsIn.queryFnOptions }),
41
34
  queryFn: experimental_streamedQuery({
42
- ...optionsIn,
43
35
  queryFn: async ({ signal }) => {
44
36
  if (optionsIn.input === skipToken) {
45
37
  throw new Error("queryFn should not be called with skipToken used as input");
@@ -49,14 +41,15 @@ function createProcedureUtils(client, options) {
49
41
  throw new Error("streamedQuery requires an event iterator output");
50
42
  }
51
43
  return output;
52
- }
44
+ },
45
+ ...optionsIn.queryFnOptions
53
46
  }),
54
47
  ...optionsIn
55
48
  };
56
49
  },
57
50
  infiniteOptions(optionsIn) {
58
51
  return {
59
- queryKey: buildKey(options.path, {
52
+ queryKey: generateOperationKey(options.path, {
60
53
  type: "infinite",
61
54
  input: optionsIn.input === skipToken ? skipToken : optionsIn.input(optionsIn.initialPageParam)
62
55
  }),
@@ -72,7 +65,7 @@ function createProcedureUtils(client, options) {
72
65
  },
73
66
  mutationOptions(...[optionsIn = {}]) {
74
67
  return {
75
- mutationKey: buildKey(options.path, { type: "mutation" }),
68
+ mutationKey: generateOperationKey(options.path, { type: "mutation" }),
76
69
  mutationFn: (input) => client(input, { context: optionsIn.context }),
77
70
  ...optionsIn
78
71
  };
@@ -107,4 +100,4 @@ function createRouterUtils(client, options = {}) {
107
100
  return recursive;
108
101
  }
109
102
 
110
- export { buildKey, createGeneralUtils, createRouterUtils as createORPCReactQueryUtils, createProcedureUtils, createRouterUtils };
103
+ export { createGeneralUtils, createRouterUtils as createORPCReactQueryUtils, createProcedureUtils, createRouterUtils };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/react-query",
3
3
  "type": "module",
4
- "version": "1.3.0",
4
+ "version": "1.4.1",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -27,17 +27,18 @@
27
27
  "dist"
28
28
  ],
29
29
  "peerDependencies": {
30
- "@tanstack/react-query": ">=5.55.0",
30
+ "@tanstack/react-query": ">=5.80.2",
31
31
  "react": ">=18.3.0",
32
- "@orpc/client": "1.3.0"
32
+ "@orpc/client": "1.4.1"
33
33
  },
34
34
  "dependencies": {
35
- "@orpc/shared": "1.3.0"
35
+ "@orpc/shared": "1.4.1",
36
+ "@orpc/tanstack-query": "1.4.1"
36
37
  },
37
38
  "devDependencies": {
38
- "@tanstack/react-query": "^5.72.3",
39
+ "@tanstack/react-query": "^5.80.2",
39
40
  "react": "^19.1.0",
40
- "zod": "^3.25.11"
41
+ "zod": "^3.25.49"
41
42
  },
42
43
  "scripts": {
43
44
  "build": "unbuild",