@orpc/solid-query 0.0.0-next.f635909 → 0.0.0-next.f677f1d

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
@@ -17,6 +17,9 @@
17
17
  <a href="https://discord.gg/TXEbwRBvQn">
18
18
  <img alt="Discord" src="https://img.shields.io/discord/1308966753044398161?color=7389D8&label&logo=discord&logoColor=ffffff" />
19
19
  </a>
20
+ <a href="https://deepwiki.com/unnoq/orpc">
21
+ <img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki">
22
+ </a>
20
23
  </div>
21
24
 
22
25
  <h3 align="center">Typesafe APIs Made Simple 🪄</h3>
@@ -30,7 +33,8 @@
30
33
  - **🔗 End-to-End Type Safety**: Ensure type-safe inputs, outputs, and errors from client to server.
31
34
  - **📘 First-Class OpenAPI**: Built-in support that fully adheres to the OpenAPI standard.
32
35
  - **📝 Contract-First Development**: Optionally define your API contract before implementation.
33
- - **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte), Pinia Colada, and more.
36
+ - **🔍 First-Class OpenTelemetry**: Seamlessly integrate with OpenTelemetry for observability.
37
+ - **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte, Angular), SWR, Pinia Colada, and more.
34
38
  - **🚀 Server Actions**: Fully compatible with React Server Actions on Next.js, TanStack Start, and other platforms.
35
39
  - **🔠 Standard Schema Support**: Works out of the box with Zod, Valibot, ArkType, and other schema validators.
36
40
  - **🗃️ Native Types**: Supports native types like Date, File, Blob, BigInt, URL, and more.
@@ -38,7 +42,6 @@
38
42
  - **📡 SSE & Streaming**: Enjoy full type-safe support for SSE and streaming.
39
43
  - **🌍 Multi-Runtime Support**: Fast and lightweight on Cloudflare, Deno, Bun, Node.js, and beyond.
40
44
  - **🔌 Extendability**: Easily extend functionality with plugins, middleware, and interceptors.
41
- - **🛡️ Reliability**: Well-tested, TypeScript-based, production-ready, and MIT licensed.
42
45
 
43
46
  ## Documentation
44
47
 
@@ -49,20 +52,21 @@ You can find the full documentation [here](https://orpc.unnoq.com).
49
52
  - [@orpc/contract](https://www.npmjs.com/package/@orpc/contract): Build your API contract.
50
53
  - [@orpc/server](https://www.npmjs.com/package/@orpc/server): Build your API or implement API contract.
51
54
  - [@orpc/client](https://www.npmjs.com/package/@orpc/client): Consume your API on the client with type-safety.
55
+ - [@orpc/openapi](https://www.npmjs.com/package/@orpc/openapi): Generate OpenAPI specs and handle OpenAPI requests.
56
+ - [@orpc/otel](https://www.npmjs.com/package/@orpc/otel): [OpenTelemetry](https://opentelemetry.io/) integration for observability.
57
+ - [@orpc/nest](https://www.npmjs.com/package/@orpc/nest): Deeply integrate oRPC with [NestJS](https://nestjs.com/).
52
58
  - [@orpc/react](https://www.npmjs.com/package/@orpc/react): Utilities for integrating oRPC with React and React Server Actions.
53
- - [@orpc/react-query](https://www.npmjs.com/package/@orpc/react-query): Integration with [React Query](https://tanstack.com/query/latest/docs/framework/react/overview).
54
- - [@orpc/vue-query](https://www.npmjs.com/package/@orpc/vue-query): Integration with [Vue Query](https://tanstack.com/query/latest/docs/framework/vue/overview).
55
- - [@orpc/solid-query](https://www.npmjs.com/package/@orpc/solid-query): Integration with [Solid Query](https://tanstack.com/query/latest/docs/framework/solid/overview).
56
- - [@orpc/svelte-query](https://www.npmjs.com/package/@orpc/svelte-query): Integration with [Svelte Query](https://tanstack.com/query/latest/docs/framework/svelte/overview).
59
+ - [@orpc/tanstack-query](https://www.npmjs.com/package/@orpc/tanstack-query): [TanStack Query](https://tanstack.com/query/latest) integration.
60
+ - [@orpc/experimental-react-swr](https://www.npmjs.com/package/@orpc/experimental-react-swr): [SWR](https://swr.vercel.app/) integration.
57
61
  - [@orpc/vue-colada](https://www.npmjs.com/package/@orpc/vue-colada): Integration with [Pinia Colada](https://pinia-colada.esm.dev/).
58
- - [@orpc/openapi](https://www.npmjs.com/package/@orpc/openapi): Generate OpenAPI specs and handle OpenAPI requests.
62
+ - [@orpc/hey-api](https://www.npmjs.com/package/@orpc/hey-api): [Hey API](https://heyapi.dev/) integration.
59
63
  - [@orpc/zod](https://www.npmjs.com/package/@orpc/zod): More schemas that [Zod](https://zod.dev/) doesn't support yet.
60
64
  - [@orpc/valibot](https://www.npmjs.com/package/@orpc/valibot): OpenAPI spec generation from [Valibot](https://valibot.dev/).
61
65
  - [@orpc/arktype](https://www.npmjs.com/package/@orpc/arktype): OpenAPI spec generation from [ArkType](https://arktype.io/).
62
66
 
63
67
  ## `@orpc/solid-query`
64
68
 
65
- Integration with [Solid Query](https://tanstack.com/query/latest/docs/framework/solid/overview). Read the [documentation](https://orpc.unnoq.com/docs/tanstack-query/solid) for more information.
69
+ Integration with [Solid Query](https://tanstack.com/query/latest/docs/framework/solid/overview). Read the [documentation](https://orpc.unnoq.com/docs/integrations/tanstack-query-old/solid) for more information.
66
70
 
67
71
  ```ts
68
72
  export function Example() {
package/dist/index.d.mts CHANGED
@@ -1,13 +1,8 @@
1
1
  import { ClientContext, Client, NestedClient } from '@orpc/client';
2
- import { QueryKey, SolidQueryOptions, QueryFunctionContext, SolidInfiniteQueryOptions, SolidMutationOptions, InfiniteData } from '@tanstack/solid-query';
3
- import { PartialDeep, SetOptional, MaybeOptionalOptions } from '@orpc/shared';
4
-
5
- type KeyType = 'query' | '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;
2
+ import { OperationType, OperationKeyOptions } from '@orpc/tanstack-query';
3
+ export { OperationKeyOptions as BuildKeyOptions, OperationType as KeyType, generateOperationKey as buildKey } from '@orpc/tanstack-query';
4
+ import { QueryKey, SkipToken, SolidQueryOptions, QueryFunctionContext, SolidInfiniteQueryOptions, SolidMutationOptions, InfiniteData } from '@tanstack/solid-query';
5
+ import { SetOptional, MaybeOptionalOptions } from '@orpc/shared';
11
6
 
12
7
  /**
13
8
  * Utils at any level (procedure or router)
@@ -16,16 +11,16 @@ 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
 
25
20
  type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData> = (undefined extends TInput ? {
26
- input?: TInput;
21
+ input?: TInput | SkipToken;
27
22
  } : {
28
- input: TInput;
23
+ input: TInput | SkipToken;
29
24
  }) & (Record<never, never> extends TClientContext ? {
30
25
  context?: TClientContext;
31
26
  } : {
@@ -34,19 +29,23 @@ type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TErro
34
29
  interface QueryOptionsBase<TOutput, TError> {
35
30
  queryKey: QueryKey;
36
31
  queryFn(ctx: QueryFunctionContext): Promise<TOutput>;
37
- retry?(failureCount: number, error: TError): boolean;
32
+ throwOnError?(error: TError): boolean;
33
+ retryDelay?: (count: number, error: TError) => number;
34
+ enabled?: boolean;
38
35
  }
39
36
  type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData, TPageParam> = {
40
- input: (pageParam: TPageParam) => TInput;
37
+ input: ((pageParam: TPageParam) => TInput) | SkipToken;
41
38
  } & (Record<never, never> extends TClientContext ? {
42
39
  context?: TClientContext;
43
40
  } : {
44
41
  context: TClientContext;
45
- }) & SetOptional<SolidInfiniteQueryOptions<TOutput, TError, TSelectData, TOutput, QueryKey, TPageParam>, 'queryKey'>;
42
+ }) & SetOptional<SolidInfiniteQueryOptions<TOutput, TError, TSelectData, QueryKey, TPageParam>, 'queryKey'>;
46
43
  interface InfiniteOptionsBase<TOutput, TError, TPageParam> {
47
44
  queryKey: QueryKey;
48
45
  queryFn(ctx: QueryFunctionContext<QueryKey, TPageParam>): Promise<TOutput>;
49
- retry?(failureCount: number, error: TError): boolean;
46
+ throwOnError?(error: TError): boolean;
47
+ retryDelay?: (count: number, error: TError) => number;
48
+ enabled?: boolean;
50
49
  }
51
50
  type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TMutationContext> = (Record<never, never> extends TClientContext ? {
52
51
  context?: TClientContext;
@@ -59,25 +58,25 @@ interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput,
59
58
  /**
60
59
  * Calling corresponding procedure client
61
60
  *
62
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#calling-procedure-clients Tanstack Calling Procedure Client Docs}
61
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#calling-procedure-clients Tanstack Calling Procedure Client Docs}
63
62
  */
64
63
  call: Client<TClientContext, TInput, TOutput, TError>;
65
64
  /**
66
65
  * Generate options used for createQuery/prefetchQuery/...
67
66
  *
68
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#query-options-utility Tanstack Query Options Utility Docs}
67
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-options-utility Tanstack Query Options Utility Docs}
69
68
  */
70
69
  queryOptions<U, USelectData = TOutput>(...rest: MaybeOptionalOptions<U & QueryOptionsIn<TClientContext, TInput, TOutput, TError, USelectData>>): NoInfer<U & Omit<QueryOptionsBase<TOutput, TError>, keyof U>>;
71
70
  /**
72
71
  * Generate options used for createInfiniteQuery/prefetchInfiniteQuery/...
73
72
  *
74
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#infinite-query-options-utility Tanstack Infinite Query Options Utility Docs}
73
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#infinite-query-options-utility Tanstack Infinite Query Options Utility Docs}
75
74
  */
76
75
  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>>;
77
76
  /**
78
77
  * Generate options used for createMutation/...
79
78
  *
80
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#mutation-options Tanstack Mutation Options Docs}
79
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#mutation-options Tanstack Mutation Options Docs}
81
80
  */
82
81
  mutationOptions<UMutationContext>(...rest: MaybeOptionalOptions<MutationOptionsIn<TClientContext, TInput, TOutput, TError, UMutationContext>>): MutationOptions<TInput, TOutput, TError, UMutationContext>;
83
82
  }
@@ -96,9 +95,9 @@ interface CreateRouterUtilsOptions {
96
95
  * Create a router utils from a client.
97
96
  *
98
97
  * @info Both client-side and server-side clients are supported.
99
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/solid Tanstack Query Solid Docs}
98
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/solid Tanstack Query Solid Docs}
100
99
  */
101
100
  declare function createRouterUtils<T extends NestedClient<any>>(client: T, options?: CreateRouterUtilsOptions): RouterUtils<T>;
102
101
 
103
- export { buildKey, createGeneralUtils, createRouterUtils as createORPCSolidQueryUtils, createProcedureUtils, createRouterUtils };
104
- export type { BuildKeyOptions, CreateProcedureUtilsOptions, CreateRouterUtilsOptions, GeneralUtils, InfiniteOptionsBase, InfiniteOptionsIn, KeyType, MutationOptions, MutationOptionsIn, ProcedureUtils, QueryOptionsBase, QueryOptionsIn, RouterUtils };
102
+ export { createGeneralUtils, createRouterUtils as createORPCSolidQueryUtils, createProcedureUtils, createRouterUtils };
103
+ export type { CreateProcedureUtilsOptions, CreateRouterUtilsOptions, GeneralUtils, InfiniteOptionsBase, InfiniteOptionsIn, MutationOptions, MutationOptionsIn, ProcedureUtils, QueryOptionsBase, QueryOptionsIn, RouterUtils };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,8 @@
1
1
  import { ClientContext, Client, NestedClient } from '@orpc/client';
2
- import { QueryKey, SolidQueryOptions, QueryFunctionContext, SolidInfiniteQueryOptions, SolidMutationOptions, InfiniteData } from '@tanstack/solid-query';
3
- import { PartialDeep, SetOptional, MaybeOptionalOptions } from '@orpc/shared';
4
-
5
- type KeyType = 'query' | '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;
2
+ import { OperationType, OperationKeyOptions } from '@orpc/tanstack-query';
3
+ export { OperationKeyOptions as BuildKeyOptions, OperationType as KeyType, generateOperationKey as buildKey } from '@orpc/tanstack-query';
4
+ import { QueryKey, SkipToken, SolidQueryOptions, QueryFunctionContext, SolidInfiniteQueryOptions, SolidMutationOptions, InfiniteData } from '@tanstack/solid-query';
5
+ import { SetOptional, MaybeOptionalOptions } from '@orpc/shared';
11
6
 
12
7
  /**
13
8
  * Utils at any level (procedure or router)
@@ -16,16 +11,16 @@ 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
 
25
20
  type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData> = (undefined extends TInput ? {
26
- input?: TInput;
21
+ input?: TInput | SkipToken;
27
22
  } : {
28
- input: TInput;
23
+ input: TInput | SkipToken;
29
24
  }) & (Record<never, never> extends TClientContext ? {
30
25
  context?: TClientContext;
31
26
  } : {
@@ -34,19 +29,23 @@ type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TErro
34
29
  interface QueryOptionsBase<TOutput, TError> {
35
30
  queryKey: QueryKey;
36
31
  queryFn(ctx: QueryFunctionContext): Promise<TOutput>;
37
- retry?(failureCount: number, error: TError): boolean;
32
+ throwOnError?(error: TError): boolean;
33
+ retryDelay?: (count: number, error: TError) => number;
34
+ enabled?: boolean;
38
35
  }
39
36
  type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData, TPageParam> = {
40
- input: (pageParam: TPageParam) => TInput;
37
+ input: ((pageParam: TPageParam) => TInput) | SkipToken;
41
38
  } & (Record<never, never> extends TClientContext ? {
42
39
  context?: TClientContext;
43
40
  } : {
44
41
  context: TClientContext;
45
- }) & SetOptional<SolidInfiniteQueryOptions<TOutput, TError, TSelectData, TOutput, QueryKey, TPageParam>, 'queryKey'>;
42
+ }) & SetOptional<SolidInfiniteQueryOptions<TOutput, TError, TSelectData, QueryKey, TPageParam>, 'queryKey'>;
46
43
  interface InfiniteOptionsBase<TOutput, TError, TPageParam> {
47
44
  queryKey: QueryKey;
48
45
  queryFn(ctx: QueryFunctionContext<QueryKey, TPageParam>): Promise<TOutput>;
49
- retry?(failureCount: number, error: TError): boolean;
46
+ throwOnError?(error: TError): boolean;
47
+ retryDelay?: (count: number, error: TError) => number;
48
+ enabled?: boolean;
50
49
  }
51
50
  type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TMutationContext> = (Record<never, never> extends TClientContext ? {
52
51
  context?: TClientContext;
@@ -59,25 +58,25 @@ interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput,
59
58
  /**
60
59
  * Calling corresponding procedure client
61
60
  *
62
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#calling-procedure-clients Tanstack Calling Procedure Client Docs}
61
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#calling-procedure-clients Tanstack Calling Procedure Client Docs}
63
62
  */
64
63
  call: Client<TClientContext, TInput, TOutput, TError>;
65
64
  /**
66
65
  * Generate options used for createQuery/prefetchQuery/...
67
66
  *
68
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#query-options-utility Tanstack Query Options Utility Docs}
67
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-options-utility Tanstack Query Options Utility Docs}
69
68
  */
70
69
  queryOptions<U, USelectData = TOutput>(...rest: MaybeOptionalOptions<U & QueryOptionsIn<TClientContext, TInput, TOutput, TError, USelectData>>): NoInfer<U & Omit<QueryOptionsBase<TOutput, TError>, keyof U>>;
71
70
  /**
72
71
  * Generate options used for createInfiniteQuery/prefetchInfiniteQuery/...
73
72
  *
74
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#infinite-query-options-utility Tanstack Infinite Query Options Utility Docs}
73
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#infinite-query-options-utility Tanstack Infinite Query Options Utility Docs}
75
74
  */
76
75
  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>>;
77
76
  /**
78
77
  * Generate options used for createMutation/...
79
78
  *
80
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/basic#mutation-options Tanstack Mutation Options Docs}
79
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#mutation-options Tanstack Mutation Options Docs}
81
80
  */
82
81
  mutationOptions<UMutationContext>(...rest: MaybeOptionalOptions<MutationOptionsIn<TClientContext, TInput, TOutput, TError, UMutationContext>>): MutationOptions<TInput, TOutput, TError, UMutationContext>;
83
82
  }
@@ -96,9 +95,9 @@ interface CreateRouterUtilsOptions {
96
95
  * Create a router utils from a client.
97
96
  *
98
97
  * @info Both client-side and server-side clients are supported.
99
- * @see {@link https://orpc.unnoq.com/docs/tanstack-query/solid Tanstack Query Solid Docs}
98
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/solid Tanstack Query Solid Docs}
100
99
  */
101
100
  declare function createRouterUtils<T extends NestedClient<any>>(client: T, options?: CreateRouterUtilsOptions): RouterUtils<T>;
102
101
 
103
- export { buildKey, createGeneralUtils, createRouterUtils as createORPCSolidQueryUtils, createProcedureUtils, createRouterUtils };
104
- export type { BuildKeyOptions, CreateProcedureUtilsOptions, CreateRouterUtilsOptions, GeneralUtils, InfiniteOptionsBase, InfiniteOptionsIn, KeyType, MutationOptions, MutationOptionsIn, ProcedureUtils, QueryOptionsBase, QueryOptionsIn, RouterUtils };
102
+ export { createGeneralUtils, createRouterUtils as createORPCSolidQueryUtils, createProcedureUtils, createRouterUtils };
103
+ export type { CreateProcedureUtilsOptions, CreateRouterUtilsOptions, GeneralUtils, InfiniteOptionsBase, InfiniteOptionsIn, MutationOptions, MutationOptionsIn, ProcedureUtils, QueryOptionsBase, QueryOptionsIn, RouterUtils };
package/dist/index.mjs CHANGED
@@ -1,16 +1,11 @@
1
- function buildKey(path, options) {
2
- const withInput = options?.input !== void 0 ? { input: options?.input } : {};
3
- const withType = options?.type !== void 0 ? { type: options?.type } : {};
4
- return [path, {
5
- ...withInput,
6
- ...withType
7
- }];
8
- }
1
+ import { generateOperationKey } from '@orpc/tanstack-query';
2
+ export { generateOperationKey as buildKey } from '@orpc/tanstack-query';
3
+ import { skipToken } from '@tanstack/solid-query';
9
4
 
10
5
  function createGeneralUtils(path) {
11
6
  return {
12
7
  key(options) {
13
- return buildKey(path, options);
8
+ return generateOperationKey(path, options);
14
9
  }
15
10
  };
16
11
  }
@@ -20,23 +15,36 @@ function createProcedureUtils(client, options) {
20
15
  call: client,
21
16
  queryOptions(...[optionsIn = {}]) {
22
17
  return {
23
- queryKey: buildKey(options.path, { type: "query", input: optionsIn.input }),
24
- queryFn: ({ signal }) => client(optionsIn.input, { signal, context: optionsIn.context }),
18
+ queryKey: generateOperationKey(options.path, { type: "query", input: optionsIn.input }),
19
+ queryFn: ({ signal }) => {
20
+ if (optionsIn.input === skipToken) {
21
+ throw new Error("queryFn should not be called with skipToken used as input");
22
+ }
23
+ return client(optionsIn.input, { signal, context: optionsIn.context });
24
+ },
25
+ ...optionsIn.input === skipToken ? { enabled: false } : {},
25
26
  ...optionsIn
26
27
  };
27
28
  },
28
29
  infiniteOptions(optionsIn) {
29
30
  return {
30
- queryKey: buildKey(options.path, { type: "infinite", input: optionsIn.input(optionsIn.initialPageParam) }),
31
+ queryKey: generateOperationKey(options.path, {
32
+ type: "infinite",
33
+ input: optionsIn.input === skipToken ? skipToken : optionsIn.input(optionsIn.initialPageParam)
34
+ }),
31
35
  queryFn: ({ pageParam, signal }) => {
36
+ if (optionsIn.input === skipToken) {
37
+ throw new Error("queryFn should not be called with skipToken used as input");
38
+ }
32
39
  return client(optionsIn.input(pageParam), { signal, context: optionsIn.context });
33
40
  },
41
+ ...optionsIn.input === skipToken ? { enabled: false } : {},
34
42
  ...optionsIn
35
43
  };
36
44
  },
37
45
  mutationOptions(...[optionsIn = {}]) {
38
46
  return {
39
- mutationKey: buildKey(options.path, { type: "mutation" }),
47
+ mutationKey: generateOperationKey(options.path, { type: "mutation" }),
40
48
  mutationFn: (input) => client(input, { context: optionsIn.context }),
41
49
  ...optionsIn
42
50
  };
@@ -71,4 +79,4 @@ function createRouterUtils(client, options = {}) {
71
79
  return recursive;
72
80
  }
73
81
 
74
- export { buildKey, createGeneralUtils, createRouterUtils as createORPCSolidQueryUtils, createProcedureUtils, createRouterUtils };
82
+ export { createGeneralUtils, createRouterUtils as createORPCSolidQueryUtils, createProcedureUtils, createRouterUtils };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/solid-query",
3
3
  "type": "module",
4
- "version": "0.0.0-next.f635909",
4
+ "version": "0.0.0-next.f677f1d",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -27,16 +27,17 @@
27
27
  "dist"
28
28
  ],
29
29
  "peerDependencies": {
30
- "@tanstack/solid-query": ">=5.55.0",
30
+ "@tanstack/solid-query": ">=5.80.2",
31
31
  "solid-js": ">=1.9.0",
32
- "@orpc/client": "0.0.0-next.f635909"
32
+ "@orpc/client": "0.0.0-next.f677f1d"
33
33
  },
34
34
  "dependencies": {
35
- "@orpc/shared": "0.0.0-next.f635909"
35
+ "@orpc/shared": "0.0.0-next.f677f1d",
36
+ "@orpc/tanstack-query": "0.0.0-next.f677f1d"
36
37
  },
37
38
  "devDependencies": {
38
- "@tanstack/vue-query": "^5.72.3",
39
- "zod": "^3.24.2"
39
+ "@tanstack/solid-query": "^5.90.3",
40
+ "zod": "^4.1.11"
40
41
  },
41
42
  "scripts": {
42
43
  "build": "unbuild",