spring-projects / spring-graphql

Spring Integration for GraphQL
https://spring.io/projects/spring-graphql
Apache License 2.0
1.54k stars 306 forks source link

return null field as blank string #1043

Closed hebrd closed 3 months ago

hebrd commented 3 months ago

I have a type

type Dict {
...
updateUser: Int
...
}
public class DictEntity {
@Schema(

        name = "updateUser",
        nullable = true
    )
    private Long updateUser;

}

When the updateUser is null, the returned json is blank string "", how can I return null instead of ""?

{
          "code": " I am code",
          "createTime": "2024-08-07T23:08:07",
          "updateUser": "",
          "orgId": 1
        }