ggascoigne
Types question
I'll admit that this particular example doesn't really justify the hassle of wrapping the raw trpc api, but that's because I picked a non-distracting example. That said, I am beginning to question all of this, and perhaps I'll just stop wrapping the api. I've always wrapped the various react-query apis in the past, in large part to manage query keys, and trpc already does a great job of that gotcha, and what's left just feels like boiler plate in my code.
6 replies
Types question
Yes, that might well be what I want. I was assuming that I should just reuse TRPCQueryOptions, but I might just want the input type (for the variables) and then the stock query options type from @tanstack/query. I think I was making it more complicated than it needed and trying to infer them from the resolver (whatever that actually is).
Thanks, I'll try it.
6 replies