createTRPCEndpointcreateTRPCEndpoint, the returned procedure loses the type definition of inputinput.createTRPCEndpointcreateTRPCEndpoint has no utility, but we use it to dynamically create middleware that are configured by the options we pass in. It would be important to be able to enrich the procedure ctxctx type with the middleware. If we didn't, we could override and cast the return type of createTRPCEndpointcreateTRPCEndpoint as TT, and then the type safety of inputinput is preserved, but then we can't enrich ctxctx. Join the Discord to continue the conversation