t
tRPC
O
tRPC
•
3y ago
•
8 replies
Okan
Dynamic return type
Is there any way to have dynamic return type with tRPC
?
Simple example
:
If I provide x
: true on body
, let me send number
, otherwise string
.
But mainly
, I want to use it for select fields on database
Solution
Is there any way to have dynamic return type with tRPC
?
Simple example
:
If I provide x
: true on body
, let me send number
, otherwise string
.
But mainly
, I want to use it for select fields on database
Jump to solution
tRPC
Join
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
save return type to type var
V
Varich / ❓-help
4y ago
Inconsistent types for mutation return type
S
Spoonman / ❓-help
15mo ago
return type of a query endpoint
R
rustclan / ❓-help
3y ago
Type return error when using mongoose.
J
juico / ❓-help
3y ago