Hi all — quick question, If I wanted to write an o...
# prisma-client
j
Hi all — quick question, If I wanted to write an object typed with a prisma model into a
JsonObject
, E.G: see below. How would I do this if the model includes dates? I am currently getting an error due to a type mismatch since a JSON object doesn’t accept date values? but a date should just be parsed to a string I believe, do I need to do this manually so TS won’t complain?
Copy code
model User { // user schema here}

import { User } from '@prisma/client';

const myObject: User = prisma.user.findUnique(// query here);

prisma.modelWithJsonField.create({
  data: { jsonField: myObject }
});