mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-05-15 05:13:46 +03:00
Use adapters instead of Connection and PageInfo
This commit is contained in:
parent
af9e3ca3cb
commit
78e510bf98
|
@ -2,11 +2,12 @@ from functools import partial
|
||||||
|
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
from graphene import NonNull
|
from graphene import NonNull
|
||||||
|
from graphene.relay.connection import page_info_adapter, connection_adapter
|
||||||
|
|
||||||
from promise import Promise
|
from promise import Promise
|
||||||
|
|
||||||
from graphene.types import Field, List
|
from graphene.types import Field, List
|
||||||
from graphene.relay import ConnectionField, PageInfo
|
from graphene.relay import ConnectionField
|
||||||
from graphql_relay.connection.arrayconnection import connection_from_list_slice
|
from graphql_relay.connection.arrayconnection import connection_from_list_slice
|
||||||
|
|
||||||
from .settings import graphene_settings
|
from .settings import graphene_settings
|
||||||
|
@ -113,9 +114,9 @@ class DjangoConnectionField(ConnectionField):
|
||||||
slice_start=0,
|
slice_start=0,
|
||||||
list_length=_len,
|
list_length=_len,
|
||||||
list_slice_length=_len,
|
list_slice_length=_len,
|
||||||
connection_type=connection,
|
connection_type=partial(connection_adapter, connection),
|
||||||
edge_type=connection.Edge,
|
edge_type=connection.Edge,
|
||||||
pageinfo_type=PageInfo,
|
pageinfo_type=page_info_adapter,
|
||||||
)
|
)
|
||||||
connection.iterable = iterable
|
connection.iterable = iterable
|
||||||
connection.length = _len
|
connection.length = _len
|
||||||
|
|
Loading…
Reference in New Issue
Block a user