diff --git a/extensions/smallrye-graphql/deployment/src/main/java/io/quarkus/smallrye/graphql/deployment/SmallRyeGraphQLProcessor.java b/extensions/smallrye-graphql/deployment/src/main/java/io/quarkus/smallrye/graphql/deployment/SmallRyeGraphQLProcessor.java index f63ee7467a648..1c8d9373e90e9 100644 --- a/extensions/smallrye-graphql/deployment/src/main/java/io/quarkus/smallrye/graphql/deployment/SmallRyeGraphQLProcessor.java +++ b/extensions/smallrye-graphql/deployment/src/main/java/io/quarkus/smallrye/graphql/deployment/SmallRyeGraphQLProcessor.java @@ -1,7 +1,5 @@ package io.quarkus.smallrye.graphql.deployment; -import static io.smallrye.graphql.schema.helper.TypeAutoNameStrategy.valueOf; - import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; @@ -34,6 +32,7 @@ import io.quarkus.arc.deployment.BeanDefiningAnnotationBuildItem; import io.quarkus.arc.deployment.UnremovableBeanBuildItem; import io.quarkus.arc.processor.BuiltinScope; +import io.quarkus.bootstrap.classloading.QuarkusClassLoader; import io.quarkus.deployment.Capabilities; import io.quarkus.deployment.Capability; import io.quarkus.deployment.Feature; @@ -43,6 +42,7 @@ import io.quarkus.deployment.annotations.Consume; import io.quarkus.deployment.annotations.ExecutionTime; import io.quarkus.deployment.annotations.Record; +import io.quarkus.deployment.builditem.AdditionalIndexedClassesBuildItem; import io.quarkus.deployment.builditem.CombinedIndexBuildItem; import io.quarkus.deployment.builditem.FeatureBuildItem; import io.quarkus.deployment.builditem.HotDeploymentWatchedFileBuildItem; @@ -868,6 +868,18 @@ void registerGraphQLUiHandler( } } + @BuildStep + void indexPanacheClasses(BuildProducer additionalIndexedClasses) { + // so that they can be used in SmallRye GraphQL queries + if (QuarkusClassLoader.isClassPresentAtRuntime("io.quarkus.panache.common.Sort$Direction")) { + additionalIndexedClasses.produce(new AdditionalIndexedClassesBuildItem("io.quarkus.panache.common.Sort$Direction")); + } + if (QuarkusClassLoader.isClassPresentAtRuntime("io.quarkus.panache.common.Sort$NullPrecedence")) { + additionalIndexedClasses + .produce(new AdditionalIndexedClassesBuildItem("io.quarkus.panache.common.Sort$NullPrecedence")); + } + } + // In dev mode, when you click on the logo, you should go to Dev UI private String getLogoUrl(LaunchModeBuildItem launchMode, String devUIValue, String defaultValue) { if (launchMode.getLaunchMode().equals(LaunchMode.DEVELOPMENT)) {