Automattic\WooCommerce\Api\Infrastructure
ResolverHelpers::execute_command
Execute a command's execute() method, translating any thrown exceptions into spec-compliant GraphQL errors.
Method of the class: ResolverHelpers{}
No Hooks.
Returns
Mixed. The return value of execute().
Usage
$result = ResolverHelpers::execute_command( $command, $execute_args ): mixed;
- $command(object) (required)
- The command instance (must have an execute() method).
- $execute_args(array) (required)
- Named arguments to pass to execute().
ResolverHelpers::execute_command() ResolverHelpers::execute command code WC 10.9.1
public static function execute_command( object $command, array $execute_args ): mixed {
return self::translate_exceptions(
static fn() => $command->execute( ...$execute_args )
);
}