Sam Jackson
05/28/2018, 12:28 AMtype Post {
id: ID! @unique
text: String!
parent: Post @relation(name: "PostParent", onDelete: SET_NULL)
children: [Post!]! @relation(name: "PostParent", onDelete: CASCADE)
author: User! @relation(name: "UserPosts", onDelete: SET_NULL)
}
If a post is deleted, I want all of its children to be deleted as well. However, I get this error:
There was a loop in the path generated by the onDelete: Cascade directives on your schema when trying to do the delete.
Any thoughts on how to achieve the desired effect?Jscott388
05/28/2018, 12:31 AMSam Jackson
05/28/2018, 12:32 AMparent
and children
. Logically (based on their documentation) that probably won't work, but I don't see any other option.Sam Jackson
05/28/2018, 12:32 AMSam Jackson
05/28/2018, 12:35 AMnilan
05/28/2018, 9:07 AM