Class GraphQLRequest

java.lang.Object
org.restheart.exchange.Exchange<com.google.gson.JsonElement>
org.restheart.exchange.Request<com.google.gson.JsonElement>
org.restheart.exchange.ServiceRequest<com.google.gson.JsonElement>
org.restheart.exchange.GraphQLRequest

public class GraphQLRequest extends ServiceRequest<com.google.gson.JsonElement>
  • Method Details

    • init

      public static GraphQLRequest init(io.undertow.server.HttpServerExchange exchange, String appUri) throws IOException, com.google.gson.JsonSyntaxException, BadRequestException
      Throws:
      IOException
      com.google.gson.JsonSyntaxException
      BadRequestException
    • of

      public static GraphQLRequest of(io.undertow.server.HttpServerExchange exchange)
    • parseContent

      public com.google.gson.JsonElement parseContent() throws IOException, BadRequestException
      Description copied from class: ServiceRequest
      Parses the content from the exchange and converts it into an instance of the specified type T. This method retrieves data from the exchange, interprets it according to the expected format, and attempts to convert this data into an object of type T.
      Specified by:
      parseContent in class ServiceRequest<com.google.gson.JsonElement>
      Returns:
      an instance of T representing the parsed content
      Throws:
      IOException - if an IO error occurs
      BadRequestException - if the content does not match the expected format for type T
    • getQuery

      public String getQuery()
    • getOperationName

      public String getOperationName()
    • getVariables

      public com.google.gson.JsonObject getVariables()
    • getGraphQLAppURI

      public String getGraphQLAppURI()
    • hasVariables

      public boolean hasVariables()