hinsxd
10/19/2018, 6:14 AMtype Post {
id: ID!
comments: [Comment!]!
}
type Comment {
id: ID!
user: User!
comment: String!
}
What is the best way to append a new comment to the post? If I add a field post: Post!
into Comment
, it feels too verbose. Is it a common way to always implement 2-way relations?nilan
10/19/2018, 8:42 AMhinsxd
10/19/2018, 10:19 AMprisma.updatePost({ where: id, data: { comments: { create : { ... } } })
nilan
10/19/2018, 10:41 AM