Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

I think onDelete: CASCADE not working! #1859

Closed
colevels opened this issue Feb 9, 2018 · 3 comments
Closed

I think onDelete: CASCADE not working! #1859

colevels opened this issue Feb 9, 2018 · 3 comments

Comments

@colevels
Copy link

colevels commented Feb 9, 2018

When I delete a blog, comments in a blog not deleted. I removed ! at User on blog and Blog on the comment because it's error. #1795

type User {
  id: ID! @unique
  comments: [Comment!]! @relation(name: "CommentAuthor", onDelete: CASCADE)
  blog: Blog @relation(name: "BlogOwner", onDelete: CASCADE)
}

type Blog {
  id: ID! @unique
  comments: [Comment!]! @relation(name: "Comments", onDelete: CASCADE)
  owner: User @relation(name: "BlogOwner", onDelete: SET_NULL)
}

type Comment {
  id: ID! @unique
  blog: Blog @relation(name: "Comments", onDelete: NO_ACTION)
  author: User @relation(name: "CommentAuthor", onDelete: NO_ACTION)
}
@oxy88
Copy link

oxy88 commented Feb 9, 2018

@emipc
Copy link

emipc commented Feb 9, 2018

Check #1262

@marktani
Copy link
Contributor

marktani commented Feb 9, 2018

This is now available on the unstable channel, please refer to the two mentioned links by @oxy88 and @emipc for more information 🙂

@marktani marktani closed this as completed Feb 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants