tRPCttRPC
Powered by
bill92B
tRPC•2y ago•
2 replies
bill92

Infer query type of `data`

Using trpc version 11, how can I infer
data
data
?

const { isLoading, isError, error, data } =
    trpc.patient.list.useQuery();

<SomeComponent data={data} />
const { isLoading, isError, error, data } =
    trpc.patient.list.useQuery();

<SomeComponent data={data} />


Are there any utils on doing so? I've seen
export type PatientData = inferRouterOutputs<ApiRouter>;
export type PatientData = inferRouterOutputs<ApiRouter>;


but it doesn't work

any help?
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

How to infer types of a query
HussamHHussam / ❓-help
3y ago
Client fails to infer drizzle data returned from a query
LukaLLuka / ❓-help
15mo ago
Type too complex to infer?
hashwarpHhashwarp / ❓-help
2y ago