graphql.module in GraphQL 8.4
Same filename and directory in other branches
Primary module hooks for GraphQL module.
File
graphql.moduleView source
<?php
/**
* @file
* Primary module hooks for GraphQL module.
*/
/**
* Implements hook_help().
*/
function graphql_help(string $routeName) : ?string {
if ($routeName !== 'help.page.graphql') {
return NULL;
}
$title = t('About');
$description = t('
<p>This module generates and exposes a
<a href="http://graphql.org/" target="_blank">GraphQL</a> schema for
<a href="https://www.drupal.org/8" target="_blank">Drupal 8</a> entities,
and allows you to expose your own custom schema in a consistent way and with
minimal effort.</p>');
$help = <<<EOT
<h3>{<span class="php-variable">$title</span>}</h3>
{<span class="php-variable">$description</span>}
EOT;
return $help;
}
/**
* Implements hook_theme().
*/
function graphql_theme() : array {
return [
'page__graphql_explorer' => [
'render element' => 'elements',
'base hook' => 'block',
],
'page__graphql_voyager' => [
'render element' => 'elements',
'base hook' => 'block',
],
];
}
Functions
Name![]() |
Description |
---|---|
graphql_help | Implements hook_help(). |
graphql_theme | Implements hook_theme(). |