Search in sources :

Example 1 with BatchedExecutionStrategy

use of graphql.execution.batched.BatchedExecutionStrategy in project graphql-java by graphql-java.

the class BatchCompare method batchedRun.

void batchedRun() {
    System.out.println("=== BatchedExecutionStrategy ===");
    GraphQLSchema schema = buildBatchedSchema();
    GraphQL graphQL = GraphQL.newGraphQL(schema).queryExecutionStrategy(new BatchedExecutionStrategy()).build();
    ExecutionInput executionInput = ExecutionInput.newExecutionInput().query("query { shops { id name departments { id name products { id name } } } }").build();
    ExecutionResult result = graphQL.execute(executionInput);
    System.out.println("\nExecutionResult: " + result.toSpecification());
}
Also used : GraphQL(graphql.GraphQL) ExecutionResult(graphql.ExecutionResult) ExecutionInput(graphql.ExecutionInput) GraphQLSchema(graphql.schema.GraphQLSchema) BatchedExecutionStrategy(graphql.execution.batched.BatchedExecutionStrategy)

Aggregations

ExecutionInput (graphql.ExecutionInput)1 ExecutionResult (graphql.ExecutionResult)1 GraphQL (graphql.GraphQL)1 BatchedExecutionStrategy (graphql.execution.batched.BatchedExecutionStrategy)1 GraphQLSchema (graphql.schema.GraphQLSchema)1