You are here

public function GraphqlServiceProvider::alter in GraphQL 8.4

Same name and namespace in other branches
  1. 8.3 src/GraphqlServiceProvider.php \Drupal\graphql\GraphqlServiceProvider::alter()

Modifies existing service definitions.

Parameters

ContainerBuilder $container: The ContainerBuilder whose service definitions can be altered.

Overrides ServiceProviderBase::alter

File

src/GraphqlServiceProvider.php, line 17

Class

GraphqlServiceProvider
Workaround for Drupal core bug for language sorting.

Namespace

Drupal\graphql

Code

public function alter(ContainerBuilder $container) : void {

  // Can be removed if this is fixed.
  // https://www.drupal.org/project/drupal/issues/2952789
  if ($container
    ->hasDefinition('language_negotiator')) {
    $container
      ->getDefinition('language_negotiator')
      ->setClass(LanguageNegotiator::class);
  }
}