mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-18 03:52:24 +03:00
Revert change to explicit kwargs
This commit is contained in:
parent
7f6b62603e
commit
3701aa42d6
|
@ -20,32 +20,15 @@ class ObjectTypeOptions(BaseOptions):
|
||||||
|
|
||||||
|
|
||||||
class ObjectTypeMeta(BaseTypeMeta):
|
class ObjectTypeMeta(BaseTypeMeta):
|
||||||
def __new__(
|
def __new__(cls, name_, bases, namespace, **options):
|
||||||
cls,
|
# Note: it's safe to pass options as keyword arguments as they are still type-checked by ObjectTypeOptions.
|
||||||
name_,
|
|
||||||
bases,
|
|
||||||
namespace,
|
|
||||||
name=None,
|
|
||||||
description=None,
|
|
||||||
fields=None,
|
|
||||||
interfaces=(),
|
|
||||||
):
|
|
||||||
# We create this type, to then overload it with the dataclass attrs
|
# We create this type, to then overload it with the dataclass attrs
|
||||||
class InterObjectType:
|
class InterObjectType:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
kwargs = {}
|
|
||||||
if name:
|
|
||||||
kwargs["name"] = name
|
|
||||||
if description:
|
|
||||||
kwargs["description"] = description
|
|
||||||
if fields:
|
|
||||||
kwargs["fields"] = fields
|
|
||||||
if interfaces:
|
|
||||||
kwargs["interfaces"] = interfaces
|
|
||||||
|
|
||||||
base_cls = super().__new__(
|
base_cls = super().__new__(
|
||||||
cls, name_, (InterObjectType,) + bases, namespace, **kwargs,
|
cls, name_, (InterObjectType,) + bases, namespace, **options,
|
||||||
)
|
)
|
||||||
if base_cls._meta:
|
if base_cls._meta:
|
||||||
fields = [
|
fields = [
|
||||||
|
|
Loading…
Reference in New Issue
Block a user