You are here

public function Server::executeBatch in GraphQL 8.4

Execute multiple operations as batch on this server.

Parameters

\GraphQL\Server\OperationParams[] $operations:

Return value

\Drupal\graphql\GraphQL\Execution\ExecutionResult[]

Overrides ServerInterface::executeBatch

File

src/Entity/Server.php, line 193

Class

Server
The main GraphQL configuration and request entry point.

Namespace

Drupal\graphql\Entity

Code

public function executeBatch($operations) {

  // We can't leverage parallel processing of batched queries because of the
  // contextual properties of Drupal (e.g. language manager, current user).
  return array_map(function (OperationParams $operation) {
    return $this
      ->executeOperation($operation);
  }, $operations);
}