mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-04-16 07:02:04 +03:00
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
This commit is contained in:
parent
a9d39a4f5e
commit
84ae00f803
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user