mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-14 02:02:20 +03:00
fixed resolve connection
This commit is contained in:
parent
2465b1ab20
commit
a913ed3c2b
|
@ -31,7 +31,7 @@ class DjangoListField(Field):
|
||||||
|
|
||||||
class DjangoConnectionField(ConnectionField):
|
class DjangoConnectionField(ConnectionField):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.on = kwargs.pop("on", "nodes")
|
self.on = "nodes"
|
||||||
self.max_limit = kwargs.pop(
|
self.max_limit = kwargs.pop(
|
||||||
"max_limit", graphene_settings.RELAY_CONNECTION_MAX_LIMIT
|
"max_limit", graphene_settings.RELAY_CONNECTION_MAX_LIMIT
|
||||||
)
|
)
|
||||||
|
@ -81,13 +81,7 @@ class DjangoConnectionField(ConnectionField):
|
||||||
if iterable is None:
|
if iterable is None:
|
||||||
iterable = default_manager
|
iterable = default_manager
|
||||||
iterable = maybe_queryset(iterable)
|
iterable = maybe_queryset(iterable)
|
||||||
if isinstance(iterable, NodeSet):
|
_len = len(iterable)
|
||||||
if iterable is not default_manager:
|
|
||||||
default_queryset = maybe_queryset(default_manager)
|
|
||||||
iterable = cls.merge_querysets(default_queryset, iterable)
|
|
||||||
_len = iterable.count()
|
|
||||||
else:
|
|
||||||
_len = len(iterable)
|
|
||||||
connection = connection_from_list_slice(
|
connection = connection_from_list_slice(
|
||||||
iterable,
|
iterable,
|
||||||
args,
|
args,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user