From 928058ff508044228d5b75074fbdeb18d78b77fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bresson?= Date: Mon, 4 Nov 2024 15:20:38 +0100 Subject: [PATCH] Update smallrye-graphql-client.adoc --- docs/src/main/asciidoc/smallrye-graphql-client.adoc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/src/main/asciidoc/smallrye-graphql-client.adoc b/docs/src/main/asciidoc/smallrye-graphql-client.adoc index c9928ffdec09e..44148b0e6a6fc 100644 --- a/docs/src/main/asciidoc/smallrye-graphql-client.adoc +++ b/docs/src/main/asciidoc/smallrye-graphql-client.adoc @@ -230,10 +230,18 @@ that the target of the client is the application that is being tested (typically This is useful if your application contains a GraphQL server-side API as well as a GraphQL client that is used for testing the API. +Be aware that the `endpoint` parameter in `@GraphQLClientApi` will win over the configuration in the `application.properties` file. + `star-wars-typesafe` is the name of the configured client instance, and corresponds to the `configKey` in the `@GraphQLClientApi` annotation. If you don't want to specify a custom name, you can leave out the `configKey`, and then refer to it by using the fully qualified name of the interface. +If you need to add an authorization header, or any other custom HTTP header (in our case +it's not required), this can be done with a configuration in the configuration file as well: +---- +quarkus.smallrye-graphql-client.star-wars-typesafe.header.HEADER-KEY=HEADER-VALUE +---- + Now that we have the client instance properly configured, we need a way to have it perform something when we start the application. For that, we will use a REST endpoint that, when called by a user, obtains the client instance and lets it execute the query.