From 8c4375eb22a2f5b1fce6a63efe268574c0fbeba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bresson?= Date: Mon, 15 Apr 2024 14:50:27 +0200 Subject: [PATCH] docs: mention logging in smallrye-graphql-client --- docs/src/main/asciidoc/smallrye-graphql-client.adoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/src/main/asciidoc/smallrye-graphql-client.adoc b/docs/src/main/asciidoc/smallrye-graphql-client.adoc index de25e13e8ff09..4aa0a118e0d6b 100644 --- a/docs/src/main/asciidoc/smallrye-graphql-client.adoc +++ b/docs/src/main/asciidoc/smallrye-graphql-client.adoc @@ -200,6 +200,7 @@ public class Planet { Now that we have the model classes, we can create the interface that represents the actual set of operations we want to call on the remote GraphQL service. +[source,java] ---- @GraphQLClientApi(configKey = "star-wars-typesafe") public interface StarWarsClientApi { @@ -256,6 +257,18 @@ With this REST endpoint included in your application, you can simply send a GET and the application will use an injected typesafe client instance to call the remote service, obtain the films and planets, and return the JSON representation of the resulting list. +=== Logging + +For debugging purpose, it is possible to log the request generated by the typesafe client and the response sent back by the server by changing the log level of the `io.smallrye.graphql.client` category to `TRACE` (see the xref:logging.adoc#configure-the-log-level-category-and-format[Logging guide] for more details about how to configure logging). + +This can be achieved by adding the following lines to the `application.properties`: + +[source,properties] +---- +quarkus.log.category."io.smallrye.graphql.client".level=TRACE +quarkus.log.category."io.smallrye.graphql.client".min-level=TRACE +---- + == Using the Dynamic client For the dynamic client, the model classes are optional, because we can work with abstract