GraphQL Summit is back for three days of insights, hands-on learning, and fun to celebrate the GraphQL community. Join us in San Diego Oct 3-5.
Docs
Try Apollo Studio

Connecting source sets


By default, Apollo Kotlin adds the generated files to the main (for JVM/Android projects) or commonMain (for multiplatform projects) source sets.

If you only need them in a specific source set, you can use outputDirConnection to add them to a different source set.

For an example, you can add them to the "test" source set:

apollo {
outputDirConnection {
connectToKotlinSourceSet("test")
}
}

On Android, because the generated files are added to the main source set, they are available in all your build variants. If you need them available to only a specific build variant, you can do so with:

apollo {
outputDirConnection {
connectToAndroidSourceSet("demoDebug")
}
}
Edit on GitHub
Previous
Multi Modules
Next
Gradle plugin configuration