Skip to content

Commit

Permalink
Properly handle unmapped view types.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxhov committed Dec 19, 2024
1 parent bcd84c6 commit b66ace0
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,14 @@ public void applyFetches(DataFetchingEnvironment dataFetchingEnvironment, Entity
}
continue;
}
String mappedFieldPart = typeNameToFieldMapping.get(typeName).get(fieldName);

Map<String, String> typeMapping = typeNameToFieldMapping.get(typeName);
if (typeMapping == null) {
throw new IllegalArgumentException(
"No type is registered for the name: " + typeName);
}

String mappedFieldPart = typeMapping.get(fieldName);
if (mappedFieldPart == null) {
// fieldName cannot be mapped to an entity view field, probably because it's a non-DB field with a default -> ignore the whole field
continue OUTER;
Expand Down

0 comments on commit b66ace0

Please sign in to comment.