Interface GraphQLRequest

All Known Subinterfaces:
GraphQLRequest<T>

public interface GraphQLRequest

The query, operation name, and variables that are sent to the GraphQL API.


Example to create an instance using the builder pattern

     GraphQLRequest graphQLRequest = GraphQLRequest.builder()
             .query("{query}")
             .build()
 
  • Method Details

    • getQuery

      @NotNull @NotNull String getQuery()

      String representation of the Source Text of the Document that is specified in the Language section of the GraphQL specification.

      Returns:
      query
    • getOperationName

      String getOperationName()

      Name of the operation, if you defined several operations in query.

      Returns:
      operationName
    • getVariables

      @Valid @Valid GraphQLVariablesMap getVariables()

      JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.

      Returns:
      variables
    • setQuery

      void setQuery(String query)

      String representation of the Source Text of the Document that is specified in the Language section of the GraphQL specification.

      Parameters:
      query - value to be set
    • setOperationName

      void setOperationName(String operationName)

      Name of the operation, if you defined several operations in query.

      Parameters:
      operationName - value to be set
    • setVariables

      void setVariables(GraphQLVariablesMap variables)

      JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.

      Parameters:
      variables - value to be set
    • of

      static GraphQLRequest of()
      factory method
      Returns:
      instance of GraphQLRequest
    • of

      static GraphQLRequest of(GraphQLRequest template)
      factory method to create a shallow copy GraphQLRequest
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static GraphQLRequest deepCopy(@Nullable GraphQLRequest template)
      factory method to create a deep copy of GraphQLRequest
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static GraphQLRequestBuilder builder()
      builder factory method for GraphQLRequest
      Returns:
      builder
    • builder

      static GraphQLRequestBuilder builder(GraphQLRequest template)
      create builder for GraphQLRequest instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withGraphQLRequest

      default <T> T withGraphQLRequest(Function<GraphQLRequest,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<GraphQLRequest> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference