mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-16 19:12:21 +03:00
Fix DeprecationWarning (py>3.8)
This commit is contained in:
parent
afa44e8a5f
commit
1ad2ebeebf
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user