Skip to content

Commit e27544a

Browse files
committed
Fix null type handling regression in requireSameOutputTypeShape
Restore the original null-handling logic that was incorrectly simplified in 072165b. When both typeA and typeB are null (e.g., from fragments on unresolvable types), they should be treated as compatible rather than producing a spurious FieldsConflict error. https://claude.ai/code/session_01XYg9Dqneb941aStgKaZ1Em
1 parent 293b21b commit e27544a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,8 +1241,11 @@ private boolean sameArguments(List<Argument> arguments1, @Nullable List<Argument
12411241
}
12421242
GraphQLType typeA = typeAOriginal;
12431243
GraphQLType typeB = fieldAndType.graphQLType;
1244-
if (typeB == null) {
1245-
return mkNotSameTypeError(path, fields, typeA, typeB);
1244+
if (typeA == null || typeB == null) {
1245+
if (typeA != typeB) {
1246+
return mkNotSameTypeError(path, fields, typeA, typeB);
1247+
}
1248+
continue;
12461249
}
12471250
while (true) {
12481251
if (isNonNull(typeA) || isNonNull(typeB)) {

0 commit comments

Comments
 (0)