Access procedures with same names and same parameters, but in different routers, generically
My trpc structure looks something like this:
Basically, I have multiple routers, but they all have pretty much the same signatures - they always have mostly the same parameters, but the return types are different for some. I can't currently do anything like
trpc[router].routerX.proc1.useQuery()
, because Typescript throws an error - Each member of the union type [...] has signatures, but none of these signatures are compatible with each other.
I can kinda work around it like this:
But in the returned useQuery hook, the type of data
is unknown.0 Replies