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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface graphql.GraphQLError
graphql.GraphQLError.Builder<B extends graphql.GraphQLError.Builder<B>> -
Field Summary
FieldsModifier and TypeFieldDescriptioncom.fasterxml.jackson.databind.JsonNodeThe extensions field of errors, stored as is from the incoming GraphQL response. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongraphql.ErrorClassificationcom.fasterxml.jackson.databind.JsonNodeReturns the extensions as a map.Returns the extensions as a map.<T> TgetExtensionsField(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>voidsetExtensions(com.fasterxml.jackson.databind.JsonNode extensions) toString()Logs this error to the givenLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
getExtensionsin 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:
getMessagein interfacegraphql.GraphQLError
-
getLocations
- Specified by:
getLocationsin interfacegraphql.GraphQLError
-
getErrorType
public graphql.ErrorClassification getErrorType()- Specified by:
getErrorTypein interfacegraphql.GraphQLError
-