Skip to content

[5.x] Make asset GraphQL type always nullable #11975

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

Open
wants to merge 1 commit into
base: 5.x
Choose a base branch
from

Conversation

lostgeek
Copy link

Fixes #11974.

When a user deletes an asset via the asset browser, it can lead to an asset field becoming null even though it is required by its blueprint. This creates a 500 error in the GraphQL endpoint and brings the entire page down.

This PR is a suggestion for a quick and easy fix by just making asset fields always nullable, regardless of whether they are set as required in their blueprint. Within the Control Panel, the field continues to be required, but as the asset deletion logic is able to squeeze a null into the asset field, its GraphQL type should be nullable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GraphQL runs into InvariantViolation when user deletes an asset used in a required field
1 participant