Hey, I'm trying to register a
FederatedTypeResolver
in a Boot applications, but how ever I do it I can't get it to kick in. I wonder if I'm misunderstanding somehing - I have a simple schema like this
@KeyDirective(FieldSet("id"))
data class MySubThing(val id: Int?, val extraThing: String)
data class MyThing(@ExtendsDirective val id: String, val subThings: List<MySubThing>) {
}
, and register this resolver class as a bean:
class MySubThingResolver: FederatedTypeResolver<MySubThing> {
override suspend fun resolve(
environment: DataFetchingEnvironment,
representations: List<Map<String, Any>>
): List<MySubThing?> {
return representations.stream().map {
MySubThing(it["id"]?.toString()?.toInt(), "WOOOP")
}.collect(Collectors.toList())
}
But I can't get the resolver to be called however I try. What is the recommended way of registering resolvers for a schema in a Boot app?
(I have set the
graphql.federation.enabled
to
true
)