Class Error
java.lang.Object
com.graphql_java_generator.client.response.Error
- All Implemented Interfaces:
graphql.GraphQLError
,Serializable
The error POJO, mapped from the GraphQL server response, when an error occurs
- Author:
- etienne-sf
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptioncom.fasterxml.jackson.databind.JsonNode
The extensions field of errors, stored as is from the incoming GraphQL response. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongraphql.ErrorClassification
com.fasterxml.jackson.databind.JsonNode
Returns the extensions as a map.Returns the extensions as a map.<T> T
getExtensionsField
(String key, 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.List<graphql.language.SourceLocation>
void
setExtensions
(com.fasterxml.jackson.databind.JsonNode extensions) toString()
Logs this error to the givenLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface graphql.GraphQLError
getPath, toSpecification
-
Field Details
-
message
-
locations
-
description
-
validationErrorType
-
queryPath
-
errorType
-
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
Logs this error to the givenLogger
-
getExtensionsAsJsonNode
public com.fasterxml.jackson.databind.JsonNode getExtensionsAsJsonNode() -
setExtensions
public void setExtensions(com.fasterxml.jackson.databind.JsonNode extensions) -
getExtensions
- Specified by:
getExtensions
in interfacegraphql.GraphQLError
-
getExtensionsAsMapOfJsonNode
Returns the extensions as a map. The values can't be deserialized, as their type is unknown.- Returns:
-
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
- Specified by:
getMessage
in interfacegraphql.GraphQLError
-
getLocations
- Specified by:
getLocations
in interfacegraphql.GraphQLError
-
getErrorType
public graphql.ErrorClassification getErrorType()- Specified by:
getErrorType
in interfacegraphql.GraphQLError
-