https://kotlinlang.org logo
Title
a

annsofi

04/05/2022, 3:00 PM
Is there a cache somewhere for the schema and/or queries? I'm having a problem when switching from a branch that has new queries and types added to schema to one that doesn't contain them. I have
generateTestBuilders.set(true)
(though I tried turning that off, that didn't work either) and I keep on getting errors from a TestBuilder for the queries from my other branch, that the classes don't exist.
b

bod

04/05/2022, 3:06 PM
Hmm it could be a Gradle build cache issue? Do you have this on the command line as well or only in the IDE?
a

annsofi

04/05/2022, 3:07 PM
In both, after trying ./gradlew clean as well
Adding the missing queries and schema parts "fixes" the problem, though it's not a great fix 😄
b

bod

04/05/2022, 3:09 PM
haha yeah I can imagine! Weird! What about with
--no-build-cache
?
a

annsofi

04/05/2022, 3:14 PM
Same problem 😞
🤔 1
w

wasyl

04/05/2022, 3:20 PM
I had some caching issues unrelated to Apollo that were resolved by removing the
.gradle
directory in the project root directory and running a clean/build, maybe it'll help in your case too
m

mbonnin

04/05/2022, 3:24 PM
Running gradle with
-i
shows some useful information (sometimes a bit too much but each task is usually in bold making it easier to troubleshoot). In a case like this, after switching branches, I would expect
generateApolloServiceSource
to be re-run (i.e. not up-to-date) because some input graphql files were removed.
a

annsofi

04/05/2022, 6:56 PM
I think @wasyl wins the price (only honour, unfortunately) 🏆 I removed my gradle cache (and then I had to update my gradle version as well 🤷‍♀️), and now things work again. Thanks everyone for chipping in with suggestions!
🏆 3