You are here

protected function QueryProcessor::executeOperationWithReporting in GraphQL 8.3

Parameters

\GraphQL\Executor\Promise\PromiseAdapter $adapter:

\GraphQL\Server\ServerConfig $config:

\GraphQL\Server\OperationParams $params:

bool $batching:

Return value

\GraphQL\Executor\Promise\Promise

2 calls to QueryProcessor::executeOperationWithReporting()
QueryProcessor::executeBatch in src/GraphQL/Execution/QueryProcessor.php
QueryProcessor::executeSingle in src/GraphQL/Execution/QueryProcessor.php

File

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

Class

QueryProcessor

Namespace

Drupal\graphql\GraphQL\Execution

Code

protected function executeOperationWithReporting(PromiseAdapter $adapter, ServerConfig $config, OperationParams $params, $batching = FALSE) {
  $result = $this
    ->executeOperation($adapter, $config, $params, $batching);

  // Format and print errors.
  return $result
    ->then(function (QueryResult $result) use ($config) {
    if ($config
      ->getErrorsHandler()) {
      $result
        ->setErrorsHandler($config
        ->getErrorsHandler());
    }
    if ($config
      ->getErrorFormatter() || $config
      ->getDebug()) {
      $result
        ->setErrorFormatter(FormattedError::prepareFormatter($config
        ->getErrorFormatter(), $config
        ->getDebug()));
    }
    return $result;
  });
}