Skip to content

Commit 9f0437a

Browse files
Robert Pospisiljmartisk
authored andcommitted
add config toggle
1 parent 795876a commit 9f0437a

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

extensions/smallrye-graphql/deployment/src/main/java/io/quarkus/smallrye/graphql/deployment/SmallRyeGraphQLProcessor.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,16 @@ void activateEventing(SmallRyeGraphQLConfig graphQLConfig, BuildProducer<SystemP
652652
}
653653
}
654654

655+
@BuildStep
656+
void activateFederationBatchResolving(SmallRyeGraphQLConfig graphQLConfig,
657+
BuildProducer<SystemPropertyBuildItem> systemProperties) {
658+
if (graphQLConfig.federationBatchResolvingEnabled.isPresent()) {
659+
String value = graphQLConfig.federationBatchResolvingEnabled.get().toString();
660+
systemProperties.produce(new SystemPropertyBuildItem(ConfigKey.ENABLE_FEDERATION_BATCH_RESOLVING, value));
661+
System.setProperty(ConfigKey.ENABLE_FEDERATION_BATCH_RESOLVING, value);
662+
}
663+
}
664+
655665
/*
656666
* Decides whether we want to activate GraphQL federation and updates system properties accordingly.
657667
* If quarkus.smallrye-graphql.federation.enabled is unspecified, enable federation automatically if we see

extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLConfig.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ public class SmallRyeGraphQLConfig {
2727
@ConfigItem(name = "federation.enabled")
2828
public Optional<Boolean> federationEnabled;
2929

30+
/**
31+
* Enable batch resolving for federation. Disabled by default.
32+
*/
33+
@ConfigItem(name = "federation.batch-resolving-enabled")
34+
public Optional<Boolean> federationBatchResolvingEnabled;
35+
3036
/**
3137
* Enable metrics. By default, this is false. If set to true, a metrics extension is required.
3238
*/

0 commit comments

Comments
 (0)