glesys / butler-graphql

An opinionated GraphQL package for Laravel.
MIT License
34 stars 5 forks source link

Exclusively use the field resolver if one is available. #53

Closed emil-nasso closed 1 year ago

emil-nasso commented 1 year ago

Before this change, the fieldFromArray and fieldFromObject methods were always used to try to resolve a field, even if a specific field resolver was available, if null was returned from the resolver.

Specifying a specific resolver for a field is a way to "override" the custom field resolving behavior (fieldFromArray and fieldFromObject).

With this change, we will take the value from the field resolver as the value for the field, even if the value happens to be null and not continue resolving the source as an array or object.

emil-nasso commented 1 year ago

todo: