-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Comparing changes
Open a pull request
base repository: graphql-java/graphql-java
base: master
head repository: graphql-java/graphql-java
compare: validation-refactor
- 11 commits
- 85 files changed
- 3 contributors
Commits on Jan 27, 2026
-
Consolidate 31 validation rule classes into single OperationValidator
Replace the AbstractRule + RulesVisitor + 31 individual rule class architecture with a single OperationValidator class that implements DocumentVisitor directly. BREAKING CHANGE: The rule filtering predicate type changes from Predicate<Class<?>> to Predicate<OperationValidationRule> in Validator, ParseAndValidate, and GraphQL. Code that filters validation rules by class reference must migrate to the new OperationValidationRule enum. - Create OperationValidationRule enum with 31 values (one per rule) - Create OperationValidator implementing DocumentVisitor with all validation logic consolidated from the 31 rule classes - Simplify Validator to create OperationValidator directly - Update ParseAndValidate and GraphQL predicate types - Delete AbstractRule, RulesVisitor, and all 31 rule classes (keep VariablesTypesMatcher as utility) - Convert all test files from mock-based rule instantiation to integration tests or OperationValidator with rule predicates - Update JMH benchmarks Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 8884d2d - Browse repository at this point
Copy the full SHA 8884d2dView commit details
Commits on Jan 28, 2026
-
Restore 10 test coverage gaps lost during validation refactor
Add integration tests replacing removed mock-based tests: - Per-operation fragment visiting (RulesVisitorTest) - Invalid input object field, list, nested list, and simple list types (ArgumentsOfCorrectTypeTest) - Null value for non-null input object field (ArgumentsOfCorrectTypeTest) - Unknown type on inline fragment not triggering composite type error (FragmentsOnCompositeTypeTest) - Directive argument scope isolation (KnownArgumentNamesTest) - Defaulted non-null field and directive arguments (ProvidedNonNullArgumentsTest) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for b3e3f3e - Browse repository at this point
Copy the full SHA b3e3f3eView commit details -
Move VariablesTypesMatcher and all validation tests from rules sub-pa…
…ckage 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>
Configuration menu - View commit details
-
Copy full SHA for 1f6d39d - Browse repository at this point
Copy the full SHA 1f6d39dView commit details
Commits on Jan 29, 2026
-
Improve OperationValidator documentation and naming
- Rename methods for clarity: - shouldRunNonFragmentSpreadChecks() -> shouldRunDocumentLevelRules() - shouldRunFragmentSpreadChecks() -> shouldRunOperationScopedRules() - fragmentSpreadVisitDepth -> fragmentRetraversalDepth - Add comprehensive class Javadoc explaining: - Two independent state variables and their three valid combinations - Visual matrices showing when each rule category runs - Step-by-step traversal example with state at each step - Add detailed Javadoc to OperationValidationRule enum categorizing all rules by their traversal behavior - Simplify code by removing duplicate checks and redundant comments Co-authored-by: Cursor <cursoragent@cursor.com>
Configuration menu - View commit details
-
Copy full SHA for 142bad7 - Browse repository at this point
Copy the full SHA 142bad7View commit details -
Remove redundant shouldRunDocumentLevelRules() checks
These checks are always true in methods that are only called at document level (depth=0): - checkDocument(): Document node visited once at start - checkOperationDefinition(): Operations are never inside fragments - checkVariableDefinition(): Variable definitions only exist in operations - documentFinished(): Called when leaving Document Co-authored-by: Cursor <cursoragent@cursor.com>
Configuration menu - View commit details
-
Copy full SHA for 72b2828 - Browse repository at this point
Copy the full SHA 72b2828View commit details -
Add JSpecify @NullMarked annotations to ValidationContext and Operati…
…onValidator ValidationContext: - Add @NullMarked at class level - Add @nullable to methods that can return null based on traversal state: getFragment, getParentType, getInputType, getDefaultValue, getFieldDef, getDirective, getArgument, getOutputType, getQueryPath OperationValidator: - Add @NullMarked at class level - Add @nullable to methods that can return null: getQueryPath, requireSameNameAndArguments, findArgumentByName, requireSameOutputTypeShape - Add @nullable to parameters that can be null: addError (SourceLocation), mkNotSameTypeError (typeA, typeB), overlappingFieldsImpl, overlappingFields_collectFields, overlappingFields_collectFieldsForInlineFragment, overlappingFields_collectFieldsForField, sameType, sameArguments - Add @nullable to fields that can be null: variableDefinitionMap, FieldAndType.graphQLType Co-authored-by: Cursor <cursoragent@cursor.com>
Configuration menu - View commit details
-
Copy full SHA for e0c5f0b - Browse repository at this point
Copy the full SHA e0c5f0bView commit details -
Add JSpecify @NullMarked annotations to TraversalContext
- Add @NullMarked at class level - Add @nullable to fields: directive, argument - Add @nullable to public methods that can return null: getOutputType, getParentType, getInputType, getDefaultValue, getFieldDef, getQueryPath, getDirective, getArgument - Add @nullable to private methods that can return null: lastElement, find, getFieldDef(schema, parentType, field), getNullableType - Add @nullable to parameters that accept null: addOutputType, addParentType, addInputType, addDefaultValue, addFieldDef, getNullableType Co-authored-by: Cursor <cursoragent@cursor.com>
Configuration menu - View commit details
-
Copy full SHA for b65e8c3 - Browse repository at this point
Copy the full SHA b65e8c3View commit details
Commits on Feb 13, 2026
-
Merge origin/master into validation-refactor
Fix NullAway errors from master's @NullMarked additions to GraphQLSchema and GraphQLTypeUtil. Add null checks in OperationValidator and TraversalContext for nullable getCodeRegistry(), unwrapAll(), and type comparison methods. Update JSpecifyAnnotationsCheck exemption list to match master's annotated classes, removing deleted DeferDirective rule entries. Add @NullMarked to ParseAndValidate to match master.
Configuration menu - View commit details
-
Copy full SHA for 23dd3db - Browse repository at this point
Copy the full SHA 23dd3dbView commit details
Commits on Feb 15, 2026
-
Optimize validation hot paths to reduce collection overhead
Replace HashMap/LinkedHashMap allocations with linear scans for small argument lists, single-pass partitioning in groupByCommonParents, pre-sized maps, computeIfAbsent, HashSet for fragment tracking, and ArrayList over LinkedList. Short-circuit isRuleEnabled when all rules are enabled. ~12% improvement on ValidatorBenchmark (largeSchema4: 7.86→6.94ms, manyFragments: 5.83→5.16ms). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 7a4e1fb - Browse repository at this point
Copy the full SHA 7a4e1fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for c0b4b1c - Browse repository at this point
Copy the full SHA c0b4b1cView commit details -
Remove unnecessary null checks on getCodeRegistry()
GraphQLSchema.getCodeRegistry() is no longer @nullable, so these guards are unnecessary. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 051f73d - Browse repository at this point
Copy the full SHA 051f73dView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff master...validation-refactor