graphql.servlet.GraphQLBatchedInvocationInput Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of graphql-java-servlet Show documentation
Show all versions of graphql-java-servlet Show documentation
relay.js-compatible GraphQL servlet
The newest version!
package graphql.servlet;
import graphql.ExecutionInput;
import graphql.execution.ExecutionContext;
import graphql.schema.GraphQLSchema;
import graphql.servlet.internal.GraphQLRequest;
import javax.security.auth.Subject;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* @author Andrew Potter
*/
public class GraphQLBatchedInvocationInput extends GraphQLInvocationInput {
private final List requests;
public GraphQLBatchedInvocationInput(List requests, GraphQLSchema schema, GraphQLContext context, Object root) {
super(schema, context, root);
this.requests = Collections.unmodifiableList(requests);
}
public List getExecutionInputs() {
return requests.stream()
.map(this::createExecutionInput)
.collect(Collectors.toList());
}
}