fansopk.blogg.se

Kotlin
Kotlin











kotlin

A journey to Kotlin multiplatform: how the project was moved to Kotlin multiplatform, talk given at Kotliners in June 2020.If you're using Absinthe Phoenix subscriptions, kotlin-phoenix has a PhoenixNetworkTransport that you can use together with ApolloClient ( doc).

kotlin

If you're using the Maven build tool, is a Maven plugin that calls the Apollo Android compiler to generate your Java/Kotlin sources.If you'd like to contribute, please see Contributing.md. The plugin is additionally hosted on the Gradle Plugin PortalĪnd then use the 3.8.1-SNAPSHOT version for the plugin and libraries. ReleasesĬheck the changelog for the release history. Make sure you check "Apollo Kotlin" in the plugin's settings, so directives such as and typePolicy are recognized. graphqlconfig file to use GraphQL scratch files to work with your schema outside product code (such as to write temporary queries to test resolvers). The JS Graphql IntelliJ Plugin provides auto-completion, error highlighting, and go-to-definition functionality for your. JDK 8+ (JDK 11+ when using Android Gradle Plugin 7.0+)Īs the code generated by Apollo Kotlin doesn't use any reflection, it can safely be optimized / obfuscated by Proguard or R8, so no particular exclusions need to be configured.Android API level 21+ ( apollo-http-cache and apollo-adapters require enabling core library desugaring on Android API levels Some platforms have specific requirements: To learn more about other Apollo Kotlin APIs: Here's the current matrix of supported features per platform: Java and Kotlin Multiplatform code generationĪpollo Kotlin is a Kotlin Multiplatform project.This library is designed primarily with Android in mind, but you can use it in any Java/Kotlin app, including multiplatform. If you don't ask for a particular field in a query, you can't access the corresponding property on the returned data structure. You also don't have to write model types yourself, because these are generated from the GraphQL definitions your UI uses.īecause generated types are query-specific, you can only access data that you actually specify as part of a query. This means you don't have to deal with parsing JSON, or passing around Maps and making clients cast values to the right type manually. You can also view the 2.x docs.Īpollo Kotlin (formerly Apollo Android) is a GraphQL client that generates Kotlin and Java models from GraphQL queries.Īpollo Kotlin executes queries and mutations against a GraphQL server and returns results as query-specific Kotlin types. If you're using Apollo Android 2.x, see the migration guide. 📣 Apollo Kotlin 3 is generally available.













Kotlin