Automattic\WooCommerce\Vendor\GraphQL\Executor

ReferenceExecutor::doExecutepublicWC 1.0

Method of the class: ReferenceExecutor{}

No Hooks.

Returns

null. Nothing (null).

Usage

$ReferenceExecutor = new ReferenceExecutor();
$ReferenceExecutor->doExecute(): Promise;

ReferenceExecutor::doExecute() code WC 10.9.1

public function doExecute(): Promise
{
    // Return a Promise that will eventually resolve to the data described by
    // the "Response" section of the Automattic\WooCommerce\Vendor\GraphQL specification.
    //
    // If errors are encountered while executing a Automattic\WooCommerce\Vendor\GraphQL field, only that
    // field and its descendants will be omitted, and sibling fields will still
    // be executed. An execution which encounters errors will still result in a
    // resolved Promise.
    $data = $this->executeOperation($this->exeContext->operation, $this->exeContext->rootValue);
    $result = $this->buildResponse($data);

    // Note: we deviate here from the reference implementation a bit by always returning promise
    // But for the "sync" case it is always fulfilled

    $promise = $this->getPromise($result);
    if ($promise !== null) {
        return $promise;
    }

    return $this->exeContext->promiseAdapter->createFulfilled($result);
}