Open
Description
The documentation describes the use of a default QuerySet on ObjectType level.
The unit test for this functionality makes use of DjangoConnectionField.
Using graphene.List
instead ignores the existence of the default QuerySet.
class CurrencyType(DjangoObjectType):
class Meta:
model = Currency
@classmethod
def get_queryset(cls, queryset, info):
print(cls)
print(queryset)
return queryset.filter(symbol__isnull=False)
all_currencies = graphene.List(CurrencyType)
def resolve_all_currencies(self, info):
return Currency.objects.all()
The get_queryset
method is never called, and the filter is not applied.
Please refer to graphql-python/graphene#698 for some history on this.