public function VoyagerController::viewVoyager in GraphQL 8.3
Same name and namespace in other branches
- 8.4 src/Controller/VoyagerController.php \Drupal\graphql\Controller\VoyagerController::viewVoyager()
Display for the GraphQL Voyager visualization API.
Parameters
string $schema: The name of the schema to use.
Return value
array The render array. The render array.
File
- src/
Controller/ VoyagerController.php, line 46
Class
- VoyagerController
- Controller for the GraphQL Voyager visualisation API.
Namespace
Drupal\graphql\ControllerCode
public function viewVoyager($schema) {
$introspectionData = $this->introspection
->introspect($schema);
return [
'#type' => 'page',
'#theme' => 'page__graphql_voyager',
'#attached' => [
'library' => [
'graphql/voyager',
],
'drupalSettings' => [
'graphqlIntrospectionData' => $introspectionData,
],
],
];
}