eamigo86 / graphene-django-extras

Extras functionalities for Graphene-Django
MIT License
417 stars 108 forks source link

Fix missing get_queryset method in DjangoObjectType #150

Closed cyhuang1230 closed 4 years ago

cyhuang1230 commented 4 years ago

Background:

Issue:

In v2.10.0, they refactored list_resolver in DjangoListField (commit). This time, get_queryset will always be called.

Without get_queryset method, objects inherited from graphene-django-extras.types.DjangoObjectType will throw type object has no attribute 'get_queryset' (like below).

image

Proposed Solution:

Add get_queryset method to graphene-django-extras.types.DjangoObjectType like graphene-django did.

codecov[bot] commented 4 years ago

Codecov Report

Merging #150 into master will increase coverage by 0.01%. The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #150      +/-   ##
==========================================
+ Coverage   53.63%   53.65%   +0.01%     
==========================================
  Files          24       24              
  Lines        1965     1968       +3     
==========================================
+ Hits         1054     1056       +2     
- Misses        911      912       +1     
Impacted Files Coverage Ξ”
graphene_django_extras/types.py 68.38% <66.66%> (-0.02%) :arrow_down:

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 8bd4e65...be073a1. Read the comment docs.

eamigo86 commented 4 years ago

Thanks for the input πŸ‘