Class Error
java.lang.Object
com.graphql_java_generator.client.response.Error
- All Implemented Interfaces:
graphql.GraphQLError,java.io.Serializable
public class Error
extends java.lang.Object
implements graphql.GraphQLError
The error POJO, mapped from the GraphQL server response, when an error occurs
- Author:
- etienne-sf
- See Also:
- Serialized Form
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description java.lang.Stringdescriptionjava.lang.StringerrorTypecom.fasterxml.jackson.databind.JsonNodeextensionsThe extensions field of errors, stored as is from the incoming GraphQL response.java.util.List<Location>locationsjava.lang.Stringmessagejava.util.List<java.lang.String>pathjava.util.List<java.lang.String>queryPathjava.lang.StringvalidationErrorType -
Constructor Summary
Constructors Constructor Description Error() -
Method Summary
Modifier and Type Method Description graphql.ErrorClassificationgetErrorType()java.util.Map<java.lang.String,java.lang.Object>getExtensions()com.fasterxml.jackson.databind.JsonNodegetExtensionsAsJsonNode()java.util.Map<java.lang.String,com.fasterxml.jackson.databind.JsonNode>getExtensionsAsMapOfJsonNode()Returns the extensions as a map.java.util.Map<java.lang.String,java.lang.String>getExtensionsAsMapStringString()Returns the extensions as a map.<T> TgetExtensionsField(java.lang.String key, java.lang.Class<T> t)Parse the value for the given _key_, as found in the extensions field of the GraphQL server's response, into the given _t_ class.java.util.List<graphql.language.SourceLocation>getLocations()java.lang.StringgetMessage()voidsetExtensions(com.fasterxml.jackson.databind.JsonNode extensions)java.lang.StringtoString()Logs this error to the givenLogger
-
Field Details
-
message
public java.lang.String message -
locations
-
description
public java.lang.String description -
validationErrorType
public java.lang.String validationErrorType -
queryPath
public java.util.List<java.lang.String> queryPath -
errorType
public java.lang.String errorType -
path
public java.util.List<java.lang.String> path -
extensions
public com.fasterxml.jackson.databind.JsonNode extensionsThe extensions field of errors, stored as is from the incoming GraphQL response. It can be retrieved thanks to one of these methods:getExtensions(),getExtensionsAsJsonNode(),getExtensionsAsMapOfJsonNode(),getExtensionsField(String, Class)
-
-
Constructor Details
-
Error
public Error()
-
-
Method Details
-
toString
public java.lang.String toString()Logs this error to the givenLogger- Overrides:
toStringin classjava.lang.Object- Parameters:
logger-
-
getExtensionsAsJsonNode
public com.fasterxml.jackson.databind.JsonNode getExtensionsAsJsonNode() -
setExtensions
public void setExtensions(com.fasterxml.jackson.databind.JsonNode extensions) -
getExtensions
public java.util.Map<java.lang.String,java.lang.Object> getExtensions()- Specified by:
getExtensionsin interfacegraphql.GraphQLError
-
getExtensionsAsMapOfJsonNode
public java.util.Map<java.lang.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 java.util.Map<java.lang.String,java.lang.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(java.lang.String key, java.lang.Class<T> t) throws com.fasterxml.jackson.core.JsonProcessingExceptionParse 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 java.lang.String getMessage()- Specified by:
getMessagein interfacegraphql.GraphQLError
-
getLocations
public java.util.List<graphql.language.SourceLocation> getLocations()- Specified by:
getLocationsin interfacegraphql.GraphQLError
-
getErrorType
public graphql.ErrorClassification getErrorType()- Specified by:
getErrorTypein interfacegraphql.GraphQLError
-