You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The toEntity and toEntityList methods throw FieldAccessException if the field is null, with the idea that a field either has a value, or otherwise is set to null in case of a field error. This is true generally, but a field could also be null without any errors, e.g. if it is optional.
For 1.1 we'll refine toEntity in ClientResponseField to return null if the field value is null, but response is neither invalid, nor there are field errors. Likewise toEntityList to return an empty list in the same scenario.
Note that a similar change was made for GraphQlClient#retrieve some time ago, in 3c30376, so this would align the two. The retrieve method actually delegates to ClientResponseField#toEntity internally but needs to perform a more strict check for field errors even when a field value is present, because with retrieve the response is not used directly, and such errors would be missed otherwise.
The text was updated successfully, but these errors were encountered:
The
toEntity
andtoEntityList
methods throwFieldAccessException
if the field isnull
, with the idea that a field either has a value, or otherwise is set tonull
in case of a field error. This is true generally, but a field could also benull
without any errors, e.g. if it is optional.For 1.1 we'll refine
toEntity
inClientResponseField
to returnnull
if the field value is null, but response is neither invalid, nor there are field errors. LikewisetoEntityList
to return an empty list in the same scenario.Note that a similar change was made for
GraphQlClient#retrieve
some time ago, in 3c30376, so this would align the two. Theretrieve
method actually delegates toClientResponseField#toEntity
internally but needs to perform a more strict check for field errors even when a field value is present, because withretrieve
the response is not used directly, and such errors would be missed otherwise.The text was updated successfully, but these errors were encountered: