strawberry-graphql / strawberry-django

Strawberry GraphQL Django extension
MIT License
391 stars 115 forks source link

feat(optimizer): Do not defer select_related fields if no only was specified #465

Closed bellini666 closed 5 months ago

bellini666 commented 5 months ago

When doing select_related=["foo"] and not doing only=["foo_<something>"], we should add "foo" to the only field to make sure none of its fields will be deferred.

Fix #455

codecov-commenter commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (31a7c2f) 87.73% compared to head (a7f496c) 87.75%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #465 +/- ## ========================================== + Coverage 87.73% 87.75% +0.02% ========================================== Files 37 37 Lines 3146 3153 +7 ========================================== + Hits 2760 2767 +7 Misses 386 386 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Ivan-Vinitskyi commented 5 months ago

@bellini666 should it works without DjangoOptimizerExtension?

bellini666 commented 5 months ago

@Ivan-Vinitskyi no, optimization hints only work when DjangoOptimizerExtension is enabled