Is there is way to make Type.Date into Type.String when converting the DateTime from Prisma to TypeBox? #10
Replies: 2 comments 2 replies
-
This seems like a misconfigured typescript/module resolution. When using ESM you should not be required to set the .js extension in your imports.
This would cause type mismatches when using the schemas with prisma. You then could not pass them into or apply them to values coming/going in/out of prisma and are required to make manual mappers. This is because prisma enforces usage of JS Date objects. |
Beta Was this translation helpful? Give feedback.
-
This might be resolved by #11 |
Beta Was this translation helpful? Give feedback.
-
I am using Fastify, and I am trying to use the generated TypeBox type as the schema for the request and reply, however Fastify can only serialize the
Type.Date
if it isType.String
. Is there a way that Prismabox can have an option of choosing eitherType.Date
orType.String
?Also, I am experiencing import issues for ESM, where the
__nullable__
generated in the prismabox directory gives an error saying it has to beimport { __nullable__ } from "./__nullable__.js";
, but the original one does not come with.js
, is there a way to append this by Prismabox?Beta Was this translation helpful? Give feedback.
All reactions