Skip to content

Commit

Permalink
Merge pull request quarkusio#17590 from jmartisk/update-graphql-clien…
Browse files Browse the repository at this point in the history
…t-docs

Update to GraphQL client user guide
  • Loading branch information
gsmet authored Jun 2, 2021
2 parents 128988b + 7c1bf18 commit f1a96ed
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 the non-reactive RESTEasy stack (you can't mix reactive and non-reactive RESTEasy).
If you're only going to use the dynamic GraphQL client and don't use RESTEasy 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 f1a96ed

Please sign in to comment.