Skip to content

4. Known Issues

Balf edited this page May 5, 2024 · 1 revision

Known issues

Kotlin

For best compatibility, Kotlin 1.3.70 or later is needed with the compiler argument -Xemit-jvm-type-annotations. This instructs the Kotlin compiler to produce type-use annotations (introduced in JDK8) correctly. See KT-35843 and KT-13228 for details.

OpenJDK

There's a bug in OpenJDK's annotation parser before version 16 b17 that causes annotations on generic type parameters to be duplicated. You may experience this in a form of a mysterious

AnnotationFormatError: Duplicate annotation for class: interface io.leangen.graphql.annotations.GraphQLNonNull

being thrown when using @GraphQLNonNull both on a type and on its generic parameters e.g. @GraphQLNonNull List<@GraphQLNonNull Item>.

Fortunately, very few users seem to experience this problem, even on affected JDKs. Do note it is only relevant which Java compiles the sources, not which Java runs the code. Also note that IntelliJ IDEA comes bundled with a JDK of its own, so building the project in IDEA may lead to this error. You should configure your IDE to use the system Java if it is different.

Mutating the Schema using GraphQL Java's Schema Transformer

In some cases, specifically when used on a Union type or an underlying field/type of that Union, using GraphQL Java's SchemaTransformer will break type resolving of implementations of that Union type. See Issue #490 for more information. Please note that for most, if not all, usecases for a Visitor a GraphQL SPQR alternative is available.