Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only allow deletion of related models in nested mutations #2455

Open
lucaslenz opened this issue Oct 6, 2023 · 0 comments · May be fixed by #2454
Open

Only allow deletion of related models in nested mutations #2455

lucaslenz opened this issue Oct 6, 2023 · 0 comments · May be fixed by #2454
Labels
bug An error within Lighthouse

Comments

@lucaslenz
Copy link
Contributor

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.


@lucaslenz lucaslenz linked a pull request Oct 6, 2023 that will close this issue
3 tasks
@spawnia spawnia added the bug An error within Lighthouse label Oct 6, 2023
@nuwave nuwave deleted a comment from lucaslenz Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error within Lighthouse
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants