Closed hilmarhausmart closed 5 years ago
Merging #8 into master will increase coverage by
0.09%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #8 +/- ##
==========================================
+ Coverage 97.08% 97.17% +0.09%
==========================================
Files 5 5
Lines 274 283 +9
==========================================
+ Hits 266 275 +9
Misses 8 8
Impacted Files | Coverage Δ | |
---|---|---|
graphene_django_optimizer/query.py | 96.73% <100%> (+0.12%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 4611fec...9af9b57. Read the comment docs.
Aborted, will pull request more changes along with these later.
The optimizer should optimize the query when using GlobalID from Relay.
The current behavior is to jump to
abort_only_optimization
because the ID resolver is a partial function fromGlobalID.id_resolver
instead of the expectedDjangoObjectType.resolve_id
. Changed the behavior to also allow for GlobalID.The optimizer should defer the correct fields when using a CustomID with
resolve_id
When using a custom id (for instance an uuid) from
resolve_id
the query would be optimized with incorrectonly
fields sinceid
was hardcoded. Changed the behavior ofQueryOptimizer
to allow for a customid_field
in the constructor. Also added an export forQueryOptimizer
to allowquery
to remain simple.Added tests for both scenarios.
When passed an empty select_related list, a queryset will select all related fields
https://github.com/django/django/blob/2.1.3/django/db/models/query.py#L949
Added a condition for select_related and prefetch_related