-
Notifications
You must be signed in to change notification settings - Fork 201
/
graphql.module
46 lines (40 loc) · 933 Bytes
/
graphql.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?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>$title</h3>
$description
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',
],
];
}