Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion graphql.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,6 @@ services:

graphql.config_factory_override:
class: Drupal\graphql\Config\GraphQLConfigOverrides
arguments: ['@config.storage', '@plugin.manager.language_negotiation_method']
arguments: ['@config.storage', '@?plugin.manager.language_negotiation_method']
tags:
- { name: config.factory.override, priority: -253 }
6 changes: 4 additions & 2 deletions src/Config/GraphQLConfigOverrides.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class GraphQLConfigOverrides implements ConfigFactoryOverrideInterface {
/**
* The negotiator manager service.
*
* @var \Drupal\language\LanguageNegotiationMethodManager
* @var \Drupal\language\LanguageNegotiationMethodManager|null
*/
protected $negotiatorManager;

Expand All @@ -33,8 +33,9 @@ class GraphQLConfigOverrides implements ConfigFactoryOverrideInterface {
*
* @param \Drupal\Core\Config\StorageInterface $storage
* The config storage service.
* @param \Drupal\language\LanguageNegotiationMethodManager|null $negotiatorManager
*/
public function __construct(StorageInterface $storage, LanguageNegotiationMethodManager $negotiatorManager) {
public function __construct(StorageInterface $storage, LanguageNegotiationMethodManager $negotiatorManager = NULL) {
$this->baseStorage = $storage;
$this->negotiatorManager = $negotiatorManager;
}
Expand All @@ -44,6 +45,7 @@ public function __construct(StorageInterface $storage, LanguageNegotiationMethod
*/
public function loadOverrides($names) {
if (
$this->negotiatorManager &&
in_array('language.types', $names)
&& $this->negotiatorManager->hasDefinition('language-graphql')
&& $config = $this->baseStorage->read('language.types')
Expand Down