Skip to content

SchemaGeneratorHelperExt.kt split package incompatible with module system #577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zrbrown opened this issue Sep 3, 2021 · 1 comment · Fixed by #612
Closed

SchemaGeneratorHelperExt.kt split package incompatible with module system #577

zrbrown opened this issue Sep 3, 2021 · 1 comment · Fixed by #612
Assignees
Labels

Comments

@zrbrown
Copy link

zrbrown commented Sep 3, 2021

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)
@zrbrown zrbrown added the bug label Sep 3, 2021
@UkonnRa
Copy link

UkonnRa commented Oct 20, 2021

Same problem. Any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants