File tree Expand file tree Collapse file tree
src/main/java/graphql/validation Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package graphql .validation ;
22
3-
43import com .google .common .collect .ImmutableMap ;
54import graphql .ErrorType ;
65import graphql .GraphQLError ;
1716import java .util .Map ;
1817import java .util .stream .Collectors ;
1918
19+ import static graphql .Assert .assertNotNull ;
20+
2021@ PublicApi
2122@ NullMarked
2223public class ValidationError implements GraphQLError {
@@ -29,7 +30,7 @@ public class ValidationError implements GraphQLError {
2930
3031 private ValidationError (Builder builder ) {
3132 this .validationErrorType = builder .validationErrorType ;
32- this .description = builder .description ;
33+ this .description = assertNotNull ( builder .description , "description is required" ) ;
3334 if (builder .sourceLocations != null ) {
3435 this .locations .addAll (builder .sourceLocations );
3536 }
@@ -106,7 +107,6 @@ public int hashCode() {
106107 return GraphqlErrorHelper .hashCode (this );
107108 }
108109
109-
110110 public static Builder newValidationError () {
111111 return new Builder ();
112112 }
@@ -119,7 +119,6 @@ public static class Builder {
119119 private ValidationErrorClassification validationErrorType ;
120120 private List <String > queryPath ;
121121
122-
123122 public Builder validationErrorType (ValidationErrorClassification validationErrorType ) {
124123 this .validationErrorType = validationErrorType ;
125124 return this ;
You can’t perform that action at this time.
0 commit comments