Skip to content

Commit 1f6d39d

Browse files
andimarekclaude
andcommitted
Move VariablesTypesMatcher and all validation tests from rules sub-package to validation package
The rules sub-package is no longer needed since all 31 rule classes were consolidated into OperationValidator. Move the remaining utility class (VariablesTypesMatcher) and all 32 test files into the parent graphql.validation package, then delete the empty rules directories. Also remove stale JSpecifyAnnotationsCheck entries for deleted rule classes and update comments referencing the old package. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b3e3f3e commit 1f6d39d

38 files changed

+37
-41
lines changed

src/main/java/graphql/execution/MergedField.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
* </pre>
6262
* These examples make clear that you need to consider all merged fields together to have the full picture.
6363
* <p>
64-
* The actual logic when fields can be successfully merged together is implemented in {#graphql.validation.rules.OverlappingFieldsCanBeMerged}
64+
* The actual logic when fields can be successfully merged together is implemented in {#graphql.validation.OperationValidator}
6565
*/
6666
@PublicApi
6767
@NullMarked

src/main/java/graphql/normalized/ENFMerger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ private static boolean compareWithoutChildren(ExecutableNormalizedField one, Exe
168168
return true;
169169
}
170170

171-
// copied from graphql.validation.rules.OverlappingFieldsCanBeMerged
171+
// copied from graphql.validation.OperationValidator
172172
private static boolean sameArguments(List<Argument> arguments1, List<Argument> arguments2) {
173173
if (arguments1.size() != arguments2.size()) {
174174
return false;

src/main/java/graphql/normalized/nf/NormalizedFieldsMerger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ private static boolean compareWithoutChildren(NormalizedField one, NormalizedFie
166166
return true;
167167
}
168168

169-
// copied from graphql.validation.rules.OverlappingFieldsCanBeMerged
169+
// copied from graphql.validation.OperationValidator
170170
private static boolean sameArguments(List<Argument> arguments1, List<Argument> arguments2) {
171171
if (arguments1.size() != arguments2.size()) {
172172
return false;

src/main/java/graphql/validation/OperationValidator.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
import graphql.schema.GraphQLUnionType;
5757
import graphql.schema.GraphQLUnmodifiedType;
5858
import graphql.schema.InputValueWithState;
59-
import graphql.validation.rules.VariablesTypesMatcher;
6059
import graphql.util.StringKit;
6160

6261
import java.util.ArrayList;

src/main/java/graphql/validation/rules/VariablesTypesMatcher.java renamed to src/main/java/graphql/validation/VariablesTypesMatcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package graphql.validation.rules;
1+
package graphql.validation;
22

33

44
import graphql.Internal;

src/test/groovy/graphql/archunit/JSpecifyAnnotationsCheck.groovy

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,7 @@ class JSpecifyAnnotationsCheck extends Specification {
325325
"graphql.util.TreeTransformerUtil",
326326
"graphql.validation.ValidationError",
327327
"graphql.validation.ValidationErrorClassification",
328-
"graphql.validation.ValidationErrorType",
329-
"graphql.validation.rules.DeferDirectiveLabel",
330-
"graphql.validation.rules.DeferDirectiveOnRootLevel",
331-
"graphql.validation.rules.DeferDirectiveOnValidOperation"
328+
"graphql.validation.ValidationErrorType"
332329
] as Set
333330

334331
def "ensure all public API and experimental API classes have @NullMarked annotation"() {

src/test/groovy/graphql/validation/rules/ArgumentsOfCorrectTypeTest.groovy renamed to src/test/groovy/graphql/validation/ArgumentsOfCorrectTypeTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package graphql.validation.rules
1+
package graphql.validation
22

33
import graphql.TestUtil
44
import graphql.parser.Parser

src/test/groovy/graphql/validation/rules/DeferDirectiveLabelTest.groovy renamed to src/test/groovy/graphql/validation/DeferDirectiveLabelTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package graphql.validation.rules
1+
package graphql.validation
22

33
import graphql.ExperimentalApi
44
import graphql.i18n.I18n

src/test/groovy/graphql/validation/rules/DeferDirectiveOnRootLevelTest.groovy renamed to src/test/groovy/graphql/validation/DeferDirectiveOnRootLevelTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package graphql.validation.rules
1+
package graphql.validation
22

33
import graphql.ExperimentalApi
44
import graphql.i18n.I18n

src/test/groovy/graphql/validation/rules/DeferDirectiveOnValidOperationTest.groovy renamed to src/test/groovy/graphql/validation/DeferDirectiveOnValidOperationTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package graphql.validation.rules
1+
package graphql.validation
22

33
import graphql.ExperimentalApi
44
import graphql.i18n.I18n

0 commit comments

Comments
 (0)