public function GraphqlServiceProvider::alter in GraphQL 8.3
Same name and namespace in other branches
- 8.4 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 16
Class
- GraphqlServiceProvider
- GraphQL service provider.
Namespace
Drupal\graphqlCode
public function alter(ContainerBuilder $container) {
// Replace the language negotiator with a fixed one.
// 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(FixedLanguageNegotiator::class);
}
}