Ever since I made my apollo schema module a KMP on...
# apollo-kotlin
s
Ever since I made my apollo schema module a KMP one, and moved the little code I noticed that my IDE no longer is able to resolve fields etc when I Cmd + B on them in my gql files. For reference, I link our setup to our schema here https://github.com/HedvigInsurance/android/blob/26e47ac09de88c6fc2dfd4aa6544c4930543b284/app/apollo/apollo-octopus-public/build.gradle.kts#L13-L14 And the schema itself now lives here under "commonMain" https://github.com/HedvigInsurance/android/blob/26e47ac09de88c6fc2dfd4aa6544c4930543b284/app/apollo/apollo-octopus-public/build.gradle.kts#L13-L14 Does the IDE plugin expect a different path somehow? Can I provide it with the correct path to start getting those smart features working again? When I look at settings: "Settings | Languages & Frameworks | GraphQL | Apollo Kotlin" I do not see any option for me to manually give it the path which is the last thing I tried in order to resolve this
b
No, it should "just work" πŸ˜… But maybe there's a bug. Are you using the plugin's snapshot version?
s
It looks like I am on plugin version: "4.3.1" AS info: Android Studio Narwhal Feature Drop | 2025.1.2 Canary 9 Build #AI-251.26094.121.2512.13760328, built on July 10, 2025
b
all right, well it should also work, but just to try something you could try the snapshot version (warning that it will ask you to disable the JetBrains GraphQL plugin)
If I can check out the project and be in a state where the Gradle sync succeeds, that would help me repro/figure out if there's an issue. (I know you helped me do that already in the past but it was a long time ago)
s
Perfect, trying "4.3.2-SNAPSHOT.2025-07-20.27a638d" soon.
(warning that it will ask you to disable the JetBrains GraphQL plugin)
So I do want to disable the Jetbrains GQL plugin in that case, right? If this does not work I will give you a repro just like last time, of course :)
πŸ‘ 1
b
So I do want to disable the Jetbrains GQL plugin in that case, right?
Yes you have to. Context: the Apollo plugin used to depend on the JB GraphQL one, but recently we've incorporated that code into ours to be more autonomous and unlock certain features. That means now these 2 plugins are both handling graphql files, and can't be enabled at the same time - so the IDE asks you to choose one πŸ™‚
s
Snapshot also seems to be broken unfortunately, and I am still not sure if it's something else I've done. The last time this worked was before I made that module KMP, so this is the only lead I am going off of. Please do try to clone latest "develop" branch from here https://github.com/HedvigInsurance/android and try to build it. I've fixed all the problems that existed back then with cloning and building. Or so I hope πŸ˜„ What you may need to do is go to: "Settings | Build, Execution, Deployment | Build Tools | Gradle" and change JDK location to "JAVA_HOME" so that doctor gradle plugin stops complaining πŸ˜„
πŸ‘€ 1
If you do end up having the time to clone it and try to sync, please just let me know if it also does not work for you too, even if you also don't know why that may be happening. At least then I will know it's not something I can fix for the time being πŸ˜„
b
Yes I could repro! Not sure what the issue is yet though. :πŸ‘€
thank you color 1
All right I think I've found the culprit and published a new snapshot. Let me know if that works! Note: it will take about ~1 minute the first time before it works (the plugin iterates over each module and execute a Gradle task, and you have a bunch πŸ™‚)
s
Wow interesting, was this something that was triggered from something we do differently from a typical project? I'll try the snapshot asap, ty so much for checking out my problem πŸ€—
b
I honestly have no idea... I wonder if there is a better API for this. It's to get the path of the root Gradle project (which for 99% of projects is the root of the IJ project, but might not). There's also a chance that there was a change in IJ itself that broke this πŸ˜…
s
I can confirm that "Version: `4.3.2-SNAPSHOT.2025-07-23.7a171f0`" does work as expected! Thanks a lot πŸ€—
πŸŽ‰ 1
b
Great to hear! Thanks for reporting!
🦜 1