Hey I have a schema, where I want to replace posts...
# prisma-whats-new
p
Hey I have a schema, where I want to replace posts on update
Copy code
type User {
  name: String,
  posts: [Post!]!
}
I want to replace the posts for the user. But I am not sure how. If I do
Copy code
mutation {
   updateUser(
      where: {id: "123"},
      data: {
        posts: {
         create: [{title: 'hi}, {title: 'hey'}]
       } 
     }
   )
}
It just appends the posts, instead of replacing them
c
@pnicolaou Were you able to find the answer to this?
p
No, but what I did was create a new type called like this
Copy code
type Posts = {
   id: ID!
   list: [Post!]!
}

And then I can replace it! Hope it helps for now
👍 1