public function SchemaOverviewController::listSchemas in GraphQL 8.3
Renders a table of available schemas.
Return value
array The renderable array for the overview table.
1 string reference to 'SchemaOverviewController::listSchemas'
File
- src/
Controller/ SchemaOverviewController.php, line 58
Class
Namespace
Drupal\graphql\ControllerCode
public function listSchemas() {
$table = [
'#type' => 'table',
'#header' => [
$this
->t('Schema'),
$this
->t('Provider'),
$this
->t('Operations'),
],
'#attributes' => [
'id' => 'graphql-schemas',
],
];
foreach ($this->schemaManager
->getDefinitions() as $key => $definition) {
$table["schema:{$key}"]['name'] = [
'#plain_text' => $definition['name'],
];
$table["schema:{$key}"]['provider'] = [
'#plain_text' => $this->moduleHandler
->getName($definition['provider']),
];
$table["schema:{$key}"]['operations'] = $this
->buildOperations($key, $definition);
}
return $table;
}