io.quarkus.smallrye.graphql.runtime.spi.datafetcher.RequestContextHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-smallrye-graphql Show documentation
Show all versions of quarkus-smallrye-graphql Show documentation
Create GraphQL Endpoints using the code-first approach from MicroProfile GraphQL
package io.quarkus.smallrye.graphql.runtime.spi.datafetcher;
import graphql.schema.DataFetchingEnvironment;
import io.quarkus.arc.InjectableContext;
import io.quarkus.arc.ManagedContext;
public final class RequestContextHelper {
private RequestContextHelper() {
}
public static void reactivate(ManagedContext requestContext, DataFetchingEnvironment dfe) {
if (!requestContext.isActive()) {
Object maybeState = dfe.getGraphQlContext().getOrDefault("state", null);
if (maybeState != null) {
requestContext.activate((InjectableContext.ContextState) maybeState);
} else {
requestContext.activate();
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy