## RxJava 3 API

### Setting up with an Rxified router

To handle GraphQL requests on a Rxified `Route`, make sure to import the `GraphQLHandler` class.

### Working with Vert.x Rxified APIs

GraphQL-Java expects `CompletionStage` for asynchronous results in data fetchers and batch loaders.

Therefore, if you work with the Vert.x Rxified APIs (e.g. the Web Client or the Cassandra Client), you will have to adapt the `Single` and `Maybe` objects.

The `RxJavaJdk8Interop` library provides the tooling to do just that. Add the following to the dependencies section of your Maven build file:

    <dependency>
     <groupId>com.github.akarnokd</groupId>
     <artifactId>rxjava3-jdk8-interop</artifactId>
     <version>3.0.0-RC6</version>
    </dependency>

Or if you use Gradle:

    implementation 'com.github.akarnokd:rxjava3-jdk8-interop:3.0.0-RC6'

Then you can create a data fetcher from a `Single` result:

    Single<String> data = loadDataFromBackend();
    DataFetcher<CompletionStage<String>> fetcher = environment -> {
     return data.to(SingleInterop.get());
    };

For `Maybe` results, use `MaybeInterop`.