mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-05 12:53:12 +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
9c56e4d572
commit
1e79165a7e
|
@ -1,7 +1,8 @@
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
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 promise import Promise
|
||||||
|
|
||||||
from graphene import NonNull
|
from graphene import NonNull
|
||||||
|
@ -122,15 +123,15 @@ class DjangoConnectionField(ConnectionField):
|
||||||
_len = iterable.count()
|
_len = iterable.count()
|
||||||
else:
|
else:
|
||||||
_len = len(iterable)
|
_len = len(iterable)
|
||||||
connection = connection_from_list_slice(
|
connection = connection_from_array_slice(
|
||||||
iterable,
|
iterable,
|
||||||
args,
|
args,
|
||||||
slice_start=0,
|
slice_start=0,
|
||||||
list_length=_len,
|
|
||||||
list_slice_length=_len,
|
|
||||||
connection_type=connection,
|
connection_type=connection,
|
||||||
|
array_length=_len,
|
||||||
|
array_slice_length=_len,
|
||||||
edge_type=connection.Edge,
|
edge_type=connection.Edge,
|
||||||
pageinfo_type=PageInfo,
|
page_info_type=PageInfo,
|
||||||
)
|
)
|
||||||
connection.iterable = iterable
|
connection.iterable = iterable
|
||||||
connection.length = _len
|
connection.length = _len
|
||||||
|
|
Loading…
Reference in New Issue
Block a user