Class Validator


  • public class Validator
    extends java.lang.Object
    • Constructor Detail

      • Validator

        public Validator()
    • Method Detail

      • setMaxValidationErrors

        public static void setMaxValidationErrors​(int maxValidationErrors)
        `graphql-java` will stop validation after a maximum number of validation messages has been reached. Attackers can send pathologically invalid queries to induce a Denial of Service attack and fill memory with 10000s of errors and burn CPU in process. By default, this is set to 100 errors. You can set a new JVM wide value as the maximum allowed validation errors.
        Parameters:
        maxValidationErrors - the maximum validation errors allow JVM wide
      • getMaxValidationErrors

        public static int getMaxValidationErrors()
      • validateDocument

        public java.util.List<ValidationError> validateDocument​(GraphQLSchema schema,
                                                                Document document,
                                                                java.util.function.Predicate<java.lang.Class<?>> applyRule,
                                                                java.util.Locale locale)