Automattic\WooCommerce\Vendor\GraphQL\Executor
Executor::promiseToExecute
Same as execute(), but requires promise adapter and returns a promise which is always fulfilled with an instance of ExecutionResult and never rejected.
Useful for async PHP platforms.
Method of the class: Executor{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = Executor::promiseToExecute( $promiseAdapter, $schema, $documentNode, $rootValue, $contextValue, ?array $variableValues, ?string $operationName, ?callable $fieldResolver, ?callable $argsMapper ): Promise;
- $promiseAdapter(PromiseAdapter) (required)
- .
- $schema(Schema) (required)
- .
- $documentNode(DocumentNode) (required)
- .
- $rootValue(mixed)
- .
Default:null - $contextValue(mixed)
- .
Default:null - ?array $variableValues
- .
Default:null - ?string $operationName
- .
Default:null - ?callable $fieldResolver
- .
Default:null - ?callable $argsMapper
- .
Default:null
Executor::promiseToExecute() Executor::promiseToExecute code WC 10.9.1
public static function promiseToExecute(
PromiseAdapter $promiseAdapter,
Schema $schema,
DocumentNode $documentNode,
$rootValue = null,
$contextValue = null,
?array $variableValues = null,
?string $operationName = null,
?callable $fieldResolver = null,
?callable $argsMapper = null
): Promise {
$executor = (self::$implementationFactory)(
$promiseAdapter,
$schema,
$documentNode,
$rootValue,
$contextValue,
$variableValues ?? [],
$operationName,
$fieldResolver ?? self::$defaultFieldResolver,
$argsMapper ?? self::$defaultArgsMapper,
);
return $executor->doExecute();
}