Class SubscriptionTypeReactiveExecutor

java.lang.Object
com.generated.graphql.util.SubscriptionTypeReactiveExecutor
All Implemented Interfaces:
GraphQLSubscriptionReactiveExecutor

@Component public class SubscriptionTypeReactiveExecutor extends Object implements GraphQLSubscriptionReactiveExecutor
This class contains the methods that allows the execution of the subscriptions that are defined in the SubscriptionType of the GraphQL schema. All the methods for this executor are in spring reactive, that is: they return a Flux.
These methods allows:
  • Preparation of partial subscription requests
  • Execution of partial prepared subscription requests
  • Execution of partial direct subscription requests
You'll find all the documentation on the client page doc.
Author:
generated by graphql-java-generator
  • Constructor Details

    • SubscriptionTypeReactiveExecutor

      public SubscriptionTypeReactiveExecutor()
  • Method Details

    • execWithBindValues

      public reactor.core.publisher.Flux<SubscriptionType> execWithBindValues(String queryResponseDef, Map<String,Object> parameters) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException
      This method takes a subscription full request definition, and executes it in reactive mode against the GraphQL server. It may only return one subscription's field.
      It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
      Here is a sample on how to use it:
      Parameters:
      queryResponseDef - The response definition of the subscription, in the native GraphQL format (see here above). It must ommit the query/mutation/subscription keyword, and start by the first { that follows.It may contain directives, as explained in the GraphQL specs.
      parameters - The map of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an empty Map. The key is the parameter name, as defined in the query (in the above sample: heroParam is an optional parameter and skip is a mandatory one). The value is the parameter vale in its Java type (for instance a Date for the GraphQLScalarTypeDate). The parameters which value is missing in this map will no be transmitted toward the GraphQL server.
      Returns:
      The SubscriptionClient that allows the caller to act on the subscribed subscription.
      Throws:
      GraphQLRequestPreparationException - When an error occurs during the request preparation, typically when building the ObjectResponse
      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 parsed
    • exec

      public reactor.core.publisher.Flux<SubscriptionType> exec(String queryResponseDef, Object... paramsAndValues) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException
      This method takes a subscription full request definition, and executes it in reactive mode against the GraphQL server. It may only return one subscription's field.
      It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
      Here is a sample on how to use it:
      Parameters:
      queryResponseDef - The response definition of the query, in the native GraphQL format (see here above). It must ommit the query/mutation/subscription keyword, and start by the first { that follows.It may contain directives, as explained in the GraphQL specs.
      paramsAndValues - This parameter contains all the name and values for the Bind Variables defined in the objectResponse parameter, that must be sent to the server. Optional parameter may not have a value. They will be ignored and not sent to the server. Mandatory parameter must be provided in this argument.
      This parameter contains an even number of parameters: it must be a series of name and values : (paramName1, paramValue1, paramName2, paramValue2...)
      Returns:
      The SubscriptionClient that allows the caller to act on the subscribed subscription.
      Throws:
      GraphQLRequestPreparationException - When an error occurs during the request preparation, typically when building the ObjectResponse
      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 parsed
    • execWithBindValues

      public reactor.core.publisher.Flux<SubscriptionType> execWithBindValues(ObjectResponse objectResponse, Map<String,Object> parameters) throws GraphQLRequestExecutionException
      This method takes a subscription full request definition, and executes it in reactive mode against the GraphQL server. It may only return one subscription's field.
      It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
      Here is a sample on how to use it:
      Parameters:
      objectResponse - The definition of the response format, that describes what the GraphQL server is expected to return
      Note: the ObjectResponse type of this parameter is defined for backward compatibility. In new implementations, the expected type is the generated GraphQLRequest POJO, as returned by the getGraphQLRequest(java.lang.String) method or one of the getXxxxGraphQLRequest(String) methods.
      parameters - The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an empty Map
      Returns:
      The SubscriptionClient that allows the caller to act on the subscribed subscription.
      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 parsed
    • exec

      public reactor.core.publisher.Flux<SubscriptionType> exec(ObjectResponse objectResponse, Object... paramsAndValues) throws GraphQLRequestExecutionException
      This method takes a subscription full request definition, and executes it in reactive mode against the GraphQL server. It may only return one subscription's field.
      It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
      Here is a sample on how to use it:
      Parameters:
      objectResponse - The definition of the response format, that describes what the GraphQL server is expected to return
      Note: the ObjectResponse type of this parameter is defined for backward compatibility. In new implementations, the expected type is the generated GraphQLRequest POJO, as returned by the getGraphQLRequest(java.lang.String) method or one of the getXxxxGraphQLRequest(String) methods.
      paramsAndValues - This parameter contains all the name and values for the Bind Variables defined in the objectResponse parameter, that must be sent to the server. Optional parameter may not have a value. They will be ignored and not sent to the server. Mandatory parameter must be provided in this argument.
      This parameter contains an even number of parameters: it must be a series of name and values : (paramName1, paramValue1, paramName2, paramValue2...)
      Returns:
      The SubscriptionClient that allows the caller to act on the subscribed subscription.
      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 parsed
    • getResponseBuilder

      public Builder getResponseBuilder() throws GraphQLRequestPreparationException
      Get the Builder for a full request, as expected by the exec and execWithBindValues methods.
      Returns:
      Throws:
      GraphQLRequestPreparationException
    • getGraphQLRequest

      public GraphQLReactiveRequest getGraphQLRequest(String fullRequest) throws GraphQLRequestPreparationException
      Get the GraphQLRequest for full request. For instance:
       GraphQLRequest request = new GraphQLRequest(fullRequest);
       
      Parameters:
      fullRequest - The full GraphQL request, as specified in the GraphQL specification
      Returns:
      Throws:
      GraphQLRequestPreparationException
    • newCharacterWithBindValues

      public reactor.core.publisher.Flux<Optional<Character>> newCharacterWithBindValues(String queryResponseDef, Map<String,Object> parameters) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException
      This method registers a subscription, by executing a direct partial newCharacter subscription against the GraphQL server. This subscription is one of the fields defined in the GraphQL subscription object. The queryResponseDef contains the part of the subscription that is after the subscription name (see the sample below), for instance "{id name}" if you want these two fields to be sent in the notifications you'll receive for this subscription.
      Parameters:
      queryResponseDef - The response definition of the subscription, in the native GraphQL format (see here above)
      parameters - The list of values, for the bind variables defined in the subscription. If there is no bind variable in the defined subscription, this argument may be null or an empty Map
      Throws:
      GraphQLRequestPreparationException - When an error occurs during the request preparation, typically when building the ObjectResponse
      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 parsed
    • newCharacter

      public reactor.core.publisher.Flux<Optional<Character>> newCharacter(String queryResponseDef, Object... paramsAndValues) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException
      This method registers a subscription, by executing a direct partial request against the GraphQL server. This subscription is one of the fields defined in the GraphQL subscription object. The queryResponseDef contains the part of the subscription that is after the subscription name (see the sample below), for instance "{id name}" if you want these two fields to be sent in the notifications you'll receive for this subscription.
      You must also provide a callback instance of the SubscriptionCallback, and the parameter for the subscription as parameter for this method. For instance, if the subscription subscribeToNewPost has one parameter boardName (as defined in the GraphQL schema):
      Parameters:
      queryResponseDef - The response definition of the subscription, in the native GraphQL format (see here above)
      parameters - The list of values, for the bind variables defined in the subscription. If there is no bind variable in the defined subscription, this argument may be null or an empty Map
      Throws:
      GraphQLRequestPreparationException - When an error occurs during the request preparation, typically when building the ObjectResponse
      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 parsed
    • newCharacterWithBindValues

      public reactor.core.publisher.Flux<Optional<Character>> newCharacterWithBindValues(ObjectResponse objectResponse, Map<String,Object> parameters) throws GraphQLRequestExecutionException
      This method registers a subscription, by executing a direct partial request against the GraphQL server. This subscription is one of the fields defined in the GraphQL subscription object. The queryResponseDef contains the part of the subscription that is after the subscription name (see the sample below), for instance "{id name}" if you want these two fields to be sent in the notifications you'll receive for this subscription.
      You must also provide a callback instance of the SubscriptionCallback, and the parameter for the subscription as parameter for this method. For instance, if the subscription subscribeToNewPost has one parameter boardName (as defined in the GraphQL schema):
      Parameters:
      objectResponse - The definition of the response format, that describes what the GraphQL server is expected to return
      Note: the ObjectResponse type of this parameter is defined for backward compatibility. In new implementations, the expected type is the generated GraphQLRequest POJO, as returned by the getNewCharacterGraphQLRequest(java.lang.String) method.
      parameters - The list of values, for the bind variables defined in the subscription. If there is no bind variable in the defined Query, this argument may be null or an empty Map
      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 parsed
    • newCharacter

      public reactor.core.publisher.Flux<Optional<Character>> newCharacter(ObjectResponse objectResponse, Object... paramsAndValues) throws GraphQLRequestExecutionException
      This method registers a subscription, by executing a direct partial request against the GraphQL server. This subscription is one of the fields defined in the GraphQL subscription object. The queryResponseDef contains the part of the subscription that is after the subscription name (see the sample below), for instance "{id name}" if you want these two fields to be sent in the notifications you'll receive for this subscription.
      You must also provide a callback instance of the SubscriptionCallback, and the parameter for the subscription as parameter for this method. For instance, if the subscription subscribeToNewPost has one parameter boardName (as defined in the GraphQL schema):
      Parameters:
      objectResponse - The definition of the response format, that describes what the GraphQL server is expected to return
      Note: the ObjectResponse type of this parameter is defined for backward compatibility. In new implementations, the expected type is the generated GraphQLRequest POJO, as returned by the getNewCharacterGraphQLRequest(java.lang.String) method.
      paramsAndValues - This parameter contains all the name and values for the Bind Variables defined in the objectResponse parameter, that must be sent to the server. Optional parameter may not have a value. They will be ignored and not sent to the server. Mandatory parameter must be provided in this argument.
      This parameter contains an even number of parameters: it must be a series of name and values : (paramName1, paramValue1, paramName2, paramValue2...)
      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 parsed
    • getNewCharacterResponseBuilder

      public Builder getNewCharacterResponseBuilder() throws GraphQLRequestPreparationException
      Get the Builder for the Character, as expected by the newCharacter subscription.
      Returns:
      Throws:
      GraphQLRequestPreparationException
    • getNewCharacterGraphQLRequest

      public GraphQLReactiveRequest getNewCharacterGraphQLRequest(String partialRequest) throws GraphQLRequestPreparationException
      Get the GraphQLRequest for the newCharacter REACTIVE_EXECUTOR, created with the given Partial request.
      Parameters:
      partialRequest - The Partial GraphQL request, as explained in the plugin client documentation
      Returns:
      Throws:
      GraphQLRequestPreparationException