Skip to content

Commit

Permalink
Update to GraphQL client user guide
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartisk committed Jun 2, 2021
1 parent 93d334f commit 89e0e12
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions docs/src/main/asciidoc/smallrye-graphql-client.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,27 @@ mvn io.quarkus:quarkus-maven-plugin:{quarkus-version}:create \
-DprojectGroupId=org.acme \
-DprojectArtifactId=microprofile-graphql-client-quickstart \
-DclassName="org.acme.microprofile.graphql.client.StarWarsResource" \
-Dextensions="resteasy-reactive-jsonb,graphql-client"
-Dextensions="resteasy-reactive-jsonb,graphql-client,rest-client-reactive"
cd microprofile-graphql-client-quickstart
----

NOTE: The typesafe GraphQL client depends on REST client, thus we included the `rest-client-reactive` extension
in the `extensions` list. You may also switch to the traditional non-reactive `rest-client` if the rest of
your application depends on it (you can't have both at the same time). If you're only going to use the
dynamic GraphQL client and don't use REST client in your application, you may leave out the REST client dependency completely.

This command generates a Maven project, importing the `smallrye-graphql-client` extension.

If you already have your Quarkus project configured, you can add the `smallrye-graphql-client` extension
to your project by running the following command in your project base directory:

[source,bash]
----
./mvnw quarkus:add-extension -Dextensions="graphql-client"
./mvnw quarkus:add-extension -Dextensions="graphql-client,rest-client-reactive"
----

Again, you may leave out `rest-client-reactive` if you're only going to use the dynamic client.

This will add the following to your `pom.xml`:

[source,xml]
Expand All @@ -92,6 +99,10 @@ This will add the following to your `pom.xml`:
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-graphql-client</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client-reactive</artifactId>
</dependency>
----

== The application
Expand Down Expand Up @@ -350,4 +361,4 @@ formats it for better readability by humans, for example by piping the output th
== Conclusion

This example showed how to use both the dynamic and typesafe GraphQL clients to call an external
GraphQL service and explained the difference between the client types.
GraphQL service and explained the difference between the client types.

0 comments on commit 89e0e12

Please sign in to comment.