Fix DeprecationWarning (py>3.8)

This commit is contained in:
Christian Glacet 2021-05-20 11:41:10 +02:00
parent afa44e8a5f
commit 1ad2ebeebf
2 changed files with 15 additions and 23 deletions

View File

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

View File

@ -1,5 +1,5 @@
import inspect
from collections import Mapping, OrderedDict
from collections.abc import Mapping
from functools import partial
from .argument import Argument, to_arguments
@ -100,7 +100,7 @@ class Field(MountedType):
self.name = name
self._type = type
self.args = to_arguments(args or OrderedDict(), extra_args)
self.args = to_arguments(args or dict(), extra_args)
if source:
resolver = partial(source_resolver, source)
self.resolver = resolver