Closed Mapiarz closed 1 day ago
This pull request adds support for field type resolution for Django 5 GeneratedFields. The changes include importing GeneratedField, updating type resolution logic to use model_field.output_field, and extending tests to ensure backward compatibility with Django versions prior to 5.
Files | Changes |
---|---|
strawberry_django/fields/base.py strawberry_django/fields/types.py |
Added support for Django 5 GeneratedField by importing it and updating type resolution logic to use model_field.output_field. |
I added support for field type resolution for Django 5
GeneratedFields
. For a generated field, theoutput_field
is mandatory, and this is what I'm using to determine the strawberry field type.Extended existing test about field type resolution that is backwards compatible with Django <5. Did not modify the project dependencies.
Summary by Sourcery
This pull request introduces support for resolving field types for Django 5
GeneratedFields
by utilizing theoutput_field
attribute. It also extends existing tests to cover this new functionality while maintaining compatibility with earlier Django versions.GeneratedFields
using theoutput_field
attribute.GeneratedFields
, ensuring backwards compatibility with Django versions prior to 5.