Skip to content

Conversation

@lostgeek
Copy link
Contributor

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.

@jasonvarga jasonvarga merged commit d9bc290 into statamic:5.x Sep 22, 2025
25 checks passed
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

2 participants