import { initTRPC } from '@trpc/server';
import { z } from 'zod';
const t = initTRPC.create();
const publicProcedure = t.procedure;
const appRouter = t.router({
users: t.router({
getUserById: publicProcedure
.input(z.object({ userId: z.string() }))
.output(
z.object({
name: z.string(),
email: z.string(),
password: z.string(),
}),
)
.query(async () => 'PLACEHOLDER' as any),
}),
});
export type AppRouter = typeof appRouter;
import { initTRPC } from '@trpc/server';
import { z } from 'zod';
const t = initTRPC.create();
const publicProcedure = t.procedure;
const appRouter = t.router({
users: t.router({
getUserById: publicProcedure
.input(z.object({ userId: z.string() }))
.output(
z.object({
name: z.string(),
email: z.string(),
password: z.string(),
}),
)
.query(async () => 'PLACEHOLDER' as any),
}),
});
export type AppRouter = typeof appRouter;