public function executeBatch(ServerConfig $config, array $operations)
    {
        $promiseAdapter = $config->getPromiseAdapter() ?: Executor::getPromiseAdapter();
        $result         = [];

        foreach ($operations as $operation) {
            $result[] = $this->promiseToExecuteOperation($promiseAdapter, $config, $operation, true);
        }

        $result = $promiseAdapter->all($result);

        // Wait for promised results when using sync promises
        if ($promiseAdapter instanceof SyncPromiseAdapter) {
            $result = $promiseAdapter->wait($result);
        }

        return $result;
    }
public function executeBatch(ServerConfig $config, array $operations)
    {
        $promiseAdapter = $config->getPromiseAdapter() ?: Executor::getPromiseAdapter();
        $result         = [];

        foreach ($operations as $operation) {
            $result[] = $this->promiseToExecuteOperation($promiseAdapter, $config, $operation, true);
        }

        $result = $promiseAdapter->all($result);

        
        if ($promiseAdapter instanceof SyncPromiseAdapter) {
            $result = $promiseAdapter->wait($result);
        }

        return $result;
    }
public function executeBatch ( ServerConfig $ config , array $ operations ) { $ promiseAdapter = $ config -> getPromiseAdapter ( ) ? : Executor :: getPromiseAdapter ( ) ; $ result = [ ] ; foreach ( $ operations as $ operation ) { $ result [ ] = $ this -> promiseToExecuteOperation ( $ promiseAdapter , $ config , $ operation , true ) ; } $ result = $ promiseAdapter -> all ( $ result ) ; // Wait for promised results when using sync promises if ( $ promiseAdapter instanceof SyncPromiseAdapter ) { $ result = $ promiseAdapter -> wait ( $ result ) ; } return $ result ; }
Executes batched GraphQL operations with shared promise queue
(thus, effectively batching deferreds|promises of all queries at once)

@param OperationParams[] $operations

@return ExecutionResult|ExecutionResult[]|Promise

@api
Executes batched GraphQL operations with shared promise queue ( thus effectively batching deferreds|promises of all queries at once )