@@ -289,3 +289,33 @@ class Meta:
289289 assert graphql_type .is_type_of
290290 assert graphql_type .is_type_of ({}, None ) is True
291291 assert graphql_type .is_type_of (MyObjectType (), None ) is False
292+
293+
294+ def test_interface_with_interfaces ():
295+ class FooInterface (Interface ):
296+ foo = String ()
297+
298+ class BarInterface (Interface ):
299+ class Meta :
300+ interfaces = [FooInterface ]
301+
302+ foo = String ()
303+ bar = String ()
304+
305+ type_map = create_type_map ([FooInterface , BarInterface ])
306+ assert "FooInterface" in type_map
307+ foo_graphql_type = type_map ["FooInterface" ]
308+ assert isinstance (foo_graphql_type , GraphQLInterfaceType )
309+ assert foo_graphql_type .name == "FooInterface"
310+
311+ assert "BarInterface" in type_map
312+ bar_graphql_type = type_map ["BarInterface" ]
313+ assert isinstance (bar_graphql_type , GraphQLInterfaceType )
314+ assert bar_graphql_type .name == "BarInterface"
315+
316+ fields = bar_graphql_type .fields
317+ assert list (fields ) == ["foo" , "bar" ]
318+ assert isinstance (fields ["foo" ], GraphQLField )
319+ assert isinstance (fields ["bar" ], GraphQLField )
320+
321+ assert bar_graphql_type .interfaces == [foo_graphql_type ]
0 commit comments