Skip to content

client_personalization

etienne-sf edited this page Jun 22, 2024 · 19 revisions

Client app personalization

This page explains how to change the default plugin behavior, and adapt it to your needs.

Use the plugin parameters

You can configure several things, from the pom.xml or build.gradle files.

You'll find all the available parameters on the plugin web site.

[Spring app] provide Spring beans

As explained on the Client Spring page, the GraphQL plugin defines an auto-configuration class, that provides default Spring beans. And the whole system is built as a Spring Boot app.

So, you can personalize the plugin behavior by:

  • Define the proper properties in the application.properties or application.yml spring configuration file
  • Define Spring bean, that can override:
    • the beans defined in the GraphQL plugin's auto-configuration class. Take a look at the Client Spring page for more information.
    • the beans defined by Sprint Boot. You'll find lots of documentation about this on the net.

Important note: if you're using the springBeanSuffix plugin parameter, then all the bean you define must be suffixed by the suffix defined in springBeanSuffix.

[Deprecated, only for 1.x versions] Use a preconfigured Jersey client

If you don't use the Spring app, you can use a preconfigured Jersey client instance to support customization of the rest request:

    public QueryExecutor(String graphqlEndpoint, Client client, ObjectMapper objectMapper)

Use your own code templates

The plugin generates the code, from a Velocity templates. You can override the provided templates.

Please take a look at the custom templates doc for all the details.

Clone this wiki locally