t
tRPC
t
tRPC
Recommended way of typing query&mutation input?
Original message was deleted
tRPC
Join
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,111
Members
View on Discord
D
Dani;
•
10/13/22, 1:48 PM
https://trpc.io/docs/v9/infer-types
Inferring Types | tRPC
It is often useful to wrap functionality of your
@trpc
/client or
@trpc
/react api within other functions
. For this purpose
, it
's necessary to be able to infer input types
, output types
, and api paths generated by your
@trpc
/server router
.
D
Dani;
•
10/13/22, 3:04 PM
Maybe some TS wizardry will be able to do that
, but I find it easy enough to just create a type for each input
/output of a procedure
D
Dani;
•
10/13/22, 3:04 PM
exactly