coder2000
coder20002w ago

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...
Data Transformers | tRPC
You are able to serialize the response data & input args. The transformers need to be added both to the server and the client.
Jump to solution
2 Replies
Solution
FluX
FluX2w ago
Afaik you need to use a transformer https://trpc.io/docs/server/data-transformers
Data Transformers | tRPC
You are able to serialize the response data & input args. The transformers need to be added both to the server and the client.
coder2000
coder2000OP2w ago
Thanks

Did you find this page helpful?