apollographql / apollo-kotlin

:rocket:  A strongly-typed, caching GraphQL client for the JVM, Android, and Kotlin multiplatform.
https://www.apollographql.com/docs/kotlin
MIT License
3.76k stars 653 forks source link

[Umbrella issue] Better Java support in Apollo Kotlin #4283

Closed martinbonnin closed 1 year ago

martinbonnin commented 2 years ago

Apollo Kotlin 3 is focused at Kotlin and the changes to make it easier to consume in Kotlin had some unfortunate side effects for Java consumers. This issue is a place to list all the changes required to make it easier to consume Apollo Kotlin from Java projects.

The plan is to decouple Apollo Java so that it’s built on top of apollo-apibut can evolve separate from Apollo Kotlin. In particular, Apollo Java will go through an alpha-beta-release phase.

Current plan:

alpha.1

beta.1

jpvajda commented 2 years ago

@martinbonnin 👋 This seems like a good candidate for a 3.7 release, I went ahead and added all the issues to that release. I know you mentioned you had some more work to break down. Just let me know if this is the right release to target this in, as it's our next release.

martinbonnin commented 2 years ago

We'll need certainly need a round of alpha/beta/rc releases on the Java Runtime. The API surface is huge and while we know where we're going (it's a translation of the Kotlin runtime, features are known already), fine tuning the APIs and getting community feedback will take time.

A good initial could be to ship a apollo-runtime-java artifact that allows to do a minimal query. Then we can build on top of it until it is feature complete:

jpvajda commented 2 years ago

👋 Anyone who'd like to participate in a survey to help us better understand the need for better Java Support can find that survey here: https://github.com/apollographql/apollo-kotlin/issues/4501

bignimbus commented 1 year ago

Copypasta from a related issue:

We think that our experimental Java support is feature-complete for the 4.0.0 release, the remaining tasks have not yet been prioritized. We'll keep them open but in the interest of keeping our task list clean we'll close this umbrella Issue.

aarmistead-chwy commented 6 months ago

Is there a way to generate getter methods now? currently having to drop back from doing something like .map(ApolloResponse::errors) to .map(r -> r.errors)

BoD commented 6 months ago

@aarmistead-chwy Sorry for the late reply - there is no option to generate getters. We do have an example to achieve this via a compiler plugin (in v4), here.