Skip to content
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

Embed GraphQL metadata in the jar/klib #5960

Open
Tracked by #6324
martinbonnin opened this issue Jun 12, 2024 · 1 comment
Open
Tracked by #6324

Embed GraphQL metadata in the jar/klib #5960

martinbonnin opened this issue Jun 12, 2024 · 1 comment

Comments

@martinbonnin
Copy link
Contributor

martinbonnin commented Jun 12, 2024

Use case

As of today, we use a separate file to store GraphQL metadata used by the apollo compiler. This means in multi-module scenarios, one typically has to do something like so:

dependencies {
  implementation(project(":schema"))
}

apollo {
  service("service") {
    dependsOn(project(":schema"))
  }
}

While working, this setup is a bit cumbersome and error prone. It's possible to forget one of the two dependencies.

Instead, we could embed the required GraphQL information in the .jar/.klib file so that the apollo compiler doesn't have to pull an additional artifact.

See #6325
See https://youtrack.jetbrains.com/issue/KT-58830

@martinbonnin
Copy link
Contributor Author

martinbonnin commented Dec 13, 2024

Note: if we're going that road, we might not be able to share the same codegen task between different targets/variants anymore.

KMP has targets and Android have variants. Each target/variant has its own "compileClasspath" that may be different so we'd need to create N schema, Ir, codegen, etc... tasks. That's going to blow up the number of codegen tasks quite a lot. Maybe not an issue but it's added complexity.

Or maybe we can find a "common" "compileClasspath" that we could reuse. This will need to be user-configurable.

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

No branches or pull requests

2 participants