Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change GraphQL endpoints to be Singleton by default #26105

Merged
merged 1 commit into from Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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;
Expand Down Expand Up @@ -138,8 +139,9 @@ List<HotDeploymentWatchedFileBuildItem> brandingFiles() {

@BuildStep
void additionalBeanDefiningAnnotation(BuildProducer<BeanDefiningAnnotationBuildItem> 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
Expand Down
@@ -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;
Expand Down Expand Up @@ -64,7 +62,6 @@ public void setMessage(String message) {
}

@GraphQLApi
@ApplicationScoped
public static class ErrorApi {

@Query
Expand Down
Expand Up @@ -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;

Expand Down Expand Up @@ -107,7 +106,6 @@ public void testManualContextPropagation() {
}

@GraphQLApi
@ApplicationScoped
public static class ResourceThatNeedsCdiContextPropagation {

/**
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -141,7 +140,6 @@ public void setMessage(String message) {
}

@GraphQLApi
@ApplicationScoped
public static class SecuredApi {

@Query
Expand Down
Expand Up @@ -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;

Expand Down Expand Up @@ -125,7 +124,6 @@ public void testSourceMethods() {
}

@GraphQLApi
@ApplicationScoped
public static class ContextPropagationResource {

@Inject
Expand Down
Expand Up @@ -2,7 +2,6 @@

import java.util.List;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;

import org.eclipse.microprofile.graphql.GraphQLApi;
Expand All @@ -15,7 +14,6 @@
import io.smallrye.mutiny.Multi;

@GraphQLApi
@ApplicationScoped
public class LuckyNumbersResource {

private volatile Integer luckyNumber = 12;
Expand Down