Idea to have a feature flag to be able select Kotlin or Java models generation.
Kotlin data classes would be aweeeeeeeesome.
What about the idea to generate classes that implement Parcelable? There could be options for that as well. And @Parcelize annotation from Kotlin android extensions could be used to make it easy to implement.
If that possible, should have to implement both Parcelable and Serializable too, for Android Development, we need it to wrap data when parsing data with intent to new activity.
At the risk of starting an architecture flamewar - you shouldn't be sending full models through intents like that. I don't think that supporting that case should be a concern right now for getting initial kotlin code gen support
I agree that this feature is not a _must have_, but more _nice to have_. Obviously sending large objects via intents is not a good idea and it's better to just send an id and query for data in a new activity/fragment.
Although, sometimes you have a small object that you'd like to send and this can be handy.
I've never worked on a code-gen type of library so I don't know what the possibilities are. But if it'd be possible to just use Parcelable generation provided by Kotlin, all you have to do is annotate your classes with @Parcelize annotation. If not, and implementing that feature is a problem I definitely agree that it shouldn't be a concern.
Another idea - it'd be nice to have union types represented by sealed classes.
@sav007 I see you closed this issue but can you explain how we make it generate kotlin?
It's in the README
On Fri, Aug 2, 2019, 3:23 PM Adrian Devezin notifications@github.com
wrote:
@sav007 https://github.com/sav007 I see you closed this issue but can
you explain how we make it generate kotlin?—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/apollographql/apollo-android/issues/1079?email_source=notifications&email_token=AAKMJPWB4YXMHTOIKGSDKJDQCSCTDA5CNFSM4F3LYE6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3OUDOY#issuecomment-517816763,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAKMJPUP52S7VIB6CDKX5QTQCSCTDANCNFSM4F3LYE6A
.
Support for kotlin
// build.gradle or build.gradle.kts
apollo {
generateKotlinModels.set(true) // or false for Java models
}
Most helpful comment
At the risk of starting an architecture flamewar - you shouldn't be sending full models through intents like that. I don't think that supporting that case should be a concern right now for getting initial kotlin code gen support