How to ignore `input` validation and just pass in an object with interfaces?

For my input I just want to pass in an interface rather than using a Zod schema. Either that or if somebody can let me know how to pass in an external interface as a z.object() param
Nick431d ago
Could you make a GitHub issue for this? It’s an interesting idea and one I don’t believe is possible without weird hacks for now undefined as any as ZodType<YourType> ^ this might work but I doubt it
b430d ago
Sure thing!
Unknown User
Unknown User430d ago
Message Not Public
Sign In & Join Server To View
Nick430d ago
Good idea, can turn that into a simple util too, something like: const t<T> = v => v as T It’s not particularly type-safe but tRPC could definitely offer a 1st class approach
More Posts
Where can I add a query key?I tried to follow as in useQuery from Tanstack, but Typescript started complaining ```js api.promptsasync inside link next handler possible ?Hey everyone, Today I had to do a bit of refactor, and I'm wondering something. I had to turn a syntRPC doesn't support redirectI use tRPC & @trpc/server/adapters/express. procdure.query({ctx: { res }} => { res.redirect('xxHow to get external key other than INPUT from RESTFUL request?SSO callback my api like api/trpc/user.login?token=abcCannot read properties of undefined (reading 'createTRPCReact')I'm trying to use it in an Astro project. responseIm refactoring my old backend to trpc so far it was a pleasure and fairly straight forward process ❤Discriminated union handleHow Do I handle Input type if its discriminated union?? ``` export const batchTasksRouter = createHit external APIs ...I'm new to tRPC, I need to hit an external API (OpenAI) directly from the client-side. Can I still uCannot get subscription event to fireRipping my hair out here trying to get Websockets working with tRPC and Next. Everything seems to bHow to organise reusable functionsHow do you guys organize functions that all need the same context (usually from tRPC)? For example lHow to get response type depending on the input params?Simple example of a normal JS function with generics: ``` const example = <T extends unknown>(paramshow to build tRPC and Prisma with express?I am using TSC as the official docs example does. But when I use paths in tsconfig.json, It does notHow to infer types from input?When I call my procedure from the client I send an array of strings as an input. How can I infer theHow to infer types of a queryCoinsider the example `const hello = trpc.hello.useQuery();` I would like to export the type we get Data Visualisation/Chartsis anyone using tRPC on data visualisation (say bar chart/line chart) in a scenario close to a bankitrpc + AWS Lambda (through cdk)Hi all, has anyone successfully integrated tRPC with AWS Lambda? My current stack is API Gateway + L