You are here

protected function RequestController::handleSingle in GraphQL 8.3

Same name and namespace in other branches
  1. 8.4 src/Controller/RequestController.php \Drupal\graphql\Controller\RequestController::handleSingle()

Parameters

$schema:

$operations:

array $globals:

Return value

\Drupal\Core\Cache\CacheableJsonResponse

Throws

\Drupal\Component\Plugin\Exception\PluginException

1 call to RequestController::handleSingle()
RequestController::handleRequest in src/Controller/RequestController.php
Handles graphql requests.

File

src/Controller/RequestController.php, line 81

Class

RequestController
Handles GraphQL requests.

Namespace

Drupal\graphql\Controller

Code

protected function handleSingle($schema, $operations) {
  $result = $this->processor
    ->processQuery($schema, $operations);
  $response = new CacheableJsonResponse($result);
  $response
    ->addCacheableDependency($result);
  return $response;
}