Class GqlEntityValidationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.jmix.graphql.datafetcher.GqlEntityValidationException
All Implemented Interfaces:
graphql.GraphQLError, Serializable

public class GqlEntityValidationException extends RuntimeException implements graphql.GraphQLError
See Also:
  • Field Details

  • Constructor Details

    • GqlEntityValidationException

      public GqlEntityValidationException(EntityValidationException ex, Object parentEntity, MetaClass parentClass)
    • GqlEntityValidationException

      public GqlEntityValidationException(String clientMessage)
    • GqlEntityValidationException

      public GqlEntityValidationException(Throwable ex, String clientMessage)
  • Method Details

    • getLocations

      public List<graphql.language.SourceLocation> getLocations()
      Specified by:
      getLocations in interface graphql.GraphQLError
    • getErrorType

      public graphql.ErrorClassification getErrorType()
      Specified by:
      getErrorType in interface graphql.GraphQLError
    • getExtensions

      public Map<String,Object> getExtensions()
      Specified by:
      getExtensions in interface graphql.GraphQLError
    • composeErrorExtension

      protected Map<String,Object> composeErrorExtension(javax.validation.ConstraintViolation<?> cv)
    • buildFullPath

      protected Stream<String> buildFullPath(Object entity, MetaClass metaClass, javax.validation.ConstraintViolation<?> cv, String path, Set<Object> visited)
      By default constraint violation (CV) contains only direct property path. For example when validation error relates to "name" in "car.garage.name" query - CV will contains "name" property only. For better user experience we need to define and return full path of validated property. In example above it's mean that method will return "car.garage.name" instead of "name".
      Parameters:
      entity - - validated entity
      metaClass - - validated entity meta class
      cv - - current constraint violation
      path - already composed part of path
      visited - entities in object graph that already visited due to recursion
      Returns:
      full property path