Package io.jmix.graphql.datafetcher
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
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGqlEntityValidationException(EntityValidationException ex, Object parentEntity, MetaClass parentClass) GqlEntityValidationException(String clientMessage) GqlEntityValidationException(Throwable ex, String clientMessage) -
Method Summary
Modifier and TypeMethodDescriptionbuildFullPath(Object entity, MetaClass metaClass, javax.validation.ConstraintViolation<?> cv, String path, Set<Object> visited) By default constraint violation (CV) contains only direct property path.composeErrorExtension(javax.validation.ConstraintViolation<?> cv) graphql.ErrorClassificationList<graphql.language.SourceLocation>Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface graphql.GraphQLError
getMessage, getPath, toSpecification
-
Field Details
-
EXTENSION_CONSTRAINT_VIOLATIONS
- See Also:
-
EXTENSION_PERSISTENCE_ERROR_NAME
- See Also:
-
-
Constructor Details
-
GqlEntityValidationException
public GqlEntityValidationException(EntityValidationException ex, Object parentEntity, MetaClass parentClass) -
GqlEntityValidationException
-
GqlEntityValidationException
-
-
Method Details
-
getLocations
- Specified by:
getLocationsin interfacegraphql.GraphQLError
-
getErrorType
public graphql.ErrorClassification getErrorType()- Specified by:
getErrorTypein interfacegraphql.GraphQLError
-
getExtensions
- Specified by:
getExtensionsin interfacegraphql.GraphQLError
-
composeErrorExtension
-
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 entitymetaClass- - validated entity meta classcv- - current constraint violationpath- already composed part of pathvisited- entities in object graph that already visited due to recursion- Returns:
- full property path
-