Package graphql.validation
Class Validator
java.lang.Object
graphql.validation.Validator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateRules
(ValidationContext validationContext, ValidationErrorCollector validationErrorCollector) static int
static void
setMaxValidationErrors
(int maxValidationErrors) `graphql-java` will stop validation after a maximum number of validation messages has been reached.validateDocument
(GraphQLSchema schema, Document document, Predicate<Class<?>> applyRule, Locale locale) validateDocument
(GraphQLSchema schema, Document document, Locale locale)
-
Constructor Details
-
Validator
public Validator()
-
-
Method Details
-
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 List<ValidationError> validateDocument(GraphQLSchema schema, Document document, Locale locale) -
validateDocument
public List<ValidationError> validateDocument(GraphQLSchema schema, Document document, Predicate<Class<?>> applyRule, Locale locale) -
createRules
public List<AbstractRule> createRules(ValidationContext validationContext, ValidationErrorCollector validationErrorCollector)
-