Revert back to ordereddict

This commit is contained in:
Christian Glacet 2021-05-20 15:06:24 +02:00
parent 1ad2ebeebf
commit 3726fa7574

View File

@ -1,5 +1,6 @@
import re import re
from collections.abc import Iterable from collections.abc import Iterable
from collections import OrderedDict
from functools import partial from functools import partial
from graphql_relay import connection_from_list from graphql_relay import connection_from_list
@ -86,18 +87,26 @@ class Connection(ObjectType):
options["name"] = name options["name"] = name
_meta.node = node _meta.node = node
_meta.fields = { _meta.fields = OrderedDict(
"page_info": Field( [
PageInfo, (
name="pageInfo", "page_info",
required=True, Field(
description="Pagination data for this connection.", PageInfo,
), name="pageInfo",
"edges": Field( required=True,
NonNull(List(edge)), description="Pagination data for this connection.",
description="Contains the nodes in this connection.", ),
), ),
} (
"edges",
Field(
NonNull(List(edge)),
description="Contains the nodes in this connection.",
),
),
]
)
return super(Connection, cls).__init_subclass_with_meta__( return super(Connection, cls).__init_subclass_with_meta__(
_meta=_meta, **options _meta=_meta, **options
) )