提交 7f939372 编写于 作者: G Gerrit Meier

Move null condition to top.

上级 e29d1fbc
......@@ -121,6 +121,9 @@ public class ValueMapper {
}
private String mapEnum(MappingContext mappingContext, EnumValue value, Type<?> graphQLType) {
if (graphQLType == null) {
return value.getName();
}
if (graphQLType instanceof TypeName) {
String typeName = ((TypeName) graphQLType).getName();
typeName = DataModelMapper.getModelClassNameWithPrefixAndSuffix(mappingContext, typeName);
......@@ -129,9 +132,6 @@ public class ValueMapper {
if (graphQLType instanceof NonNullType) {
return mapEnum(mappingContext, value, ((NonNullType) graphQLType).getType());
}
if (graphQLType == null) {
return value.getName();
}
throw new IllegalArgumentException("Unexpected Enum value for list type");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册