77import graphql .schema .GraphQLSchema ;
88import graphql .validation .ValidationError ;
99import graphql .validation .Validator ;
10+ import org .jetbrains .annotations .NotNull ;
1011
1112import java .util .List ;
1213import java .util .Locale ;
@@ -40,7 +41,7 @@ public class ParseAndValidate {
4041 *
4142 * @return a result object that indicates how this operation went
4243 */
43- public static ParseAndValidateResult parseAndValidate (GraphQLSchema graphQLSchema , ExecutionInput executionInput ) {
44+ public static ParseAndValidateResult parseAndValidate (@ NotNull GraphQLSchema graphQLSchema , @ NotNull ExecutionInput executionInput ) {
4445 ParseAndValidateResult result = parse (executionInput );
4546 if (!result .isFailure ()) {
4647 List <ValidationError > errors = validate (graphQLSchema , result .getDocument (), executionInput .getLocale ());
@@ -56,7 +57,7 @@ public static ParseAndValidateResult parseAndValidate(GraphQLSchema graphQLSchem
5657 *
5758 * @return a result object that indicates how this operation went
5859 */
59- public static ParseAndValidateResult parse (ExecutionInput executionInput ) {
60+ public static ParseAndValidateResult parse (@ NotNull ExecutionInput executionInput ) {
6061 try {
6162 //
6263 // we allow the caller to specify new parser options by context
@@ -80,7 +81,7 @@ public static ParseAndValidateResult parse(ExecutionInput executionInput) {
8081 *
8182 * @return a result object that indicates how this operation went
8283 */
83- public static List <ValidationError > validate (GraphQLSchema graphQLSchema , Document parsedDocument , Locale locale ) {
84+ public static List <ValidationError > validate (@ NotNull GraphQLSchema graphQLSchema , @ NotNull Document parsedDocument , @ NotNull Locale locale ) {
8485 return validate (graphQLSchema , parsedDocument , ruleClass -> true , locale );
8586 }
8687
@@ -92,7 +93,7 @@ public static List<ValidationError> validate(GraphQLSchema graphQLSchema, Docume
9293 *
9394 * @return a result object that indicates how this operation went
9495 */
95- public static List <ValidationError > validate (GraphQLSchema graphQLSchema , Document parsedDocument ) {
96+ public static List <ValidationError > validate (@ NotNull GraphQLSchema graphQLSchema , @ NotNull Document parsedDocument ) {
9697 return validate (graphQLSchema , parsedDocument , ruleClass -> true , Locale .getDefault ());
9798 }
9899
@@ -106,7 +107,7 @@ public static List<ValidationError> validate(GraphQLSchema graphQLSchema, Docume
106107 *
107108 * @return a result object that indicates how this operation went
108109 */
109- public static List <ValidationError > validate (GraphQLSchema graphQLSchema , Document parsedDocument , Predicate <Class <?>> rulePredicate , Locale locale ) {
110+ public static List <ValidationError > validate (@ NotNull GraphQLSchema graphQLSchema , @ NotNull Document parsedDocument , @ NotNull Predicate <Class <?>> rulePredicate , @ NotNull Locale locale ) {
110111 Validator validator = new Validator ();
111112 return validator .validateDocument (graphQLSchema , parsedDocument , rulePredicate , locale );
112113 }
@@ -120,7 +121,7 @@ public static List<ValidationError> validate(GraphQLSchema graphQLSchema, Docume
120121 *
121122 * @return a result object that indicates how this operation went
122123 */
123- public static List <ValidationError > validate (GraphQLSchema graphQLSchema , Document parsedDocument , Predicate <Class <?>> rulePredicate ) {
124+ public static List <ValidationError > validate (@ NotNull GraphQLSchema graphQLSchema , @ NotNull Document parsedDocument , @ NotNull Predicate <Class <?>> rulePredicate ) {
124125 Validator validator = new Validator ();
125126 return validator .validateDocument (graphQLSchema , parsedDocument , rulePredicate , Locale .getDefault ());
126127 }
0 commit comments