Handle Null values in GraphQL Response Spring GraphQL Client
I am using Spring Graphql Client HttpSyncGraphQlClient to make GraphQL Request and able to get Response.
Leveraging toEntityList() to convert the response to respective DTO’s for further processing
Issue observed when few fields values are null which are optional.
Getting Exception when the response has null for that field. Googled and tried few of links/suggestions which i came across but no luck.
Any suggestions how to handle these null values and convert to Object without issues.
Any references on how to solve this could be helpful.
Exception Says: java.lang.NullPointerException: can not invoke “x.y.z.getChildContainter()” because the return value of “x.y.z.getParentContainter()” is null
Read more here: Source link
