Skip to content

Commit

Permalink
Switched priority of properties during merging (application.propertie…
Browse files Browse the repository at this point in the history
…s > annotation properties (in a bean))
  • Loading branch information
mskacelik authored and jmartisk committed Nov 7, 2024
1 parent ba24405 commit 1d5fee3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,12 @@ public void addTypesafeClientApis(List<Class<?>> apis) {
/**
* Scan the passed Java interface for `@GraphQLClientApi` annotations and create and register
* client configuration objects for it. This needs to be called by the runtime some time during initialization,
* before clients are actually created.
* before clients are actually created. Properties from the annotation will be overridden by {@code application.properties}.
*/
public void initTypesafeClientApi(Class<?> api) {
TypesafeClientConfigurationReader reader = new TypesafeClientConfigurationReader(api);
clients.merge(reader.getConfigKey(), reader.getClientConfiguration(), GraphQLClientConfiguration::merge);
clients.merge(reader.getConfigKey(), reader.getClientConfiguration(),
(graphQLClientConfiguration, fromAnnotations) -> fromAnnotations.merge(graphQLClientConfiguration));
}

public GraphQLClientConfiguration getClient(String key) {
Expand Down

0 comments on commit 1d5fee3

Please sign in to comment.