All Downloads are FREE. Search and download functionalities are using the official Maven repository.

graphql.kickstart.spring.GraphQLSpringServerWebExchangeContext Maven / Gradle / Ivy

There is a newer version: 15.1.0
Show newest version
package graphql.kickstart.spring;

import graphql.kickstart.execution.context.DefaultGraphQLContext;
import java.util.Objects;
import org.dataloader.DataLoaderRegistry;
import org.springframework.web.server.ServerWebExchange;

public class GraphQLSpringServerWebExchangeContext extends DefaultGraphQLContext
    implements GraphQLSpringContext {

  private final ServerWebExchange serverWebExchange;

  public GraphQLSpringServerWebExchangeContext(ServerWebExchange serverWebExchange) {
    this(new DataLoaderRegistry(), serverWebExchange);
  }

  public GraphQLSpringServerWebExchangeContext(
      DataLoaderRegistry dataLoaderRegistry, ServerWebExchange serverWebExchange) {
    super(dataLoaderRegistry, null);
    this.serverWebExchange =
        Objects.requireNonNull(serverWebExchange, "Server web exchange cannot be null");
  }

  @Override
  public ServerWebExchange getServerWebExchange() {
    return serverWebExchange;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy