Skip to content

Commit 86b7e6a

Browse files
committed
update InterfaceOptions to fix failing test
1 parent ae93499 commit 86b7e6a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

graphene/types/interface.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
# For static type checking with Mypy
66
MYPY = False
77
if MYPY:
8-
from typing import Dict # NOQA
8+
from typing import Dict, Iterable, Type # NOQA
99

1010

1111
class InterfaceOptions(BaseOptions):
1212
fields = None # type: Dict[str, Field]
13+
interfaces = () # type: Iterable[Type[Interface]]
1314

1415

1516
class Interface(BaseType):
@@ -45,7 +46,7 @@ class Meta:
4546
"""
4647

4748
@classmethod
48-
def __init_subclass_with_meta__(cls, _meta=None, **options):
49+
def __init_subclass_with_meta__(cls, _meta=None, interfaces=(), **options):
4950
if not _meta:
5051
_meta = InterfaceOptions(cls)
5152

@@ -58,6 +59,9 @@ def __init_subclass_with_meta__(cls, _meta=None, **options):
5859
else:
5960
_meta.fields = fields
6061

62+
if not _meta.interfaces:
63+
_meta.interfaces = interfaces
64+
6165
super(Interface, cls).__init_subclass_with_meta__(_meta=_meta, **options)
6266

6367
@classmethod

0 commit comments

Comments
 (0)