graphql-java-kickstart/graphql-java-tools

SchemaGeneratorHelperExt.kt split package incompatible with module system

zrbrown opened this issue · 1 comments

Description

graphql.schema.idl.SchemaGeneratorHelperExt.kt creates a split package graphql.schema.idl. When graphql-java-tools and graphql-java are both required modules in a Java application, it will not compile. The Java module system does not allow for split packages and it's a pretty hairy runtime flag combination to get around this (I still haven't gotten it to completely work).

#282 had a this issue with a different class. Looks like this is likely a nearly identical issue where the extension function is surfacing a protected method. The solution to the old issue was for graphql-java to make the method in question public - hopefully this can be fixed the same way?

Thanks!

Expected behavior

The application should compile.

Actual behavior

The application fails compilation with this error:

the unnamed module reads package graphql.schema.idl from both com.graphqljava and graphql.java.tools

Steps to reproduce the bug

  1. Create a simple Maven Java project that uses the latest graphql-java-tools (currently 11.1.1).
  2. Add a module descriptor to the project (src/main/java/module-info.java) that requires both graphql-java-tools and graphql-java, e.g.
module com.example.test {
    requires graphql.java.tools;
    requires com.graphqljava;
}
  1. Attempt to compile the project (I've just been trying to run it through Intellij)

Same problem. Any update?