mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-25 19:13:57 +03:00
implement interface interfaces on TypeMap, fix failing test
This commit is contained in:
parent
a17f63cf03
commit
7004515f06
|
@ -236,11 +236,20 @@ class TypeMap(dict):
|
||||||
else None
|
else None
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def interfaces():
|
||||||
|
interfaces = []
|
||||||
|
for graphene_interface in graphene_type._meta.interfaces:
|
||||||
|
interface = self.add_type(graphene_interface)
|
||||||
|
assert interface.graphene_type == graphene_interface
|
||||||
|
interfaces.append(interface)
|
||||||
|
return interfaces
|
||||||
|
|
||||||
return GrapheneInterfaceType(
|
return GrapheneInterfaceType(
|
||||||
graphene_type=graphene_type,
|
graphene_type=graphene_type,
|
||||||
name=graphene_type._meta.name,
|
name=graphene_type._meta.name,
|
||||||
description=graphene_type._meta.description,
|
description=graphene_type._meta.description,
|
||||||
fields=partial(self.create_fields_for_type, graphene_type),
|
fields=partial(self.create_fields_for_type, graphene_type),
|
||||||
|
interfaces=interfaces,
|
||||||
resolve_type=resolve_type,
|
resolve_type=resolve_type,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user