gqlify icon indicating copy to clipboard operation
gqlify copied to clipboard

Delete cascade

Open wwwy3y3 opened this issue 7 years ago • 2 comments

Is your feature request related to a problem? Please describe. Delete mutation should have cascade feature.

Describe the solution you'd like When deleting a record, the relationship data at other places (relation table, foreign key) should be deleted as well.

wwwy3y3 avatar Dec 05 '18 07:12 wwwy3y3

Maybe a directive could be provided that denotes whether a deletion should also cascade delete related records, leave related records alone, or throw an error when deletion of a record with related data is attempted.

Django offers these options with the on_delete argument of their ForeignKey relationship.

https://docs.djangoproject.com/en/2.1/ref/models/fields/#arguments

jonesnc avatar Dec 23 '18 08:12 jonesnc

@jonesnc haven't check out Django api on the relationship before. Looks like we can actually use similar arguments on the cascade deletes part.

Thanks for the helpful information!

wwwy3y3 avatar Dec 24 '18 03:12 wwwy3y3