public function SchemaPluginManager::getCacheMaxAge in GraphQL 8.3
The maximum age for which this object may be cached.
Return value
int The maximum time in seconds that this object may be cached.
Overrides DefaultPluginManager::getCacheMaxAge
1 call to SchemaPluginManager::getCacheMaxAge()
- SchemaPluginManager::setCachedDefinitions in src/
Plugin/ SchemaPluginManager.php - Sets a cache of plugin definitions for the decorated discovery class.
File
- src/
Plugin/ SchemaPluginManager.php, line 78
Class
Namespace
Drupal\graphql\PluginCode
public function getCacheMaxAge() {
$definitions = $this
->getDefinitions();
$age = Cache::PERMANENT;
foreach ($definitions as $definition) {
if (!isset($definition['schema_cache_max_age'])) {
continue;
}
// Bail out early if the cache max age is 0.
if (($age = Cache::mergeMaxAges($age, $definition['schema_cache_max_age'])) === 0) {
return $age;
}
}
return $age;
}