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 e7faee4870a91..e7c02241029a9 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 @@ -25,6 +25,7 @@ import io.quarkus.arc.deployment.BeanContainerBuildItem; import io.quarkus.arc.deployment.BeanDefiningAnnotationBuildItem; import io.quarkus.arc.deployment.UnremovableBeanBuildItem; +import io.quarkus.arc.processor.BuiltinScope; import io.quarkus.deployment.Capabilities; import io.quarkus.deployment.Capability; import io.quarkus.deployment.Feature; @@ -138,8 +139,9 @@ List brandingFiles() { @BuildStep void additionalBeanDefiningAnnotation(BuildProducer beanDefiningAnnotationProducer) { - // Make ArC discover the beans marked with the @GraphQlApi qualifier - beanDefiningAnnotationProducer.produce(new BeanDefiningAnnotationBuildItem(Annotations.GRAPHQL_API)); + // Make ArC discover the beans marked with the @GraphQLApi qualifier + beanDefiningAnnotationProducer + .produce(new BeanDefiningAnnotationBuildItem(Annotations.GRAPHQL_API, BuiltinScope.SINGLETON.getName())); } @BuildStep diff --git a/extensions/smallrye-graphql/deployment/src/test/java/io/quarkus/smallrye/graphql/deployment/ErrorTest.java b/extensions/smallrye-graphql/deployment/src/test/java/io/quarkus/smallrye/graphql/deployment/ErrorTest.java index 2b86563923544..e40601988826f 100644 --- a/extensions/smallrye-graphql/deployment/src/test/java/io/quarkus/smallrye/graphql/deployment/ErrorTest.java +++ b/extensions/smallrye-graphql/deployment/src/test/java/io/quarkus/smallrye/graphql/deployment/ErrorTest.java @@ -1,7 +1,5 @@ package io.quarkus.smallrye.graphql.deployment; -import javax.enterprise.context.ApplicationScoped; - import org.eclipse.microprofile.graphql.GraphQLApi; import org.eclipse.microprofile.graphql.Query; import org.jboss.shrinkwrap.api.asset.EmptyAsset; @@ -64,7 +62,6 @@ public void setMessage(String message) { } @GraphQLApi - @ApplicationScoped public static class ErrorApi { @Query diff --git a/extensions/smallrye-graphql/deployment/src/test/java/io/quarkus/smallrye/graphql/deployment/GraphQLCDIContextPropagationTest.java b/extensions/smallrye-graphql/deployment/src/test/java/io/quarkus/smallrye/graphql/deployment/GraphQLCDIContextPropagationTest.java index ef29ff2a41612..de64008574b3c 100644 --- a/extensions/smallrye-graphql/deployment/src/test/java/io/quarkus/smallrye/graphql/deployment/GraphQLCDIContextPropagationTest.java +++ b/extensions/smallrye-graphql/deployment/src/test/java/io/quarkus/smallrye/graphql/deployment/GraphQLCDIContextPropagationTest.java @@ -7,7 +7,6 @@ import java.util.concurrent.ThreadLocalRandom; import java.util.stream.Collectors; -import javax.enterprise.context.ApplicationScoped; import javax.enterprise.context.RequestScoped; import javax.inject.Inject; @@ -107,7 +106,6 @@ public void testManualContextPropagation() { } @GraphQLApi - @ApplicationScoped public static class ResourceThatNeedsCdiContextPropagation { /** diff --git a/extensions/smallrye-graphql/deployment/src/test/java/io/quarkus/smallrye/graphql/deployment/SecurityTest.java b/extensions/smallrye-graphql/deployment/src/test/java/io/quarkus/smallrye/graphql/deployment/SecurityTest.java index 807b4d3dd53e8..3bd90e04ed528 100644 --- a/extensions/smallrye-graphql/deployment/src/test/java/io/quarkus/smallrye/graphql/deployment/SecurityTest.java +++ b/extensions/smallrye-graphql/deployment/src/test/java/io/quarkus/smallrye/graphql/deployment/SecurityTest.java @@ -8,7 +8,6 @@ import java.util.stream.Collectors; import javax.annotation.security.RolesAllowed; -import javax.enterprise.context.ApplicationScoped; import org.eclipse.microprofile.graphql.GraphQLApi; import org.eclipse.microprofile.graphql.Name; @@ -141,7 +140,6 @@ public void setMessage(String message) { } @GraphQLApi - @ApplicationScoped public static class SecuredApi { @Query diff --git a/extensions/smallrye-graphql/deployment/src/test/java/io/quarkus/smallrye/graphql/deployment/SmallRyeGraphQLContextTestCase.java b/extensions/smallrye-graphql/deployment/src/test/java/io/quarkus/smallrye/graphql/deployment/SmallRyeGraphQLContextTestCase.java index 4834896c65ed6..a4ccf0d11ae7b 100644 --- a/extensions/smallrye-graphql/deployment/src/test/java/io/quarkus/smallrye/graphql/deployment/SmallRyeGraphQLContextTestCase.java +++ b/extensions/smallrye-graphql/deployment/src/test/java/io/quarkus/smallrye/graphql/deployment/SmallRyeGraphQLContextTestCase.java @@ -9,7 +9,6 @@ import java.util.concurrent.CompletionStage; import java.util.concurrent.ExecutionException; -import javax.enterprise.context.ApplicationScoped; import javax.enterprise.inject.Instance; import javax.inject.Inject; @@ -125,7 +124,6 @@ public void testSourceMethods() { } @GraphQLApi - @ApplicationScoped public static class ContextPropagationResource { @Inject diff --git a/integration-tests/smallrye-graphql-client/src/main/java/io/quarkus/io/smallrye/graphql/client/LuckyNumbersResource.java b/integration-tests/smallrye-graphql-client/src/main/java/io/quarkus/io/smallrye/graphql/client/LuckyNumbersResource.java index 48a46a54bf2f3..ef1603309804e 100644 --- a/integration-tests/smallrye-graphql-client/src/main/java/io/quarkus/io/smallrye/graphql/client/LuckyNumbersResource.java +++ b/integration-tests/smallrye-graphql-client/src/main/java/io/quarkus/io/smallrye/graphql/client/LuckyNumbersResource.java @@ -2,7 +2,6 @@ import java.util.List; -import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; import org.eclipse.microprofile.graphql.GraphQLApi; @@ -15,7 +14,6 @@ import io.smallrye.mutiny.Multi; @GraphQLApi -@ApplicationScoped public class LuckyNumbersResource { private volatile Integer luckyNumber = 12;