You are here

public function GraphQLConfigOverrides::loadOverrides in GraphQL 8.3

Returns config overrides.

Parameters

array $names: A list of configuration names that are being loaded.

Return value

array An array keyed by configuration name of override data. Override data contains a nested array structure of overrides.

Overrides ConfigFactoryOverrideInterface::loadOverrides

File

src/Config/GraphQLConfigOverrides.php, line 46

Class

GraphQLConfigOverrides
GraphQL config overrides.

Namespace

Drupal\graphql\Config

Code

public function loadOverrides($names) {
  if ($this->negotiatorManager && in_array('language.types', $names) && $this->negotiatorManager
    ->hasDefinition('language-graphql') && ($config = $this->baseStorage
    ->read('language.types'))) {
    foreach (array_keys($config['negotiation']) as $type) {
      $config['negotiation'][$type]['enabled']['language-graphql'] = -999;
      asort($config['negotiation'][$type]['enabled']);
    }
    return [
      'language.types' => $config,
    ];
  }
  return [];
}