|
1 | 1 | /* eslint-disable ts/no-unsafe-argument */
|
2 | 2 | /* eslint-disable ts/no-unsafe-assignment */
|
3 | 3 |
|
| 4 | +import type { |
| 5 | + InfiniteQueryPageParamsOptions, |
| 6 | + QueryClient, |
| 7 | + QueryFunction, |
| 8 | + SkipToken, |
| 9 | +} from '@tanstack/vue-query' |
| 10 | +import type { CreateTRPCClientOptions, TRPCUntypedClient } from '@trpc/client' |
| 11 | +import type { AnyTRPCRouter } from '@trpc/server' |
| 12 | +import type { MaybeRefOrGetter } from '@vueuse/core' |
| 13 | +import type { UnionToIntersection } from 'type-fest' |
| 14 | +import type { DecoratedProcedureRecord, DecorateProcedure } from './types' |
4 | 15 | import {
|
5 |
| - type InfiniteQueryPageParamsOptions, |
6 |
| - type QueryClient, |
7 |
| - type QueryFunction, |
8 |
| - type SkipToken, |
9 | 16 | queryOptions as defineQueryOptions,
|
10 | 17 | skipToken,
|
11 | 18 | useInfiniteQuery,
|
12 | 19 | useMutation,
|
13 | 20 | useQueries,
|
14 | 21 | useQuery,
|
15 | 22 | } from '@tanstack/vue-query'
|
16 |
| -import { |
17 |
| - type CreateTRPCClientOptions, |
18 |
| - type TRPCUntypedClient, |
19 |
| - createTRPCUntypedClient, |
20 |
| -} from '@trpc/client' |
| 23 | +import { createTRPCUntypedClient } from '@trpc/client' |
| 24 | + |
21 | 25 | import { createTRPCFlatProxy } from '@trpc/server'
|
22 | 26 | import { createRecursiveProxy } from '@trpc/server/unstable-core-do-not-import'
|
23 |
| -import { toRef, toRefs, toValue } from '@vueuse/core' |
24 |
| -import { computed, isReactive, onScopeDispose, shallowRef, watch } from 'vue' |
25 |
| - |
26 |
| -import type { DecorateProcedure, DecoratedProcedureRecord } from './types' |
27 |
| -import type { AnyTRPCRouter } from '@trpc/server' |
28 |
| -import type { MaybeRefOrGetter } from '@vueuse/core' |
29 |
| -import type { UnionToIntersection } from 'type-fest' |
| 27 | +import { toRef, toRefs } from '@vueuse/core' |
| 28 | +import { computed, isReactive, onScopeDispose, shallowRef, toValue, watch } from 'vue' |
30 | 29 |
|
31 | 30 | type QueryType = 'query' | 'queries' | 'infinite'
|
32 | 31 | export type TRPCQueryKey = [readonly string[], { input?: unknown; type?: QueryType }?]
|
@@ -223,7 +222,7 @@ export function createTRPCVueQueryClient<TRouter extends AnyTRPCRouter>({
|
223 | 222 | const decoratedClient = createTRPCFlatProxy<
|
224 | 223 | DecoratedProcedureRecord<TRouter['_def']['record'], TRouter>
|
225 | 224 | >((key) => {
|
226 |
| - return createVueQueryProxyDecoration(key, client, queryClient) |
| 225 | + return createVueQueryProxyDecoration(key.toString(), client, queryClient) |
227 | 226 | })
|
228 | 227 |
|
229 | 228 | return decoratedClient
|
|
0 commit comments