@@ -270,3 +270,33 @@ class Meta:
270
270
assert graphql_type .is_type_of
271
271
assert graphql_type .is_type_of ({}, None ) is True
272
272
assert graphql_type .is_type_of (MyObjectType (), None ) is False
273
+
274
+
275
+ def test_interface_with_interfaces ():
276
+ class FooInterface (Interface ):
277
+ foo = String ()
278
+
279
+ class BarInterface (Interface ):
280
+ class Meta :
281
+ interfaces = [FooInterface ]
282
+
283
+ foo = String ()
284
+ bar = String ()
285
+
286
+ type_map = create_type_map ([FooInterface , BarInterface ])
287
+ assert "FooInterface" in type_map
288
+ foo_graphql_type = type_map ["FooInterface" ]
289
+ assert isinstance (foo_graphql_type , GraphQLInterfaceType )
290
+ assert foo_graphql_type .name == "FooInterface"
291
+
292
+ assert "BarInterface" in type_map
293
+ bar_graphql_type = type_map ["BarInterface" ]
294
+ assert isinstance (bar_graphql_type , GraphQLInterfaceType )
295
+ assert bar_graphql_type .name == "BarInterface"
296
+
297
+ fields = bar_graphql_type .fields
298
+ assert list (fields ) == ["foo" , "bar" ]
299
+ assert isinstance (fields ["foo" ], GraphQLField )
300
+ assert isinstance (fields ["bar" ], GraphQLField )
301
+
302
+ assert bar_graphql_type .interfaces == [foo_graphql_type ]
0 commit comments