We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 348a51b commit 9e5f06bCopy full SHA for 9e5f06b
src/main/java/graphql/validation/constraints/standard/SizeConstraint.java
@@ -45,13 +45,17 @@ public boolean appliesToType(GraphQLInputType inputType) {
45
@Override
46
protected List<GraphQLError> runConstraint(ValidationEnvironment validationEnvironment) {
47
Object validatedValue = validationEnvironment.getValidatedValue();
48
+
49
+ if(validatedValue == null) {
50
+ return Collections.emptyList();
51
+ }
52
53
GraphQLInputType argType = validationEnvironment.getValidatedType();
54
55
GraphQLDirective directive = validationEnvironment.getContextObject(GraphQLDirective.class);
56
int min = getIntArg(directive, "min");
57
int max = getIntArg(directive, "max");
-
58
59
int size = getStringOrIDOrObjectOrMapLength(argType, validatedValue);
60
61
if (size < min) {
0 commit comments