How to infer types of a query
Coinsider the example
I would like to export the type we get on hover(on hello).
I could only find how to infer the data type from the docs
https://trpc.io/docs/infer-types using
The reason I am passing everything and not just data as props down to components, is because I want to access the loading, error states etc.
const hello = trpc.hello.useQuery();I would like to export the type we get on hover(on hello).
I could only find how to infer the data type from the docs
const { data } = trpc.hello.useQuery() https://trpc.io/docs/infer-types using
inferRouterOutputsThe reason I am passing everything and not just data as props down to components, is because I want to access the loading, error states etc.
It is often useful to wrap functionality of your @trpc/client or @trpc/react-query api within other functions. For this purpose, it's necessary to be able to infer input types and output types generated by your @trpc/server router.