t
tRPC
t
tRPC
default response wrapper response { data ... }
Original message was deleted
tRPC
Join
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,111
Members
View on Discord
P
prime
How can I get rid of the default wrapper on responses? If I say a query's output...
J
julius
•
10/15/22, 2:18 PM
This is what data transformers are for
, if you use like superjson you get what you are describing
J
julius
•
10/15/22, 2:24 PM
check our minimal examples
, they don
't use transformers and get the plain object
J
julius
•
10/15/22, 2:24 PM
J
julius
•
10/15/22, 2:25 PM
what you
're describing imo often comes from then you have put a data transformer on one end but not the other
J
julius
•
10/15/22, 2:25 PM
i
.e
. you have superjson on the server but not on the client
P
prime
so 1. it's unclear what query param is mapped to the `val` param in the code 2....
J
julius
•
10/15/22, 3:11 PM
oh so you
're calling it via url and not the trpc client
?
J
julius
•
10/15/22, 3:12 PM
that
's not really what you
're supposed to do
, if you need that
, check out
#
-trpc
-openapi
- that converts your procedures to openapi specced rest endpoints
default response wrapper response { data ... } - tRPC