strawberry-graphql / strawberry-django

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

feat: allow extensions to prevent results from being fetched #481

Closed bellini666 closed 4 months ago

bellini666 commented 4 months ago

Currently we have to qs._fetch_all() because graphql-core will try to iterate over the QuerySet in a sync way, thus causing issues when running ASGI.

This adds a way for extensions to prevent that from happening, as discussed in https://github.com/strawberry-graphql/strawberry/issues/3364

When grapghql-core 3.3.0 is released we can probably stop fetching results at all, as it will give preference to use __aiter__ if the object provides one (and the QuerySet does)

codecov-commenter commented 4 months ago

Codecov Report

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

Comparison is base (94830a1) 87.90% compared to head (47f20e8) 87.91%. Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #481 +/- ## ========================================== + Coverage 87.90% 87.91% +0.01% ========================================== Files 37 37 Lines 3167 3170 +3 ========================================== + Hits 2784 2787 +3 Misses 383 383 ```

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