You are here

graphql.module in GraphQL 8.4

Same filename and directory in other branches
  1. 8 graphql.module
  2. 8.2 graphql.module
  3. 8.3 graphql.module

Primary module hooks for GraphQL module.

File

graphql.module
View 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

Namesort descending Description
graphql_help Implements hook_help().
graphql_theme Implements hook_theme().