Package graphql

Class ExceptionWhileDataFetching

java.lang.Object
graphql.ExceptionWhileDataFetching
All Implemented Interfaces:
GraphQLError, Serializable

@PublicApi public class ExceptionWhileDataFetching extends Object implements GraphQLError
This graphql error will be used if a runtime exception is encountered while a data fetcher is invoked
See Also:
  • Constructor Details

  • Method Details

    • getException

      public Throwable getException()
    • getMessage

      public String getMessage()
      Specified by:
      getMessage in interface GraphQLError
      Returns:
      a description of the error intended for the developer as a guide to understand and correct the error
    • 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
    • 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
    • getErrorType

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

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object