PersistedQueryPluginBase.php in GraphQL 8.4
File
src/PersistedQuery/PersistedQueryPluginBase.php
View source
<?php
namespace Drupal\graphql\PersistedQuery;
use Drupal\Core\Plugin\PluginBase;
use Drupal\graphql\Plugin\PersistedQueryPluginInterface;
abstract class PersistedQueryPluginBase extends PluginBase implements PersistedQueryPluginInterface {
public function getConfiguration() {
return $this->configuration;
}
public function setConfiguration(array $configuration) : void {
$this->configuration = $configuration + $this
->defaultConfiguration();
}
public function defaultConfiguration() {
return [];
}
public function label() {
$plugin_definition = $this
->getPluginDefinition();
return $plugin_definition['label'];
}
public function getDescription() {
$plugin_definition = $this
->getPluginDefinition();
return isset($plugin_definition['description']) ? $plugin_definition['description'] : '';
}
public function getWeight() {
if (isset($this->configuration['weight'])) {
return $this->configuration['weight'];
}
return 0;
}
public function setWeight($weight) : void {
$this->configuration['weight'] = $weight;
}
}