Class TargetedValidationRules


  • @PublicApi
    public class TargetedValidationRules
    extends java.lang.Object
    TargetedValidationRules is a holder of ValidationRules targeted against a specific type, field and possible argument via ValidationCoordinates. It then allows those rules to be run against the specific fields based on runtime execution during DataFetcher invocations.
    • Method Detail

      • isEmpty

        public boolean isEmpty()
      • runValidationRules

        public java.util.List<graphql.GraphQLError> runValidationRules​(graphql.schema.DataFetchingEnvironment env,
                                                                       MessageInterpolator interpolator,
                                                                       java.util.Locale defaultLocale)
        Runs the contained rules that match the currently executing field named by the DataFetchingEnvironment
        Parameters:
        env - the field being executed
        interpolator - the message interpolator to use
        defaultLocale - the default locale in play
        Returns:
        a list of zero or more input data validation errors