DangerZone
Property 'error' does not exist on type 'MiddlewareOKResult<any>'.
Hello,
I am building an trpc adapter for nestjs, and I am trying to extend some of trpc's functionality, specifically the procedure middleware by creating a procedure class.
I am using the
MiddlewareFunction
here so it will provide the correct opts
implementation.
Everything works perfectly, but when I am trying to run it, I am getting a typescript error:
Anyone has an idea of how to solve this? I thought about using the ProcedureBuilder
interface but couldn't make it to work.1 replies
Validating inputs and outputs only via typescript
Hey everyone,
I am trying to create an appRouter with
ts-morph
but I am having trouble with passing the zod
schema/object instance to it (since I need to pass the original implementation, not the instance).
I was thinking about a way to work around this and was wondering if I could somehow just pass the zod typescript type in the inputs and outputs - keep in mind that my usecase only calls for the type definitions to work, not the actual implementation.
here you can see I am trying to pass on;y the RandomType
, but ofc I don't really know what I am doing 😄2 replies
How can I generate trpc Generic Types?
I am building a trpc library, and as part of my implementation, I need the generic types of
t
, t.mergeRouters
, t.procedure
, t.router
and t.middleware
.
I've haven't been able to locate those generic types in the @trpc/server
and since trpc has such a complex type structure, would love to see an implementation for a generic set of types for the ones listed about.4 replies