coder2000C
tRPC10mo ago
4 replies
coder2000

Wrong type for results

I have a query that has a couple fields with the Date type, however when queried with TanStack they are being returned as
string
. Is there a way to cast them to Date again?
Solution
Afaik you need to use a transformer
https://trpc.io/docs/server/data-transformers
You are able to serialize the response data & input args. The transformers need to be added both to the server and the client.
Data Transformers | tRPC
Was this page helpful?