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

Explain how logging can be configured in the smallrye-graphql-client guide #40073

Merged
merged 1 commit into from
Apr 16, 2024
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
13 changes: 13 additions & 0 deletions docs/src/main/asciidoc/smallrye-graphql-client.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
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 {
Expand Down Expand Up @@ -256,7 +257,19 @@
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).

Check warning on line 262 in docs/src/main/asciidoc/smallrye-graphql-client.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.SentenceLength] Try to keep sentences to an average of 32 words or fewer. Raw Output: {"message": "[Quarkus.SentenceLength] Try to keep sentences to an average of 32 words or fewer.", "location": {"path": "docs/src/main/asciidoc/smallrye-graphql-client.adoc", "range": {"start": {"line": 262, "column": 1}}}, "severity": "INFO"}

Check warning on line 262 in docs/src/main/asciidoc/smallrye-graphql-client.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Spelling] Use correct American English spelling. Did you really mean 'typesafe'? Raw Output: {"message": "[Quarkus.Spelling] Use correct American English spelling. Did you really mean 'typesafe'?", "location": {"path": "docs/src/main/asciidoc/smallrye-graphql-client.adoc", "range": {"start": {"line": 262, "column": 75}}}, "severity": "WARNING"}

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

Check warning on line 272 in docs/src/main/asciidoc/smallrye-graphql-client.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Headings] Use sentence-style capitalization in 'Using the Dynamic client'. Raw Output: {"message": "[Quarkus.Headings] Use sentence-style capitalization in 'Using the Dynamic client'.", "location": {"path": "docs/src/main/asciidoc/smallrye-graphql-client.adoc", "range": {"start": {"line": 272, "column": 4}}}, "severity": "INFO"}

For the dynamic client, the model classes are optional, because we can work with abstract
representations of the GraphQL types and documents. The client API interface is not needed at all.
Expand Down
Loading