Interface RequestExecution
- All Known Implementing Classes:
RequestExecutionSpringReactiveImpl
Deprecated.
This class is responsible for actual execution of the request toward the GraphQL erver. It's a generic class,
responsible for calling the GraphQL server, and return its response as POJOs.
Note: its name ends with Execution to avoid collision with the Executor classes generated by the plugin.
Note: its name ends with Execution to avoid collision with the Executor classes generated by the plugin.
- Author:
- etienne-sf
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.slf4j.Marker
Deprecated.static final org.slf4j.Marker
Deprecated.static final org.slf4j.Marker
Deprecated.static final org.slf4j.Marker
Deprecated. -
Method Summary
Modifier and TypeMethodDescription<R extends GraphQLRequestObject,
T>
SubscriptionClientexecute
(AbstractGraphQLRequest graphQLRequest, Map<String, Object> parameters, SubscriptionCallback<T> subscriptionCallback, Class<R> subscriptionType, Class<T> messageType) Deprecated.Executes the given subscription GraphQL request, and returns the relevantWebSocketClient
.<R extends GraphQLRequestObject>
Rexecute
(AbstractGraphQLRequest graphQLRequest, Map<String, Object> parameters, Class<R> dataResponseType) Deprecated.Execution of the given query or mutation GraphQL request, and return its response mapped in the relevant POJO.
-
Field Details
-
GRAPHQL_MARKER
static final org.slf4j.Marker GRAPHQL_MARKERDeprecated. -
GRAPHQL_QUERY_MARKER
static final org.slf4j.Marker GRAPHQL_QUERY_MARKERDeprecated. -
GRAPHQL_MUTATION_MARKER
static final org.slf4j.Marker GRAPHQL_MUTATION_MARKERDeprecated. -
GRAPHQL_SUBSCRIPTION_MARKER
static final org.slf4j.Marker GRAPHQL_SUBSCRIPTION_MARKERDeprecated.
-
-
Method Details
-
execute
<R extends GraphQLRequestObject> R execute(AbstractGraphQLRequest graphQLRequest, Map<String, Object> parameters, Class<R> dataResponseType) throws GraphQLRequestExecutionExceptionDeprecated.Execution of the given query or mutation GraphQL request, and return its response mapped in the relevant POJO. This method executes a partial GraphQL query, or a full GraphQL request.- Type Parameters:
R
- The class that is generated from the query or the mutation definition in the GraphQL schema- Parameters:
graphQLRequest
- Defines what response is expected from the server.parameters
- the input parameters for this query. If the query has no parameters, it may be null or an empty list.dataResponseType
- The class generated for the query or the mutation type. The data tag of the GraphQL server response will be mapped into an instance of this class.- Returns:
- The response mapped to the code, generated from the GraphQl server. Or a wrapper for composite responses.
- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsedIOException
-
execute
<R extends GraphQLRequestObject,T> SubscriptionClient execute(AbstractGraphQLRequest graphQLRequest, Map<String, Object> parameters, SubscriptionCallback<T> subscriptionCallback, Class<R> subscriptionType, Class<T> messageType) throws GraphQLRequestExecutionExceptionDeprecated.Executes the given subscription GraphQL request, and returns the relevantWebSocketClient
. The given subscriptionCallback will receive the notifications that have been subscribed by this subscription. Only one Subscription may be executed at a time: it may be a partial Request (always limited to one query), or a full request that contains only one subscription.
Note: Don't forget to free the server's resources by calling theWebSocketClient#stop()
method of the returned object.- Type Parameters:
R
- The class that is generated from the subscription definition in the GraphQL schema. It contains one attribute, for each available subscription. The data tag of the GraphQL server response will be mapped into an instance of this class.T
- The type that must be returned by the query or mutation: it's the class that maps to the GraphQL type returned by this subscription.- Parameters:
graphQLRequest
- Defines what response is expected from the server.parameters
- The input parameters for this subscription. If the query has no parameters, it may be null or an empty list.subscriptionCallback
- The object that will be called each time a message is received, or an error on the subscription occurs. This object is provided by the application.subscriptionType
- The R classmessageType
- The T class- Returns:
- The Subscription client. It allows to stop the subscription, by executing its
SubscriptionClient.unsubscribe()
method. This will stop the incoming notification flow, and will free resources on both the client and the server. - Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsedIOException
-