-
Notifications
You must be signed in to change notification settings - Fork 173
Description
I noticed a possible bug in the implementation of the scanner. If you add a complex property (object/enum) to an interface only it does not get detected, because interfaces are not added to the scanning queue.
Here is an example:
interface Competition {
discipline: Discipline
}
type TestCompetition implements Competition {
test: String
}
enum Discipline {
TEST
}
extend type Query {
competitions() : [Competition]
}
Discipline is not used anywhere else. On startup i get this warning:
c.c.graphql.tools.SchemaClassScanner : Schema type was defined but can never be accessed, and can be safely deleted: Discipline
And later this error:
Caused by: com.coxautodev.graphql.tools.SchemaError: Expected type 'Discipline' to be a GraphQLOutputType, but it wasn't! Was a type only permitted for object types incorrectly used as an input type, or vice-versa?
I tracked this bug(?) down to this method: https://github.com/graphql-java/graphql-java-tools/blob/master/src/main/kotlin/com/coxautodev/graphql/tools/SchemaClassScanner.kt#L263
It is neither an ObjectType nor an InputType and thus nothing happens with the interface. Am i doing something wrong or is this indeed a bug?