java.lang.Object
com.graphql_java_generator.client.response.Error
All Implemented Interfaces:
graphql.GraphQLError, Serializable

public class Error extends Object implements graphql.GraphQLError
The error POJO, mapped from the GraphQL server response, when an error occurs
Author:
etienne-sf
See Also:
  • Field Details

  • Constructor Details

    • Error

      public Error()
  • Method Details

    • toString

      public String toString()
      Logs this error to the given Logger
      Overrides:
      toString in class Object
      Parameters:
      logger -
    • getExtensionsAsJsonNode

      public com.fasterxml.jackson.databind.JsonNode getExtensionsAsJsonNode()
    • setExtensions

      public void setExtensions(com.fasterxml.jackson.databind.JsonNode extensions)
    • getExtensions

      public Map<String,Object> getExtensions()
      Specified by:
      getExtensions in interface graphql.GraphQLError
    • getExtensionsAsMapOfJsonNode

      public Map<String,com.fasterxml.jackson.databind.JsonNode> getExtensionsAsMapOfJsonNode()
      Returns the extensions as a map. The values can't be deserialized, as their type is unknown.
      Returns:
    • getExtensionsAsMapStringString

      public Map<String,String> getExtensionsAsMapStringString()
      Returns the extensions as a map. The values can't be deserialized, as their type is unknown.
      Returns:
    • getExtensionsField

      public <T> T getExtensionsField(String key, Class<T> t) throws com.fasterxml.jackson.core.JsonProcessingException
      Parse the value for the given _key_, as found in the extensions field of the GraphQL server's response, into the given _t_ class.
      Type Parameters:
      T -
      Parameters:
      key -
      t -
      Returns:
      null if the key is not in the extensions map. Otherwise: the value for this _key_, as a _t_ instance
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - When there is an error when converting the key's value into the _t_ class
    • getMessage

      public String getMessage()
      Specified by:
      getMessage in interface graphql.GraphQLError
    • getLocations

      public List<graphql.language.SourceLocation> getLocations()
      Specified by:
      getLocations in interface graphql.GraphQLError
    • getErrorType

      public graphql.ErrorClassification getErrorType()
      Specified by:
      getErrorType in interface graphql.GraphQLError