Simplify behavior of FieldResponse#getError
to only return the first field error
#524
Labels
type: enhancement
A general enhancement
Uh oh!
There was an error while loading. Please reload this page.
While
getErrors
inFieldResponse
simply returns all field errors, by contrastgetError
does a more exhaustive search that also includes global, request errors too, but only if the field is "failed" (i.e. has no value). So if the field has both a value and nested field errors, thengetError
would returnnull
whilegetErrors
would be non-empty.We should align the two by making
getError
return the first field error. Separately, one still has the option to check if the field has a value or not, if theGraphQlResponse
has global, request errors.The text was updated successfully, but these errors were encountered: