graphql.GraphQLError Maven / Gradle / Ivy
package graphql;
import graphql.execution.ResultPath;
import graphql.language.SourceLocation;
import org.jetbrains.annotations.Nullable;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* The interface describing graphql errors
*
* NOTE: This class implements {@link java.io.Serializable} and hence it can be serialised and placed into a distributed cache. However we
* are not aiming to provide long term compatibility and do not intend for you to place this serialised data into permanent storage,
* with times frames that cross graphql-java versions. While we don't change things unnecessarily, we may inadvertently break
* the serialised compatibility across versions.
*
* @see GraphQL Spec - 7.1.2 Errors
*/
@PublicApi
public interface GraphQLError extends Serializable {
/**
* @return a description of the error intended for the developer as a guide to understand and correct the error
*/
String getMessage();
/**
* @return the location(s) within the GraphQL document at which the error occurred. Each {@link SourceLocation}
* describes the beginning of an associated syntax element
*/
List getLocations();
/**
* @return an object classifying this error
*/
ErrorClassification getErrorType();
/**
* The graphql spec says that the (optional) path field of any error must be
* a list of path entries starting at the root of the response
* and ending with the field associated with the error
* https://spec.graphql.org/draft/#sec-Errors.Error-Result-Format
*
* @return the path in list format
*/
default List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy