graphql-java-tools icon indicating copy to clipboard operation
graphql-java-tools copied to clipboard

Generic DataClass in Resolver

Open Starkom opened this issue 6 years ago • 2 comments

I want to have some kind of TestResolver implements GraphQLResolver<TestDataClass<MyType>> but result of code above is throw ResolverError("Unable to determine data class for resolver '${resolverType.name}' from generic interface! This is most likely a bug with graphql-java-tools.") because TypeUtils.determineTypeArguments() returns ParameterizedType instead of Class

Starkom avatar Sep 10 '19 08:09 Starkom

If I use TestResolver implements GraphQLResolver<TestDataClass>, it isn't linked with TestQuery implements GraphQLQueryResolver { public TestDataClass<MyType> get(String id, DataFetchingEnvironment) {...} }

because TestDataClass andTestDataClass<MyType>aren't the same.

Starkom avatar Sep 10 '19 08:09 Starkom

What is a correct way to achieve this?

Starkom avatar Sep 10 '19 09:09 Starkom