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), you will have to adapt the Single
and Maybe
objects.
DataFetcher<CompletionStage<String>> fetcher = environment -> {
Single<String> data = loadDataFromBackend();
return data.toCompletionStage();
};
Instead of converting First, declare the instrumentations while configuring GraphQL-Java.
Then you can return
|