Skip to content

Commit

Permalink
Merge pull request #45298 from gsmet/add-panache-sort-enums-to-index
Browse files Browse the repository at this point in the history
Add Panache Sort enums in index for SmallRye GraphQL
  • Loading branch information
jmartisk authored Jan 2, 2025
2 parents 15ffade + 1adf9bd commit a3b8a12
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -868,6 +868,18 @@ void registerGraphQLUiHandler(
}
}

@BuildStep
void indexPanacheClasses(BuildProducer<AdditionalIndexedClassesBuildItem> 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)) {
Expand Down

0 comments on commit a3b8a12

Please sign in to comment.