implement interface interfaces on TypeMap, fix failing test

This commit is contained in:
Alec Rosenbaum 2021-01-15 13:13:05 -05:00
parent a17f63cf03
commit 7004515f06

View File

@ -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,
) )