Somewhat related to the message above. I've been j...
# apollo-kotlin
s
Somewhat related to the message above. I've been just using the latest snapshot of the IDE plugin as a consequence of trying to work around the issue above. However now when using 4.3.2-SNAPSHOT.2025-07-27.7a171f0 all of my GQL files are basically red. I of course don't expect every snapshot build to be perfect, but would you say that it's expected that snapshot builds don't necessarily always work, since you may be in the middle of fixing between days or stuff like that? I can just revert to not using the snapshots and wait for the real release of the fix of the bug above if so, it would not be a problem for me. Just asking to know what the expectations are from the snapshot builds.
b
Sorry about that - no, it should work as far as I know πŸ™‚ What do you see in the GraphQL tool window?
s
Do you perhaps mean in this window down here?
b
yes exactly - that almost looks good, except "6 types"... that doesn't seem right, your schema has more than 6 types
s
That is indeed true πŸ˜„
b
can you try a Gradle sync
loading 1
(I have your project open here and no red 😬)
s
Yeah same result. Oh really? Okay I will try to disable and enable the plugin πŸ‘€
b
maybe wait a bit for the gradle tasks to be executed... sorry there's no indicator for them though... except monitoring the AS logs
oh wait a minute, it may work on my end because of a cache - I do see issues in the logs
Gradle doctor complaining about
JAVA_HOME
(you warned about that).
s
Yeah, if you can do this, it works.
If you don't have JAVA_HOME setup, I don't know ngl πŸ˜…
b
I do have a JAVA_HOME though πŸ€”
do you see any exceptions in the AS logs? (Help | Show Logs in Finder)
s
I do see this at one point:
Copy code
2025-07-29 14:51:34,914 [ 126559]   WARN - Apollo - Could not instantiate KotlinFindUsagesHandlerFactory
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(Unknown Source)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source)
	at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
	at com.apollographql.ijplugin.navigation.compat.KotlinFindUsagesHandlerFactoryCompat.<init>(KotlinFindUsagesHandlerFactoryCompat.kt:26)
	at com.apollographql.ijplugin.inspection.ApolloUnusedOperationInspectionKt.isUnusedOperation(ApolloUnusedOperationInspection.kt:41)
	at com.apollographql.ijplugin.inspection.ApolloUnusedFieldInspection$buildVisitor$1.visitIdentifier(ApolloUnusedFieldInspection.kt:47)
	at com.intellij.lang.jsgraphql.psi.impl.GraphQLIdentifierImpl.accept(GraphQLIdentifierImpl.java:20)
	at com.intellij.lang.jsgraphql.psi.impl.GraphQLIdentifierImpl.accept(GraphQLIdentifierImpl.java:25)
	at com.intellij.codeInsight.daemon.impl.InspectionRunner$InspectionProblemHolder.visitElement(InspectionRunner.java:587)
	at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processContext$19(InspectionRunner.java:414)
	at com.intellij.codeInsight.daemon.impl.InspectionVisitorOptimizer.acceptElements(InspectionVisitorOptimizer.java:207)
	at com.intellij.codeInsight.daemon.impl.InspectionRunner.processContext(InspectionRunner.java:412)
	at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$inspect$7(InspectionRunner.java:179)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction$lambda$11(AnyThreadWriteThreadingSupport.kt:522)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWithTemporaryThreadLocal(AnyThreadWriteThreadingSupport.kt:204)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:522)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1064)
	at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$executeInImpatientReadAction$16(InspectionRunner.java:393)
	at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:158)
	at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:150)
	at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$executeInImpatientReadAction$17(InspectionRunner.java:384)
	at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:129)
	at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:118)
	at com.intellij.codeInsight.daemon.impl.InspectionRunner.executeInImpatientReadAction(InspectionRunner.java:384)
	at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$inspect$8(InspectionRunner.java:173)
	at com.intellij.concurrency.ApplierCompleter.processArrayItem(ApplierCompleter.java:121)
	at com.intellij.concurrency.ApplierCompleter.processArray(ApplierCompleter.java:205)
	at com.intellij.concurrency.ApplierCompleter.helpOthers(ApplierCompleter.java:225)
	at com.intellij.concurrency.ApplierCompleter.helpAll(ApplierCompleter.java:183)
	at com.intellij.concurrency.ApplierCompleter.lambda$exec$0(ApplierCompleter.java:111)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction$lambda$11(AnyThreadWriteThreadingSupport.kt:522)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWithTemporaryThreadLocal(AnyThreadWriteThreadingSupport.kt:204)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:522)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1064)
	at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$2(ApplierCompleter.java:153)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$14(CoreProgressManager.java:680)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:755)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:711)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:77)
	at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:164)
	at com.intellij.concurrency.ApplierCompleter.lambda$wrapAndRun$1(ApplierCompleter.java:145)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:197)
	at com.intellij.concurrency.ApplierCompleter.wrapAndRun(ApplierCompleter.java:145)
	at com.intellij.concurrency.ApplierCompleter.exec(ApplierCompleter.java:113)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
Caused by: com.intellij.openapi.progress.ProcessCanceledException
	at com.intellij.openapi.progress.util.AbstractProgressIndicatorBase.throwIfCanceled(AbstractProgressIndicatorBase.java:174)
	at com.intellij.openapi.progress.util.AbstractProgressIndicatorBase.checkCanceled(AbstractProgressIndicatorBase.java:164)
	at com.intellij.codeInsight.daemon.impl.DaemonProgressIndicator.checkCanceled(DaemonProgressIndicator.java:118)
	at com.intellij.openapi.progress.util.ProgressWrapper.checkCanceled(ProgressWrapper.java:84)
	at com.intellij.openapi.progress.impl.CoreProgressManager.doCheckCanceled(CoreProgressManager.java:173)
	at com.intellij.openapi.progress.ProgressManager.checkCanceled(ProgressManager.java:336)
	at com.intellij.openapi.vfs.CompactVirtualFileSet$2.findNext(CompactVirtualFileSet.java:373)
	at com.intellij.openapi.vfs.CompactVirtualFileSet$2.hasNext(CompactVirtualFileSet.java:365)
	at java.base/java.util.AbstractSet.hashCode(Unknown Source)
	at com.intellij.psi.search.AbstractFilesScope.calcHashCode(AbstractFilesScope.java:57)
	at com.intellij.psi.search.SearchScope.hashCode(SearchScope.java:34)
	at java.base/java.util.HashMap.hash(Unknown Source)
	at java.base/java.util.HashMap.put(Unknown Source)
	at java.base/java.util.HashSet.add(Unknown Source)
	at com.intellij.util.containers.ContainerUtil.addIfNotNull(ContainerUtil.java:2752)
	at com.intellij.psi.search.PredefinedSearchScopeProviderImpl$ScopeCollectionContext$Companion.addRecentlyModifiedFilesScope(PredefinedSearchScopeProviderImpl.kt:280)
	at com.intellij.psi.search.PredefinedSearchScopeProviderImpl$ScopeCollectionContext$Companion.addCommonScopes(PredefinedSearchScopeProviderImpl.kt:224)
	at com.intellij.psi.search.PredefinedSearchScopeProviderImpl$ScopeCollectionContext$Companion.collectContext(PredefinedSearchScopeProviderImpl.kt:196)
	at com.intellij.psi.search.PredefinedSearchScopeProviderImpl.getPredefinedScopes(PredefinedSearchScopeProviderImpl.kt:62)
	at com.intellij.find.findUsages.FindUsagesOptions.findScopeByName(FindUsagesOptions.java:43)
	at com.intellij.find.findUsages.FindUsagesOptions.<init>(FindUsagesOptions.java:32)
	at com.intellij.find.findUsages.FindUsagesOptions.<init>(FindUsagesOptions.java:28)
	at com.intellij.find.findUsages.PersistentFindUsagesOptions.<init>(PersistentFindUsagesOptions.java:13)
	at com.intellij.find.findUsages.JavaFindUsagesOptions.<init>(JavaFindUsagesOptions.java:21)
	at com.intellij.find.findUsages.JavaVariableFindUsagesOptions.<init>(JavaVariableFindUsagesOptions.java:31)
	at com.intellij.find.findUsages.JavaFindUsagesHandlerFactory.<init>(JavaFindUsagesHandlerFactory.java:29)
	at org.jetbrains.kotlin.idea.base.searching.usages.KotlinFindUsagesHandlerFactory.<init>(KotlinFindUsagesHandlerFactory.kt:22)
b
not cool - but probably unrelated
s
I do have a JAVA_HOME though
And is it setup in your IDE settings for that project like the picture shows? Otherwise you can also try to remove the doctor plugin completley tbh. Maybe I should do it, I was not the one who set it up, and I legit don't know what that does besides complain about JAVA_HOME :D
b
yes it shows in the IDE settings - but good idea I'll remove it to see if I can repro
s
Sorry about the inconvenience. One day our repo will truly be ready to do "clone -> build". One day πŸ˜…
b
no worry at all. Your project is already infinitely more useful to repro issues than most πŸ™‚
Yeah it took a few minutes but it worked here.
can you add
Apollo
in Help | Diagnostic Tools | Debug Log settings, and do a sync again and see if you see a bunch of
Fetch tooling model for
lines in the logs.
s
And to confirm, I should be looking into idea.log, correct? From: "Help | Show log in finder" Not getting any hits for "Fetch tooling model for"
So you are saying that this works for you on my project, correct?
b
> And to confirm, I should be looking into idea.log, correct? βœ… > Not getting any hits for "Fetch tooling model for" 😞 That's after adding
Apollo
to the log settings and re-sync, right? > So you are saying that this works for you on my project, correct? βœ…
s
Yes like this, does this look correct?
Also double checking. I am on plugin
4.3.2-SNAPSHOT.2025-07-27.7a171f0
, and on:
Copy code
Android Studio Narwhal Feature Drop | 2025.1.2 Canary 9
Build #AI-251.26094.121.2512.13760328, built on July 10, 2025
If all looks good on your end, I will just attribute this to dark magic, and wait for my IDE to remember what it's like to work properly πŸ˜„
b
Setting and Plugin version βœ… AS Version: I'm trying with the latest stable. Let me try with the Canary πŸ™‚
Looks like it's working for me with the latest Canary too
mysterious
s
Yeah nevermind then. It must be something on my end. If it doesn't resolve itself eventually I will try to nuke whatever caches or whatever I find πŸ˜„ Thanks a lot for the support!
b
Sure thing. Yeah let me know if this persists.
s
Interestingly, I encountered this once again now (or maybe it was always there, I am back from vacation, I don't know πŸ˜…) and things were still red/broken on my normal project. I did however clone my own project again, just to recreate what you saw when we were debugging this, and the plugin did in fact work as intended on the fresh clone. So I wonder, is there some sort of plugin-specific cache that lives somewhere in my files which I can nuke to see if this will make it work for my normal clone of the repository too? Or should I declare clone bankruptcy and just start using the new and shiny new clone, free of such baggage πŸ˜…
b
πŸ‘‹ I was also in vacation πŸ˜… Interesting! We do have the result of the project's inspection cached into
.idea/workspace.xml
to have the plugin working quickly when opening a project. If you see
<component name="com.apollographql.ijplugin.settings.ProjectSettingsState">
inside it, that's it. But I can't think of a reason why it would interfere with re-fetching the project's configuration, even if that data is invalid. But it doesn't hurt to try to remove that from the file, and re-open that project, see if that fixes it, if you're motivated. (You should do it while this project isn't open though, because usually this file is written when closing the project so your changes would be canceled).
s
πŸ‘‹ Welcome back to you too then! πŸ˜„ Good news, deleting that file (after closing the project) and just re-opening the project made everything work again. Noting was red anymore, and navigating through the gql files just seemed to work immediately. That's quite curious. I will DM you the workspace xml file itself in case it is in any way useful to see what was locking things up
b
Thanks a lot! I had a look and didn't see anything suspicious either, but that's useful to know that deleting the file resolved it. I have to make more tests about upgrading from older versions of the plugin to the new ones - I haven't tried it too much, maybe some issues are creeping there.
thank you color 1