Package graphql
Interface ErrorClassification
-
- All Known Implementing Classes:
ErrorType
,PersistedQueryError
,PersistedQueryIdInvalid
,PersistedQueryNotFound
@PublicApi public interface ErrorClassification
Errors in graphql-java can have a classification to help with the processing of errors. CustomGraphQLError
implementations could use custom classifications.graphql-java ships with a standard set of error classifications via
ErrorType
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static ErrorClassification
errorClassification(java.lang.String errorClassification)
This produces a simple ErrorClassification that represents the provided String.default java.lang.Object
toSpecification(GraphQLError error)
This is called to create a representation of the error classification that can be put into the `extensions` map of the graphql error under the key 'classification' whenGraphQLError.toSpecification()
is called
-
-
-
Method Detail
-
toSpecification
default java.lang.Object toSpecification(GraphQLError error)
This is called to create a representation of the error classification that can be put into the `extensions` map of the graphql error under the key 'classification' whenGraphQLError.toSpecification()
is called- Parameters:
error
- the error associated with this classification- Returns:
- an object representation of this error classification
-
errorClassification
static ErrorClassification errorClassification(java.lang.String errorClassification)
This produces a simple ErrorClassification that represents the provided String. You can use this factory method to give out simple but custom error classifications.- Parameters:
errorClassification
- the string that represents the error classification- Returns:
- a ErrorClassification that is that provided string
-
-