diff --git a/README.adoc b/README.adoc index b508d88..f6cfc07 100644 --- a/README.adoc +++ b/README.adoc @@ -326,5 +326,5 @@ This document covered: == See also -- https://www.graphql-java.com/documentation/v12/[The GraphQL-Java documentation] +- https://www.graphql-java.com/documentation/getting-started[The GraphQL-Java documentation] - https://vertx.io/docs/vertx-web-graphql/java/[The Vert.x Web GraphQL Handler documentation] diff --git a/build.gradle.kts b/build.gradle.kts index 022e7f0..5604975 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,7 +14,7 @@ java { } dependencies { - implementation(platform("io.vertx:vertx-stack-depchain:4.4.0")) + implementation(platform("io.vertx:vertx-stack-depchain:5.0.0.CR2")) implementation("io.vertx:vertx-web-graphql") } diff --git a/pom.xml b/pom.xml index 338d025..28cbda8 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 1.0-SNAPSHOT - 4.4.0 + 5.0.0.CR2 diff --git a/src/main/java/io/vertx/howtos/graphql/GraphQLVerticle.java b/src/main/java/io/vertx/howtos/graphql/GraphQLVerticle.java index 5db1357..7aef377 100644 --- a/src/main/java/io/vertx/howtos/graphql/GraphQLVerticle.java +++ b/src/main/java/io/vertx/howtos/graphql/GraphQLVerticle.java @@ -4,7 +4,8 @@ import graphql.schema.DataFetchingEnvironment; import graphql.schema.idl.SchemaGenerator; import graphql.schema.idl.SchemaParser; -import io.vertx.core.AbstractVerticle; +import io.vertx.core.Future; +import io.vertx.core.VerticleBase; import io.vertx.core.Vertx; import io.vertx.ext.web.Router; import io.vertx.ext.web.handler.BodyHandler; @@ -19,13 +20,13 @@ import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toMap; -public class GraphQLVerticle extends AbstractVerticle { +public class GraphQLVerticle extends VerticleBase { // tag::start[] private Map tasks; @Override - public void start() { + public Future start() { tasks = initData(); var graphQL = setupGraphQL(); @@ -35,7 +36,7 @@ public void start() { router.route().handler(BodyHandler.create()); // <2> router.route("/graphql").handler(graphQLHandler); // <3> - vertx.createHttpServer() + return vertx.createHttpServer() .requestHandler(router) .listen(8080); } @@ -94,13 +95,8 @@ private boolean complete(DataFetchingEnvironment env) { // tag::main[] public static void main(String[] args) { var vertx = Vertx.vertx(); // <1> - vertx.deployVerticle(new GraphQLVerticle()).onComplete(ar -> { // <2> - if (ar.succeeded()) { - System.out.println("Verticle deployed"); - } else { - ar.cause().printStackTrace(); - } - }); + vertx.deployVerticle(new GraphQLVerticle()).await(); // <2> + System.out.println("Verticle deployed"); } // end::main[] }