public function RequestController::handleRequest in GraphQL 8.4
Same name and namespace in other branches
- 8 src/Controller/RequestController.php \Drupal\graphql\Controller\RequestController::handleRequest()
- 8.2 src/Controller/RequestController.php \Drupal\graphql\Controller\RequestController::handleRequest()
- 8.3 src/Controller/RequestController.php \Drupal\graphql\Controller\RequestController::handleRequest()
Handles graphql requests.
Parameters
\Drupal\graphql\Entity\ServerInterface $graphql_server: The server instance.
\GraphQL\Server\OperationParams|\GraphQL\Server\OperationParams[] $operations: The graphql operation(s) to execute.
Return value
\Drupal\Core\Cache\CacheableJsonResponse The JSON formatted response.
Throws
\Exception
File
- src/
Controller/ RequestController.php, line 57
Class
- RequestController
- The main GraphQL request handler that will forward to the responsible server.
Namespace
Drupal\graphql\ControllerCode
public function handleRequest(ServerInterface $graphql_server, $operations) {
if (is_array($operations)) {
return $this
->handleBatch($graphql_server, $operations);
}
/** @var \GraphQL\Server\OperationParams $operations */
return $this
->handleSingle($graphql_server, $operations);
}