From 7f471252daa209d1cb834bbfe436469837f519a8 Mon Sep 17 00:00:00 2001 From: Pablo Chinea Date: Thu, 23 Feb 2017 14:24:25 +0000 Subject: [PATCH] Avoids redundant filtering with non-nested nodes. --- graphene_django/fields.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/graphene_django/fields.py b/graphene_django/fields.py index e282ebe..8fba569 100644 --- a/graphene_django/fields.py +++ b/graphene_django/fields.py @@ -49,7 +49,8 @@ class DjangoConnectionField(ConnectionField): iterable = default_manager iterable = maybe_queryset(iterable) if isinstance(iterable, QuerySet): - iterable &= maybe_queryset(default_manager) + if iterable is not default_manager: + iterable &= maybe_queryset(default_manager) _len = iterable.count() else: _len = len(iterable)