Closed bellini666 closed 3 months ago
This pull request addresses an issue where specialized connection aliases were missing filters and ordering arguments. The changes ensure that when retrieving the strawberry Django type, any LazyType
is resolved, and specialized type variables for aliases are considered to get the NodeType
. This fix ensures that fields like Author.books
will now include filters
and order
arguments.
Files | Changes |
---|---|
tests/relay/lazy/b.py tests/relay/lazy/a.py tests/relay/lazy/models.py |
Added new test files and models to verify the fix for specialized connection aliases including filters and ordering arguments. |
@bellini666 Awesome! This really helps me with my migration. 🙏 👏 Works perfectly! 👍
When retrieving the strawberry django type, we need to make sure to resolve any
LazyType
and also to consider specialized type vars for aliases to get theNodeType
from them.This also bumps the minimum strawberry version to 0.234.2 as the fix in that release is required for this change.
Without this change,
Author.books
would not containfilters
andorder
argumentsFix https://github.com/strawberry-graphql/strawberry-django/issues/535
Thanks @Eraldo for reporting and creating an MRE that helped to identify the issue
Summary by Sourcery
This pull request fixes a bug where specialized connection aliases were missing filters and ordering arguments by resolving LazyType and considering specialized type vars for aliases. New tests were added to ensure the correctness of these changes.