Skip to content

Commit cd38ff6

Browse files
committed
Include test for unreferenced interface
Related GraphQL-js commit: graphql/graphql-js@1083c7e
1 parent 7d6aa95 commit cd38ff6

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

graphql/utils/tests/test_build_client_schema.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,35 @@ def test_builds_a_schema_with_an_interface():
170170
_test_schema(schema)
171171

172172

173+
def test_builds_a_schema_with_an_implicit_interface():
174+
FriendlyType = GraphQLInterfaceType(
175+
name='Friendly',
176+
resolve_type=lambda: None,
177+
fields=lambda: {
178+
'bestFriend': GraphQLField(FriendlyType, description='The best friend of this friendly thing.')
179+
}
180+
)
181+
182+
DogType = GraphQLObjectType(
183+
name='DogType',
184+
interfaces=[FriendlyType],
185+
fields=lambda: {
186+
'bestFriend': GraphQLField(DogType)
187+
}
188+
)
189+
190+
schema = GraphQLSchema(
191+
query=GraphQLObjectType(
192+
name='WithInterface',
193+
fields={
194+
'dog': GraphQLField(DogType)
195+
}
196+
)
197+
)
198+
199+
_test_schema(schema)
200+
201+
173202
def test_builds_a_schema_with_a_union():
174203
DogType = GraphQLObjectType(
175204
name='Dog',

0 commit comments

Comments
 (0)