You are here

public function QueryProcessor::executeBatch in GraphQL 8.3

Parameters

\GraphQL\Server\ServerConfig $config:

array $params:

Return value

mixed

1 call to QueryProcessor::executeBatch()
QueryProcessor::processQuery in src/GraphQL/Execution/QueryProcessor.php
Processes one or multiple graphql operations.

File

src/GraphQL/Execution/QueryProcessor.php, line 130

Class

QueryProcessor

Namespace

Drupal\graphql\GraphQL\Execution

Code

public function executeBatch(ServerConfig $config, array $params) {
  $adapter = new SyncPromiseAdapter();
  $result = array_map(function ($params) use ($adapter, $config) {
    return $this
      ->executeOperationWithReporting($adapter, $config, $params, TRUE);
  }, $params);
  $result = $adapter
    ->all($result);
  return $adapter
    ->wait($result);
}