99import graphql .validation .Validator ;
1010
1111import java .util .List ;
12+ import java .util .Locale ;
1213import java .util .function .Predicate ;
1314
1415/**
@@ -40,7 +41,7 @@ public class ParseAndValidate {
4041 public static ParseAndValidateResult parseAndValidate (GraphQLSchema graphQLSchema , ExecutionInput executionInput ) {
4142 ParseAndValidateResult result = parse (executionInput );
4243 if (!result .isFailure ()) {
43- List <ValidationError > errors = validate (graphQLSchema , result .getDocument ());
44+ List <ValidationError > errors = validate (graphQLSchema , result .getDocument (), executionInput . getLocale () );
4445 return result .transform (builder -> builder .validationErrors (errors ));
4546 }
4647 return result ;
@@ -74,8 +75,8 @@ public static ParseAndValidateResult parse(ExecutionInput executionInput) {
7475 *
7576 * @return a result object that indicates how this operation went
7677 */
77- public static List <ValidationError > validate (GraphQLSchema graphQLSchema , Document parsedDocument ) {
78- return validate (graphQLSchema , parsedDocument , ruleClass -> true );
78+ public static List <ValidationError > validate (GraphQLSchema graphQLSchema , Document parsedDocument , Locale locale ) {
79+ return validate (graphQLSchema , parsedDocument , ruleClass -> true , locale );
7980 }
8081
8182 /**
@@ -87,8 +88,8 @@ public static List<ValidationError> validate(GraphQLSchema graphQLSchema, Docume
8788 *
8889 * @return a result object that indicates how this operation went
8990 */
90- public static List <ValidationError > validate (GraphQLSchema graphQLSchema , Document parsedDocument , Predicate <Class <?>> rulePredicate ) {
91+ public static List <ValidationError > validate (GraphQLSchema graphQLSchema , Document parsedDocument , Predicate <Class <?>> rulePredicate , Locale locale ) {
9192 Validator validator = new Validator ();
92- return validator .validateDocument (graphQLSchema , parsedDocument , rulePredicate );
93+ return validator .validateDocument (graphQLSchema , parsedDocument , rulePredicate , locale );
9394 }
9495}
0 commit comments