@PublicApi public class GraphQL extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
GraphQL.Builder |
Constructor and Description |
---|
GraphQL(GraphQLSchema graphQLSchema)
Deprecated.
use the
newGraphQL(GraphQLSchema) builder instead. This will be removed in a future version. |
GraphQL(GraphQLSchema graphQLSchema,
ExecutionStrategy queryStrategy)
Deprecated.
use the
newGraphQL(GraphQLSchema) builder instead. This will be removed in a future version. |
GraphQL(GraphQLSchema graphQLSchema,
ExecutionStrategy queryStrategy,
ExecutionStrategy mutationStrategy)
Deprecated.
use the
newGraphQL(GraphQLSchema) builder instead. This will be removed in a future version. |
GraphQL(GraphQLSchema graphQLSchema,
ExecutionStrategy queryStrategy,
ExecutionStrategy mutationStrategy,
ExecutionStrategy subscriptionStrategy)
Deprecated.
use the
newGraphQL(GraphQLSchema) builder instead. This will be removed in a future version. |
Modifier and Type | Method and Description |
---|---|
ExecutionResult |
execute(ExecutionInput.Builder executionInputBuilder)
Executes the graphql query using the provided input object builder
|
ExecutionResult |
execute(ExecutionInput executionInput)
Executes the graphql query using the provided input object
|
ExecutionResult |
execute(java.lang.String query)
Executes the specified graphql query/mutation/subscription
|
ExecutionResult |
execute(java.lang.String query,
java.lang.Object context)
Deprecated.
|
ExecutionResult |
execute(java.lang.String query,
java.lang.Object context,
java.util.Map<java.lang.String,java.lang.Object> variables)
Deprecated.
|
ExecutionResult |
execute(java.lang.String query,
java.lang.String operationName,
java.lang.Object context)
Deprecated.
|
ExecutionResult |
execute(java.lang.String query,
java.lang.String operationName,
java.lang.Object context,
java.util.Map<java.lang.String,java.lang.Object> variables)
Deprecated.
|
ExecutionResult |
execute(java.util.function.UnaryOperator<ExecutionInput.Builder> builderFunction)
Executes the graphql query using calling the builder function and giving it a new builder.
|
java.util.concurrent.CompletableFuture<ExecutionResult> |
executeAsync(ExecutionInput.Builder executionInputBuilder)
Executes the graphql query using the provided input object builder
|
java.util.concurrent.CompletableFuture<ExecutionResult> |
executeAsync(ExecutionInput executionInput)
Executes the graphql query using the provided input object
|
java.util.concurrent.CompletableFuture<ExecutionResult> |
executeAsync(java.util.function.UnaryOperator<ExecutionInput.Builder> builderFunction)
Executes the graphql query using the provided input object builder
|
static GraphQL.Builder |
newGraphQL(GraphQLSchema graphQLSchema)
Helps you build a GraphQL object ready to execute queries
|
public GraphQL(GraphQLSchema graphQLSchema)
newGraphQL(GraphQLSchema)
builder instead. This will be removed in a future version.graphQLSchema
- the schema to usepublic GraphQL(GraphQLSchema graphQLSchema, ExecutionStrategy queryStrategy)
newGraphQL(GraphQLSchema)
builder instead. This will be removed in a future version.graphQLSchema
- the schema to usequeryStrategy
- the query execution strategy to usepublic GraphQL(GraphQLSchema graphQLSchema, ExecutionStrategy queryStrategy, ExecutionStrategy mutationStrategy)
newGraphQL(GraphQLSchema)
builder instead. This will be removed in a future version.graphQLSchema
- the schema to usequeryStrategy
- the query execution strategy to usemutationStrategy
- the mutation execution strategy to usepublic GraphQL(GraphQLSchema graphQLSchema, ExecutionStrategy queryStrategy, ExecutionStrategy mutationStrategy, ExecutionStrategy subscriptionStrategy)
newGraphQL(GraphQLSchema)
builder instead. This will be removed in a future version.graphQLSchema
- the schema to usequeryStrategy
- the query execution strategy to usemutationStrategy
- the mutation execution strategy to usesubscriptionStrategy
- the subscription execution strategy to usepublic static GraphQL.Builder newGraphQL(GraphQLSchema graphQLSchema)
graphQLSchema
- the schema to usepublic ExecutionResult execute(java.lang.String query)
query
- the query/mutation/subscriptionExecutionResult
which can include errors@Deprecated public ExecutionResult execute(java.lang.String query, java.lang.Object context)
execute(ExecutionInput)
query
- the query/mutation/subscriptioncontext
- custom object provided to each DataFetcher
ExecutionResult
which can include errors@Deprecated public ExecutionResult execute(java.lang.String query, java.lang.String operationName, java.lang.Object context)
execute(ExecutionInput)
query
- the query/mutation/subscriptionoperationName
- the name of the operation to executecontext
- custom object provided to each DataFetcher
ExecutionResult
which can include errors@Deprecated public ExecutionResult execute(java.lang.String query, java.lang.Object context, java.util.Map<java.lang.String,java.lang.Object> variables)
execute(ExecutionInput)
query
- the query/mutation/subscriptioncontext
- custom object provided to each DataFetcher
variables
- variable values uses as argumentExecutionResult
which can include errors@Deprecated public ExecutionResult execute(java.lang.String query, java.lang.String operationName, java.lang.Object context, java.util.Map<java.lang.String,java.lang.Object> variables)
execute(ExecutionInput)
query
- the query/mutation/subscriptionoperationName
- name of the operation to executecontext
- custom object provided to each DataFetcher
variables
- variable values uses as argumentExecutionResult
which can include errorspublic ExecutionResult execute(ExecutionInput.Builder executionInputBuilder)
executionInputBuilder
- ExecutionInput.Builder
ExecutionResult
which can include errorspublic ExecutionResult execute(java.util.function.UnaryOperator<ExecutionInput.Builder> builderFunction)
This allows a lambda style like :
ExecutionResult result = graphql.execute(input -> input.query("{hello}").root(startingObj).context(contextObj));
builderFunction
- a function that is given a ExecutionInput.Builder
ExecutionResult
which can include errorspublic ExecutionResult execute(ExecutionInput executionInput)
executionInput
- ExecutionInput
ExecutionResult
which can include errorspublic java.util.concurrent.CompletableFuture<ExecutionResult> executeAsync(ExecutionInput.Builder executionInputBuilder)
This will return a promise (aka CompletableFuture
) to provide a ExecutionResult
which is the result of executing the provided query.
executionInputBuilder
- ExecutionInput.Builder
ExecutionResult
which can include errorspublic java.util.concurrent.CompletableFuture<ExecutionResult> executeAsync(java.util.function.UnaryOperator<ExecutionInput.Builder> builderFunction)
This will return a promise (aka CompletableFuture
) to provide a ExecutionResult
which is the result of executing the provided query.
This allows a lambda style like :
ExecutionResult result = graphql.execute(input -> input.query("{hello}").root(startingObj).context(contextObj));
builderFunction
- a function that is given a ExecutionInput.Builder
ExecutionResult
which can include errorspublic java.util.concurrent.CompletableFuture<ExecutionResult> executeAsync(ExecutionInput executionInput)
This will return a promise (aka CompletableFuture
) to provide a ExecutionResult
which is the result of executing the provided query.
executionInput
- ExecutionInput
ExecutionResult
which can include errors