Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to GraphQL client user guide #17590

Merged
merged 1 commit into from
Jun 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.