https://kotlinlang.org logo
#apollo-kotlin
Title
# apollo-kotlin
j

jmfayard

08/10/2022, 5:15 PM
Bonjour, I'm trying out
apollo-kotliin
for the first time Following the tutorial works fine. until this step, any idea what I'm doing that's stupid? https://github.com/jmfayard/my-kotlin-scipts/commit/424c8222458f9bf320e76eab84479e0a1397e7e9 (edited)
1
m

mbonnin

08/10/2022, 5:19 PM
Works for me, I get a file generated in
Copy code
build/generated/source/apollo/service/github/graphql/RateLimitQuery.kt
j

jmfayard

08/10/2022, 5:20 PM
ahhh I didn't realize this was inside
build/generated
thanks 🙂
m

mbonnin

08/10/2022, 5:21 PM
Sure thing!
Ultimately would be nice to have a plugin that generates them on the fly, like SQLDelight does
(but that won't change the fact that it's in
build/generated
. I think we want to keep this so that it's clearly outside version control)
j

jmfayard

08/10/2022, 7:08 PM
I think it's fine, maybe just add:
println("apollo: updating Kotlin code in build/generated/source/apollo/service")
y

Yang

08/15/2022, 9:50 AM
@mbonnin I'm curious if it's possible to hook into one of the tasks in idea Gradle plugin to make the task run on the fly?
m

mbonnin

08/15/2022, 10:54 AM
@Yang we've been wanting to do that for a while now. There's a lot we can do in terms of IDE integration. On the fly codegen sounds like a good first feature
We'll have to see how it performs. We certainly don't want to rerun codegen on every keystroke 😅
y

Yang

08/15/2022, 1:25 PM
I sort of want something similar to how the R classes are generated in AS, do you know if they have some help from Studio or is it something that can be achieved with Gradle alone?
m

mbonnin

08/15/2022, 2:27 PM
I haven't looked at the R classes specifically but I believe there has to be some integration with AS/IntelliJ as Gradle isn't running when you're typing code
SQLDelight has some live codegen we could take inspiration from
4 Views