public function ExplorerMenuLinkDeriver::getDerivativeDefinitions in GraphQL 8.4
Same name and namespace in other branches
- 8.3 src/Plugin/MenuLink/Deriver/ExplorerMenuLinkDeriver.php \Drupal\graphql\Plugin\MenuLink\Deriver\ExplorerMenuLinkDeriver::getDerivativeDefinitions()
Gets the definition of all derivatives of a base plugin.
Parameters
array $base_plugin_definition: The definition array of the base plugin.
Return value
array An array of full derivative definitions keyed on derivative id.
Overrides DeriverBase::getDerivativeDefinitions
See also
getDerivativeDefinition()
File
- src/
Plugin/ MenuLink/ Deriver/ ExplorerMenuLinkDeriver.php, line 20
Class
- ExplorerMenuLinkDeriver
- Generates one menu link per GraphQL server for Explorer.
Namespace
Drupal\graphql\Plugin\MenuLink\DeriverCode
public function getDerivativeDefinitions($basePluginDefinition) {
$servers = array_keys(Server::loadMultiple());
foreach ($servers as $id) {
$this->derivatives[$id] = [
'route_name' => "graphql.explorer.{$id}",
'parent' => 'entity.graphql_server.collection',
] + $basePluginDefinition;
}
return $this->derivatives;
}