Package graphql

Class GraphqlErrorException

All Implemented Interfaces:
GraphQLError, Serializable
Direct Known Subclasses:
CoercingParseLiteralException, CoercingParseValueException, CoercingSerializeException

@PublicApi public class GraphqlErrorException extends GraphQLException implements GraphQLError
A base class for graphql runtime exceptions that also implement GraphQLError and can be used in a general sense direct or have specialisations made of it.

This is aimed amongst other reasons at Kotlin consumers due to https://github.com/graphql-java/graphql-java/issues/1690 as well as being a way to share common code.

See Also:
  • Constructor Details

  • Method Details

    • getLocations

      public List<SourceLocation> getLocations()
      Specified by:
      getLocations in interface GraphQLError
      Returns:
      the location(s) within the GraphQL document at which the error occurred. Each SourceLocation describes the beginning of an associated syntax element
    • getErrorType

      public ErrorClassification getErrorType()
      Specified by:
      getErrorType in interface GraphQLError
      Returns:
      an object classifying this error
    • getPath

      public List<Object> getPath()
      Description copied from interface: GraphQLError
      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
      Specified by:
      getPath in interface GraphQLError
      Returns:
      the path in list format
    • getExtensions

      public Map<String,Object> getExtensions()
      Specified by:
      getExtensions in interface GraphQLError
      Returns:
      a map of error extensions or null if there are none
    • newErrorException

      public static GraphqlErrorException.Builder newErrorException()