Extend nested mutation feature to include delete mutations. Helpful when you have dependent children and want to delete them given the deletion of the parent. Might look like:
mutation deleteCategory($id: ID!) {
deleteCategory(id: $id, subCategories: ALL) {
id
}
}
Thanks for suggesting this feature @thomaswright! We'll consider it while evolving the API design! 馃憤
Rails has something called a dependent property for a relation and you can set it to destroy. Like User has many Books, dependent => destroy(not actual syntax). This would just remove any associated book records if a user is deleted. Maybe add this setting when creating a relation between two different models.
A nested delete action has been implemented in the Prisma 1.0 release.
A cascading delete future will be added soon, as discussed here: #1262.
Most helpful comment
Rails has something called a dependent property for a relation and you can set it to destroy. Like User has many Books, dependent => destroy(not actual syntax). This would just remove any associated book records if a user is deleted. Maybe add this setting when creating a relation between two different models.