Skip to content

Commit

Permalink
chore(trpc): 🎨 add RouterInput and RouterOutput types for typing proc…
Browse files Browse the repository at this point in the history
…edure inputs/outputs
  • Loading branch information
mikib0 committed Sep 11, 2024
1 parent 07013c9 commit aed6ebd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/app/trpc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createTRPCProxyClient, httpBatchLink } from '@trpc/client';
import type { inferRouterInputs, inferRouterOutputs } from '@trpc/server';
import type { AppRouter } from 'server/src/routes/trpcRouter';
import { api } from './constants/api';
import { createTRPCReact } from '@trpc/react-query';
Expand Down Expand Up @@ -63,3 +64,7 @@ export const vanillaTrpcClient = createTRPCProxyClient<AppRouter>({
}); // For calling procedures imperatively (outside of a component)

export const queryClient = new QueryClient();

export type RouterInput = inferRouterInputs<AppRouter>;
export type RouterOutput = inferRouterOutputs<AppRouter>;

0 comments on commit aed6ebd

Please sign in to comment.