hachoter
hachoter16mo ago

convert the result to date objects

I am not sure if this is even trpcs responsibility but I would like to get my date objects as date objects not strings, the main reason is actually because when I type it on the frontend I am using the prisma client amd it doesn't match up
2 Replies
Nick
Nick16mo ago
You want a transformer, it’s a standard tRPC feature you just have to enable By default dates get converted to strings by the tRPC types so that should at least be accurate
mark salsbery
mark salsbery16mo ago
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.