是否可以使用Guice注入GraphQLResolvers的List(或Set)?
GraphQLResolver接口具有以下签名:
public interface GraphQLResolver<DataClass>
我正在使用Multibinder,我想我需要解析类型
GraphQLResolver<? extends DataClass>
所以我最终得到以下内容(在Kotlin中)
val resolverBinder = Multibinder.newSetBinder(binder(), GraphQLResolver::class.java)
resolverBinder.addBinding().to(BookResolver::class.java)
resolverBinder.addBinding().to(AuthorResolver::class.java)
我想要注入的类签名是沿着的
class SchemaLoaderImpl @Inject constructor(resolvers: Set<@JvmSuppressWildcards GraphQLResolver>