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

Android. Introspection in another module (not in :app) #6393

Open
SergeyKharuk opened this issue Feb 22, 2025 · 3 comments
Open

Android. Introspection in another module (not in :app) #6393

SergeyKharuk opened this issue Feb 22, 2025 · 3 comments

Comments

@SergeyKharuk
Copy link

SergeyKharuk commented Feb 22, 2025

Version

4.1.1

Summary

Hello.
I use a plugin for Android Studio "com.apollographql.apollo" version "4.1.1".
I would like to download schema and I would like to have schema.json file in :core:data module. But if I write
apollo { service("service") { packageName.set("core_data") schemaFile.set(file("src/main/java/com/app_name/data/graphql/schema.json")) introspection { endpointUrl.set("http:/some_url/v1/graphql") schemaFile.set(file("src/main/java/com/app_name/data/graphql/schema.json")) headers.set(mapOf(keyt" to "some_key")) }
in the build.gradle.kts of the :core:data module - it doesn't work.
After clicking: Tools -> Apollo -> Download schema - it says:
No download schema tasks were found. Please configure an introspection or registry in the Apollo Gradle configuration.
But if I write apollo configuration in build.gradle.kts of the :app module - it works.

Logs

No download schema tasks were found. Please configure an introspection or registry in the Apollo Gradle configuration.
@BoD
Copy link
Contributor

BoD commented Feb 22, 2025

Hi! Not sure why you're getting this, it should work. I made a simple project example here, can you have a look and compare with your project to see if there's any obvious differences?

@BoD BoD added the ⌛ Waiting for info More information is required label Feb 22, 2025
@SergeyKharuk
Copy link
Author

SergeyKharuk commented Feb 22, 2025

Thanks. I cloned your project - it works.
But after some exploring I decided to create "data2" module. But this time not in the root of the project but inside an additional folder (:core:data2).

Image

And it doesn't work again (the same error msg: No download schema tasks were found. Please configure an introspection or registry in the Apollo Gradle configuration)

@BoD Can you please try to create one more module as I did? (:core:data2)

@BoD
Copy link
Contributor

BoD commented Feb 22, 2025

Thanks a lot, I've reproduced the issue! This line should look for all modules recursively instead of only going 1 level deep.

In the meantime, to download your schema, you can do it manually on the command line with ./gradlew :core:data:downloadServiceApolloSchemaFromIntrospection

@BoD BoD self-assigned this Feb 22, 2025
@BoD BoD added 🧩 IJ/AS plugin and removed ⌛ Waiting for info More information is required labels Feb 22, 2025
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