Interface InvocationHandler
public interface InvocationHandler
Invocation handler that allows execution of GraphQL requests without a WebServer.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classFluent API builder to configure the invocation handler.static interfaceHandler used to update theExecutionContextbefore GraphQL execution. -
Method Summary
Modifier and TypeMethodDescriptionConfigured set of exceptions that are blacklisted.static InvocationHandler.Builderbuilder()Fluent API builder to configure the invocation handler.static InvocationHandlercreate(graphql.schema.GraphQLSchema schema) Create a handler for GraphQL schema.Configured default error message.Execute a GraphQL query.Execute a GraphQL query.executeWithContext(String query, String operationName, Map<String, Object> variables, Map<String, Object> contextValues) Execute a GraphQL query with context values available fromExecutionContext.contextValue(String)and fromDataFetchingEnvironment.getGraphQlContext().executeWithContext(String query, Map<String, Object> contextValues) Execute a GraphQL query with context values available fromExecutionContext.contextValue(String)and fromDataFetchingEnvironment.getGraphQlContext().Execute a GraphQL query with context values available fromExecutionContext.contextValue(String)and fromDataFetchingEnvironment.getGraphQlContext().The schema of this GraphQL endpoint.Configured set of exceptions that are whitelisted.
-
Method Details
-
create
Create a handler for GraphQL schema.- Parameters:
schema- schema to use- Returns:
- a new invocation handler
-
builder
Fluent API builder to configure the invocation handler.- Returns:
- a new builder
-
execute
-
executeWithContext
Execute a GraphQL query with context values available fromExecutionContext.contextValue(String)and fromDataFetchingEnvironment.getGraphQlContext().- Parameters:
query- query stringcontextValues- context values to use for this execution- Returns:
- GraphQL result
-
executeWithContext
default Map<String,Object> executeWithContext(String query, Map<String, Object> variables, Map<String, Object> contextValues) Execute a GraphQL query with context values available fromExecutionContext.contextValue(String)and fromDataFetchingEnvironment.getGraphQlContext().- Parameters:
query- query stringvariables- variables to usecontextValues- context values to use for this execution- Returns:
- GraphQL result
-
execute
-
executeWithContext
default Map<String,Object> executeWithContext(String query, String operationName, Map<String, Object> variables, Map<String, Object> contextValues) Execute a GraphQL query with context values available fromExecutionContext.contextValue(String)and fromDataFetchingEnvironment.getGraphQlContext().- Parameters:
query- query stringoperationName- operation namevariables- variables to usecontextValues- context values to use for this execution- Returns:
- GraphQL result
-
schemaString
-
defaultErrorMessage
-
blacklistedExceptions
-
whitelistedExceptions
-