public function ExplorerController::viewExplorer in GraphQL 8.2
Same name and namespace in other branches
- 8.4 src/Controller/ExplorerController.php \Drupal\graphql\Controller\ExplorerController::viewExplorer()
- 8 src/Controller/ExplorerController.php \Drupal\graphql\Controller\ExplorerController::viewExplorer()
- 8.3 src/Controller/ExplorerController.php \Drupal\graphql\Controller\ExplorerController::viewExplorer()
Controller for the GraphiQL query builder IDE.
Return value
array The render array.
1 string reference to 'ExplorerController::viewExplorer'
File
- src/
Controller/ ExplorerController.php, line 49
Class
- ExplorerController
- Controller for the GraphiQL query builder IDE.
Namespace
Drupal\graphql\ControllerCode
public function viewExplorer() {
$url = $this->urlGenerator
->generate('graphql.request');
return [
'#type' => 'page',
'#theme' => 'page__graphql_explorer',
'#attached' => [
'library' => [
'graphql/explorer',
],
'drupalSettings' => [
'graphQLRequestUrl' => $url,
],
],
];
}