You are here

function graphql_uninstall in GraphQL 8.4

Same name and namespace in other branches
  1. 8.3 graphql.install \graphql_uninstall()

Implements hook_uninstall().

File

./graphql.install, line 34
Install, update and uninstall functions for the GraphQL module.

Code

function graphql_uninstall() : void {

  // Remove the config keys set in GraphQLConfigOverrides::loadOverrides().

  /** @var \Drupal\Core\Config\ConfigFactoryInterface $configFactory */
  $configFactory = \Drupal::getContainer()
    ->get('config.factory');
  $languageTypes = $configFactory
    ->getEditable('language.types');
  $negotiation = $languageTypes
    ->get('negotiation');
  foreach (array_keys($negotiation) as $type) {
    unset($negotiation[$type]['enabled']['language-graphql']);
  }
  $languageTypes
    ->set('negotiation', $negotiation)
    ->save();
}