protected function RequestController::handleSingle in GraphQL 8.4
Same name and namespace in other branches
- 8.3 src/Controller/RequestController.php \Drupal\graphql\Controller\RequestController::handleSingle()
Execute a single operation and turn that into a cacheable response.
Parameters
\Drupal\graphql\Entity\ServerInterface $server:
\GraphQL\Server\OperationParams $operation:
Return value
\Drupal\Core\Cache\CacheableJsonResponse
Throws
\Exception
1 call to RequestController::handleSingle()
- RequestController::handleRequest in src/
Controller/ RequestController.php - Handles graphql requests.
File
- src/
Controller/ RequestController.php, line 76
Class
- RequestController
- The main GraphQL request handler that will forward to the responsible server.
Namespace
Drupal\graphql\ControllerCode
protected function handleSingle(ServerInterface $server, OperationParams $operation) {
$result = $server
->executeOperation($operation);
$response = new CacheableJsonResponse($result);
$response
->addCacheableDependency($result);
return $response;
}