Skip to content

Commit 97d10d2

Browse files
andimarekclaude
andcommitted
Fix NullAway errors and adapt to master's naming conventions after rebase
- Add @nullable annotations for QueryComplexityLimits parameters - Replace shouldRunNonFragmentSpreadChecks() with shouldRunDocumentLevelRules() - Replace fragmentSpreadVisitDepth with fragmentRetraversalDepth Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c496ac1 commit 97d10d2

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

src/main/java/graphql/ParseAndValidate.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import graphql.validation.Validator;
1313
import org.jspecify.annotations.NonNull;
1414
import org.jspecify.annotations.NullMarked;
15+
import org.jspecify.annotations.Nullable;
1516

1617
import java.util.List;
1718
import java.util.Locale;
@@ -133,7 +134,7 @@ public static List<ValidationError> validate(@NonNull GraphQLSchema graphQLSchem
133134
*
134135
* @return a result object that indicates how this operation went
135136
*/
136-
public static List<ValidationError> validate(@NonNull GraphQLSchema graphQLSchema, @NonNull Document parsedDocument, @NonNull Predicate<OperationValidationRule> rulePredicate, @NonNull Locale locale, QueryComplexityLimits limits) {
137+
public static List<ValidationError> validate(@NonNull GraphQLSchema graphQLSchema, @NonNull Document parsedDocument, @NonNull Predicate<OperationValidationRule> rulePredicate, @NonNull Locale locale, @Nullable QueryComplexityLimits limits) {
137138
Validator validator = new Validator();
138139
return validator.validateDocument(graphQLSchema, parsedDocument, rulePredicate, locale, limits);
139140
}

src/main/java/graphql/introspection/GoodFaithIntrospection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public static boolean containsIntrospectionFields(Document document) {
125125
*
126126
* @return complexity limits with good faith bounds applied
127127
*/
128-
public static QueryComplexityLimits goodFaithLimits(QueryComplexityLimits existing) {
128+
public static QueryComplexityLimits goodFaithLimits(@Nullable QueryComplexityLimits existing) {
129129
if (existing == null) {
130130
existing = QueryComplexityLimits.getDefaultLimits();
131131
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ private void checkGoodFaithIntrospection(Field field) {
624624
// Check query-level introspection fields (__schema, __type).
625625
// Only counted at the structural level (not during fragment traversal) to match ENO merging
626626
// behavior where the same field from a direct selection and a fragment spread merge into one.
627-
if (shouldRunNonFragmentSpreadChecks()) {
627+
if (shouldRunDocumentLevelRules()) {
628628
GraphQLObjectType queryType = validationContext.getSchema().getQueryType();
629629
if (queryType != null && parentType.getName().equals(queryType.getName())) {
630630
if ("__schema".equals(fieldName) || "__type".equals(fieldName)) {

src/main/java/graphql/validation/ValidationContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public ValidationContext(GraphQLSchema schema, Document document, I18n i18n) {
3939
this(schema, document, i18n, null);
4040
}
4141

42-
public ValidationContext(GraphQLSchema schema, Document document, I18n i18n, QueryComplexityLimits limits) {
42+
public ValidationContext(GraphQLSchema schema, Document document, I18n i18n, @Nullable QueryComplexityLimits limits) {
4343
this.schema = schema;
4444
this.document = document;
4545
this.traversalContext = new TraversalContext(schema);

0 commit comments

Comments
 (0)