I am trying to define a Post type that has two opt...
# orm-help
s
I am trying to define a Post type that has two optional fields:
parent
for a parent Post, and
children
for Posts with that Post as its parent. Right now when I define a Post with a parent, the parent gets the newly-created Post as its parent as well. Any thoughts on what might be going on?
Copy code
type Post {
  id: ID! @unique
  body: String!
  author: User! @relation(name: "UserPosts")
  parent: Post @relation(name: "PostParent")
  children: [Post!]! @relation(name: "PostChildren")
}
n
the reason has been discussed in this thread: https://prisma.slack.com/archives/CA491RJH0/p1527085582000388 🙂