GraphQl and spring boot.
Graph ql schema
type Query {
animal(id: ID!): Animal!
}
interface Animal{
id: ID
name: String
}
type Cat implements Animal {
id: ID
name: String
}
type Dog implements Animal {
id: ID
name: String
}
fun animal(id: String): CompletableFuture<Any> {
return service.getAnimal(id).toFuture();
}
Error:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'schemaParser' defined in class path resource [graphql/kickstart/tools/boot/GraphQLJavaToolsAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.coxautodev.graphql.tools.SchemaParser]: Factory method 'schemaParser' threw exception; nested exception is com.coxautodev.graphql.tools.SchemaClassScannerError: Object type 'Cat' implements a known interface, but no class could be found for that type name. Please pass a class for type 'Cat' in the parser's dictionary.