test trpc

This commit is contained in:
2023-05-02 19:42:40 +02:00
parent a598c1fe94
commit c05d1a9e6e
3 changed files with 24 additions and 3 deletions

View File

@@ -1,7 +1,16 @@
import { router } from '~/server/trpc/trpc'
import { z } from 'zod'
import { publicProcedure, router } from '~/server/trpc/trpc'
export const appRouter = router({
hello: publicProcedure
.input(z.object({
name: z.string().optional(),
}))
.query(({ input }) => {
return {
greeting: `Hello ${input.name ?? 'world'}!`,
}
}),
})
export type AppRouter = typeof appRouter