abstract class SubscriptionPluginBase in GraphQL 8.3
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\graphql\Plugin\GraphQL\Subscriptions\SubscriptionPluginBase implements SubscriptionPluginInterface uses ArgumentAwarePluginTrait, DeprecatablePluginTrait, DescribablePluginTrait, TypedPluginTrait
Expanded class hierarchy of SubscriptionPluginBase
1 file declares its use of SubscriptionPluginBase
- MockGraphQLPluginTrait.php in tests/
src/ Traits/ MockGraphQLPluginTrait.php
File
- src/
Plugin/ GraphQL/ Subscriptions/ SubscriptionPluginBase.php, line 14
Namespace
Drupal\graphql\Plugin\GraphQL\SubscriptionsView source
abstract class SubscriptionPluginBase extends PluginBase implements SubscriptionPluginInterface {
use TypedPluginTrait;
use DescribablePluginTrait;
use ArgumentAwarePluginTrait;
use DeprecatablePluginTrait;
/**
* {@inheritdoc}
*/
public static function createInstance(SchemaBuilderInterface $builder, SubscriptionPluginManager $manager, $definition, $id) {
return [
'description' => $definition['description'],
'deprecationReason' => $definition['deprecationReason'],
'type' => $builder
->processType($definition['type']),
'args' => $builder
->processArguments($definition['args']),
'resolve' => function ($value, $args, $context, $info) use ($manager, $id) {
$instance = $manager
->getInstance([
'id' => $id,
]);
return call_user_func_array([
$instance,
'resolve',
], [
$value,
$args,
$context,
$info,
]);
},
];
}
/**
* {@inheritdoc}
*/
public function getDefinition() {
$definition = $this
->getPluginDefinition();
return [
'type' => $this
->buildType($definition),
'description' => $this
->buildDescription($definition),
'args' => $this
->buildArguments($definition),
'deprecationReason' => $this
->buildDeprecationReason($definition),
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ArgumentAwarePluginTrait:: |
protected | function | Builds an argument's default value. | |
ArgumentAwarePluginTrait:: |
protected | function | Builds an argument's description. | |
ArgumentAwarePluginTrait:: |
protected | function | Builds the list of arguments. | |
ArgumentAwarePluginTrait:: |
protected | function | Builds an argument's type. | |
DeprecatablePluginTrait:: |
protected | function | ||
DescribablePluginTrait:: |
protected | function | ||
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
PluginBase:: |
public | function | Constructs a \Drupal\Component\Plugin\PluginBase object. | 92 |
SubscriptionPluginBase:: |
public static | function |
Overrides SubscriptionPluginInterface:: |
|
SubscriptionPluginBase:: |
public | function |
Returns the plugin's type or field definition for the schema. Overrides SubscriptionPluginInterface:: |
|
TypedPluginTrait:: |
protected | function |