Skip to content

Commit

Permalink
chore: add trpc request options type
Browse files Browse the repository at this point in the history
  • Loading branch information
wobsoriano committed Aug 12, 2024
1 parent f618cd2 commit a7f647d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/client/createTRPCNuxtClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { AsyncData, AsyncDataOptions } from 'nuxt/app'
import type { AnyRootTypes, ProcedureOptions, RouterRecord } from '@trpc/server/unstable-core-do-not-import'

import type { MaybeRefOrGetter, UnwrapRef } from 'vue'
import type { TRPCSubscriptionObserver } from '@trpc/client/dist/internals/TRPCUntypedClient'
import type { TRPCRequestOptions, TRPCSubscriptionObserver } from '@trpc/client/dist/internals/TRPCUntypedClient'
import type { Unsubscribable } from '@trpc/server/observable'
import { createNuxtProxyDecoration } from './decorationProxy'

Expand Down Expand Up @@ -86,6 +86,7 @@ export type DecoratedQuery<TDef extends ResolverDef> = {
*/
queryKey?: string
watch?: AsyncDataOptions<TQueryFnData, TData, PickKeys>['watch'] | false
trpc?: TRPCRequestOptions
}
) => AsyncData<PickFrom<TData, PickKeys> | null, TRPCClientErrorLike<TDef>>
query: Resolver<TDef>
Expand All @@ -109,6 +110,7 @@ export type DecoratedMutation<TDef extends ResolverDef> = {
* The function to call to trigger the mutation.
*/
mutate: (input: TDef['output']) => Promise<UnwrapRef<AsyncData<PickFrom<TData, PickKeys> | null, TRPCClientErrorLike<TDef>>['data']>>
trpc?: TRPCRequestOptions
}
mutate: Resolver<TDef>
}
Expand Down

0 comments on commit a7f647d

Please sign in to comment.