You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/advanced/java.mdx
+46-18Lines changed: 46 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,33 +16,61 @@ apollo {
16
16
}
17
17
```
18
18
19
-
## Build the client
19
+
## The Java runtime
20
20
21
-
This snippet demonstrates initializing an `ApolloClient` instance in Java:
21
+
The default runtime for Apollo Kotlin, `apollo-runtime`, exposes a coroutines / Flow-based API that isn't well suited to be consumed from Java.
22
+
That is why a specific runtime, `apollo-runtime-java` is available to use Apollo Kotlin from Java. To use it, add a dependency on this runtime instead of the default one:
23
+
24
+
```kotlin title="build.gradle[.kts]"
25
+
dependencies {
26
+
// ...
27
+
28
+
// Use apollo-runtime-java instead of apollo-runtime
Apollo Kotlin has a coroutines / Flow-based API that isn't well suited to using with Java. To achieve a similar effect, you can use Apollo's [RxJava extensions](./rxjava/).
76
+
If your project uses RxJava, you can use Apollo's [RxJava extensions](./rxjava/) with the Java runtime.
Copy file name to clipboardExpand all lines: docs/source/advanced/rxjava.mdx
+26-7Lines changed: 26 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,23 @@
2
2
title: RxJava support
3
3
---
4
4
5
-
If you're using Apollo Kotlin in a [Java project](java) or a Kotlin project that uses RxJava, you can use Apollo's RxJava extensions.
5
+
If you're using Apollo Kotlin in a [Java project](java) or Kotlin project that uses RxJava, you can use Apollo's RxJava extensions.
6
6
7
-
To do so, add the `apollo-rx2-support` or `apollo-rx3-support` dependency to your project:
7
+
To do so, add the `apollo-rx2-support-java` / `apollo-rx3-support-java` (Java) or `apollo-rx2-support` / `apollo-rx3-support` (Kotlin) dependency to your project:
0 commit comments