Hi,
I was wondering if it would be possible to add TypeBox to the Library Integrations section on the tRPC documentation website. The TypeBox setup is very similar to the Valibot setup where the @typeschema/*
package enables tRPC compatibility via the wrap() function.
import { initTRPC } from '@trpc/server';
import { wrap } from '@typeschema/typebox';
import { Type } from '@sinclair/typebox';
export const t = initTRPC.create();
const publicProcedure = t.procedure;
export const appRouter = t.router({
hello: publicProcedure
.input(wrap(Type.Object({ name: Type.String() })))
.output(wrap(Type.Object({ greeting: Type.String() })))
.query(({ input }) => {
return {
greeting: `hello ${input.name}`,
};
}),
});
export type AppRouter = typeof appRouter;
Cheers
S
https://trpc.io/docs/server/validators
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too