tRPCttRPC
Powered by
Chris JaydenC
tRPC•3y ago•
4 replies
Chris Jayden

Typescript helper for router output

is there a helper to do this better? Get the output for a certain route? Or is this the way to do it?

import type { AppRouter } from "$lib/api/root";

type TInitialData = AppRouter['user']['me']['_def']['_output_out']

// Do stuff
import type { AppRouter } from "$lib/api/root";

type TInitialData = AppRouter['user']['me']['_def']['_output_out']

// Do stuff
Solution
is there a helper to do this better? Get the output for a certain route? Or is this the way to do it?

import type { AppRouter } from "$lib/api/root";

type TInitialData = AppRouter['user']['me']['_def']['_output_out']

// Do stuff
import type { AppRouter } from "$lib/api/root";

type TInitialData = AppRouter['user']['me']['_def']['_output_out']

// Do stuff
Jump to solution
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

Router output types not mapping?
hashwarpHhashwarp / ❓-help
2y ago
JSON inferred router output not matching
rdRrd / ❓-help
3y ago
Complex type inference on router outputs?
ianIian / ❓-help
2y ago