Skip to content

Only allow deletion of related models in nested mutations #2455

Description

@lucaslenz

Describe the bug

When using nested mutations to delete a related model of the root entity, it should only be possible to delete a actually related instance. Right now the delete functionality pointing to a many relationship (where you pass an array of IDs) tries to delete the models without checking the relation.

Expected behavior/Solution

I would assume that, according to the documentation, only entities which are related to the source entity will be deleted. Otherwise nothing happens.

I opened a MR with failing test cases to approve my statement.


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error within Lighthouse

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions