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

graphql.servlet.GraphQLBatchedInvocationInput Maven / Gradle / Ivy

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());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy