mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-23 15:10:48 +03:00
Allow custom Meta attributes in subclasses of Interface
This commit is contained in:
parent
557ec44a13
commit
1cbed050b8
|
@ -16,12 +16,19 @@ class InterfaceMeta(AbstractTypeMeta):
|
||||||
if not is_base_type(bases, InterfaceMeta):
|
if not is_base_type(bases, InterfaceMeta):
|
||||||
return type.__new__(cls, name, bases, attrs)
|
return type.__new__(cls, name, bases, attrs)
|
||||||
|
|
||||||
options = Options(
|
_meta = attrs.pop('_meta', None)
|
||||||
attrs.pop('Meta', None),
|
defaults = dict(
|
||||||
name=name,
|
name=name,
|
||||||
description=trim_docstring(attrs.get('__doc__')),
|
description=trim_docstring(attrs.get('__doc__')),
|
||||||
local_fields=None,
|
local_fields=None,
|
||||||
)
|
)
|
||||||
|
if not _meta:
|
||||||
|
options = Options(
|
||||||
|
attrs.pop('Meta', None),
|
||||||
|
**defaults
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
options = _meta.extend_with_defaults(defaults)
|
||||||
|
|
||||||
options.base_fields = get_base_fields(bases, _as=Field)
|
options.base_fields = get_base_fields(bases, _as=Field)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user