I am trying to find examples of how to create a "child" object in prisma client.
Let's say this is my schema (fake example):
model User {
id: string,
posts: Post[]
}
model Post {
userId: int,
user: User
}
So in this example I am refering to a "child" as a Post of a User.
Now, let's say that I already "have" the user object. How then do I create a Post for this user?
let user = await prismaClient.user.upsert({
where: {id: "someId"},
update: {},
create: {id: "someId"}
}
user.createPost (???) // <--- What do I write here?