Automattic\WooCommerce\Vendor\GraphQL\Executor
Executor::defaultFieldResolver
If a resolve function is not given, then a default resolve behavior is used which takes the property of the root value of the same name as the field and returns it as the result, or if it's a function, returns the result of calling that function while passing along args and context.
Method of the class: Executor{}
No Hooks.
Returns
Mixed.
Usage
$result = Executor::defaultFieldResolver( $objectLikeValue, $args, $contextValue, $info );
- $objectLikeValue(mixed) (required)
- .
- $args(array) (required)
- .
- $contextValue(mixed) (required)
- .
- $info(ResolveInfo) (required)
- .
Executor::defaultFieldResolver() Executor::defaultFieldResolver code WC 10.9.1
public static function defaultFieldResolver($objectLikeValue, array $args, $contextValue, ResolveInfo $info)
{
$property = Utils::extractKey($objectLikeValue, $info->fieldName);
return $property instanceof \Closure
? $property($objectLikeValue, $args, $contextValue, $info)
: $property;
}