@@ -3,6 +3,7 @@ package graphql.kickstart.tools
3
3
import graphql.kickstart.tools.resolver.FieldResolverError
4
4
import graphql.language.SourceLocation
5
5
import graphql.schema.GraphQLInterfaceType
6
+ import graphql.schema.GraphQLObjectType
6
7
import graphql.schema.GraphQLSchema
7
8
import org.springframework.aop.framework.ProxyFactory
8
9
import spock.lang.Specification
@@ -445,7 +446,8 @@ class SchemaParserSpec extends Specification {
445
446
traits: [PoodleTrait]
446
447
}
447
448
448
- type Query { test: [Poodle] }''' . stripIndent())
449
+ type Query { test: [Poodle] }
450
+ ''' . stripIndent())
449
451
.resolvers(new GraphQLQueryResolver () {
450
452
static abstract class Trait {
451
453
String id;
@@ -476,12 +478,20 @@ class SchemaParserSpec extends Specification {
476
478
})
477
479
.build()
478
480
.makeExecutableSchema()
479
- GraphQLInterfaceType traitInterface = schema. getType(" MammalTrait" ) as GraphQLInterfaceType
481
+ GraphQLInterfaceType traitInterface = schema. getType(" Trait" ) as GraphQLInterfaceType
482
+ GraphQLInterfaceType animalInterface = schema. getType(" Animal" ) as GraphQLInterfaceType
483
+ GraphQLInterfaceType mammalTraitInterface = schema. getType(" MammalTrait" ) as GraphQLInterfaceType
480
484
GraphQLInterfaceType dogInterface = schema. getType(" Dog" ) as GraphQLInterfaceType
485
+ GraphQLObjectType poodleObject = schema. getType(" Poodle" ) as GraphQLObjectType
486
+ GraphQLObjectType poodleTraitObject = schema. getType(" PoodleTrait" ) as GraphQLObjectType
481
487
482
488
then :
483
- ! traitInterface. interfaces. empty
484
- ! dogInterface. interfaces. empty
489
+ poodleObject. interfaces. containsAll([dogInterface, animalInterface])
490
+ poodleTraitObject. interfaces. containsAll([mammalTraitInterface, traitInterface])
491
+ dogInterface. interfaces. contains(animalInterface)
492
+ mammalTraitInterface. interfaces. contains(traitInterface)
493
+ traitInterface. interfaces. empty
494
+ animalInterface. interfaces. empty
485
495
}
486
496
487
497
enum EnumType {
0 commit comments