Hi, when I try to delete anode A or B, it returns me an error. I saw that the onDelete: SET_NULL is not required, but I think this is an issue. Have you an idea about this ?
MODEL :
type Article {
user: User! @relation(name: "MyArticles", onDelete: SET_NULL)
}
type User {
article: [Article !]! @relation(name: "MyArticles", onDelete: SET_NULL)
}
MUTATION :
deleteArticle(id: ID!): Article!
return ctx.db.mutation.deleteArticle({ where: { id } });
The change you are trying to make would violate the required relation 'MyArticles' between Article and User
Have you tried to do onDelete: CASCADE instead?
Here is more information about the behaviour of cascading deletes: https://www.prisma.io/forum/t/help-with-cascading-deletes/3878/2?u=nilan.
Nop, the thing is that I don't want to delete anything.
Can you share a reproduction according to the bug report template? This looks like unexpected behaviour.
Well, my bad, I had a "not null" condition on my relationnal node. See #1795