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

Generic parameter not resolved

Open Sam-Kruglov opened this issue 6 years ago • 1 comments

Got an error here https://github.com/graphql-java-kickstart/graphql-java-tools/blob/f0d03ea51d425967f9b8254cad4647e053f5ac17/src/main/kotlin/com/coxautodev/graphql/tools/GenericType.kt#L125

I have a type Account extends AuditableEntity<Long> where AuditableEntity<Long> extends IdentifiableAdapter<Long> where IdentifiableAdapter<Long> implements Identifiable<Long>. In this method determineTypeArguments returns a map or one entry: "T"(AuditableEntity) to Long. But then on this map [type] is used which returns null because the type is "T"(Identifiable).

This is kinda confusing but I am pretty sure this should just recognize the Long and return it.

I know I am not supposed to use raw JPA entities for mapping here and will just use DTOs and this will probably go away, but still looks like a bug though

Sam-Kruglov avatar Dec 31 '18 11:12 Sam-Kruglov

@Sam-Kruglov Is it possible to share a code snippet that could be used for a unit test to reproduce this bug so we have a concrete use case to fix it with?

oliemansm avatar Jan 10 '19 11:01 oliemansm