strawberry-graphql / strawberry-django

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

fix: cache definitions in optimizer #474

Closed yergom closed 4 months ago

yergom commented 4 months ago

Only 1 subtype of an interface types (e.g Node) is optimized. This PR fixes the optimizer's `_interfaces cache, so that all interfaces are considered for optimization. I assume that the cache was introduced to avoid a performance hit (having to iterate over all the schema's types) every time an interface has to be optimized.

Before this PR, the following would happen. Suppose that we have A and B, both implementing the Node interface:

Types of Changes

Checklist

codecov-commenter commented 4 months ago

Codecov Report

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

Comparison is base (5c999e9) 87.90% compared to head (a4cc6a7) 87.90%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #474 +/- ## ======================================= Coverage 87.90% 87.90% ======================================= Files 37 37 Lines 3166 3167 +1 ======================================= + Hits 2783 2784 +1 Misses 383 383 ```

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