Automattic\WooCommerce\Vendor\GraphQL\Executor
Executor::execute
Executes DocumentNode against given $schema.
Always returns ExecutionResult and never throws. All errors which occur during operation execution are collected in $result->errors.
Method of the class: Executor{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = Executor::execute( $schema, $documentNode, $rootValue, $contextValue, ?array $variableValues, ?string $operationName, ?callable $fieldResolver ): ExecutionResult;
- $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
Executor::execute() Executor::execute code WC 10.9.1
public static function execute(
Schema $schema,
DocumentNode $documentNode,
$rootValue = null,
$contextValue = null,
?array $variableValues = null,
?string $operationName = null,
?callable $fieldResolver = null
): ExecutionResult {
$promiseAdapter = new SyncPromiseAdapter();
$result = static::promiseToExecute(
$promiseAdapter,
$schema,
$documentNode,
$rootValue,
$contextValue,
$variableValues,
$operationName,
$fieldResolver
);
return $promiseAdapter->wait($result);
}