Closed bellini666 closed 3 months ago
This pull request addresses a regression issue by setting files early on mutations to allow clean methods to validate them. The changes primarily involve removing the handling of file fields from the prepare_create_update
function and its associated calls in the create
and update
functions. Additionally, a new test case is added to ensure the correct behavior when unsetting an optional file.
Files | Changes |
---|---|
strawberry_django/mutations/resolvers.py |
Refactored the handling of file fields in the prepare_create_update , create , and update functions to set files early on mutations, allowing clean methods to validate them. |
tests/mutations/test_mutations.py |
Added a new test case to ensure the correct behavior when unsetting an optional file and fixed a typo in an existing test case. |
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 88.87%. Comparing base (
db5ca05
) to head (11486f9
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This is a regression from: https://github.com/strawberry-graphql/strawberry-django/pull/394
Fix https://github.com/strawberry-graphql/strawberry-django/issues/564
Summary by Sourcery
This pull request addresses a regression issue by ensuring files are set early in mutations to allow validation methods to function correctly. It also includes a new test to verify the update functionality when unsetting an optional file.