You are here

function graphql_uninstall in GraphQL 8.3

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

Implements hook_uninstall().

File

./graphql.install, line 26

Code

function graphql_uninstall() {

  // 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();
}