From 84ae00f803c874a50780ca753ad77c353f7a7164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Sun, 15 Mar 2020 19:43:55 +0300 Subject: [PATCH] Replace deprecated connection_from_list_slice with connection_from_array_slice connection_from_list_slice: > Deprecated alias for connection_from_array_slice. We're now using the JavaScript terminology in Python as well, since list is too narrow a type and there is no other really appropriate type name. https://github.com/graphql-python/graphql-relay-py/blob/v3.0.0/src/graphql_relay/connection/arrayconnection.py#L54 --- graphene_django/fields.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/graphene_django/fields.py b/graphene_django/fields.py index a4479d5..66b6011 100644 --- a/graphene_django/fields.py +++ b/graphene_django/fields.py @@ -1,12 +1,13 @@ from functools import partial from django.db.models.query import QuerySet -from graphene import NonNull -from graphene.relay import ConnectionField -from graphene.types import Field, List -from graphql_relay.connection.arrayconnection import connection_from_list_slice +from graphql_relay.connection.arrayconnection import connection_from_array_slice from promise import Promise +from graphene import NonNull +from graphene.relay import ConnectionField, PageInfo +from graphene.types import Field, List + from .settings import graphene_settings from .utils import maybe_queryset @@ -121,15 +122,15 @@ class DjangoConnectionField(ConnectionField): _len = iterable.count() else: _len = len(iterable) - connection = connection_from_list_slice( + connection = connection_from_array_slice( iterable, args, slice_start=0, - list_length=_len, - list_slice_length=_len, - connection_type=partial(connection_adapter, connection), + connection_type=connection, + array_length=_len, + array_slice_length=_len, edge_type=connection.Edge, - pageinfo_type=page_info_adapter, + page_info_type=PageInfo, ) connection.iterable = iterable connection.length = _len