i want to do something like trpc does on the router.query and router.mutation methods.
i have a method called createProcedure that accepts an object with 2 props:
- one is a validation
schema - other is a
resolver, that receives an object with the output of the validated schema (the property name isinput)
and returns a function that accepts an object with the same signature as the resolver.
i want the resolver to hint the input property only if a schema is provided.
i want the returned function to allow an input property only if the procedure has a defined schema.
here is a ts playground with my attempt on getting it done, and also pointing the issues that i had.
edit 1: here is a ts playground link with an attempt using union types