abstract class MutationPluginBase in GraphQL 8.3
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\graphql\Plugin\GraphQL\Mutations\MutationPluginBase implements MutationPluginInterface uses ArgumentAwarePluginTrait, DeprecatablePluginTrait, DescribablePluginTrait, TypedPluginTrait
Expanded class hierarchy of MutationPluginBase
5 files declare their use of MutationPluginBase
- BuyCar.php in tests/
modules/ graphql_plugin_test/ src/ Plugin/ GraphQL/ Mutations/ BuyCar.php - CreateEntityBase.php in modules/
graphql_core/ src/ Plugin/ GraphQL/ Mutations/ Entity/ CreateEntityBase.php - DeleteEntityBase.php in modules/
graphql_core/ src/ Plugin/ GraphQL/ Mutations/ Entity/ DeleteEntityBase.php - MockGraphQLPluginTrait.php in tests/
src/ Traits/ MockGraphQLPluginTrait.php - UpdateEntityBase.php in modules/
graphql_core/ src/ Plugin/ GraphQL/ Mutations/ Entity/ UpdateEntityBase.php
File
- src/
Plugin/ GraphQL/ Mutations/ MutationPluginBase.php, line 14
Namespace
Drupal\graphql\Plugin\GraphQL\MutationsView source
abstract class MutationPluginBase extends PluginBase implements MutationPluginInterface {
use TypedPluginTrait;
use DescribablePluginTrait;
use ArgumentAwarePluginTrait;
use DeprecatablePluginTrait;
/**
* {@inheritdoc}
*/
public static function createInstance(SchemaBuilderInterface $builder, MutationPluginManager $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 | ||
MutationPluginBase:: |
public static | function |
Overrides MutationPluginInterface:: |
|
MutationPluginBase:: |
public | function |
Returns the plugin's type or field definition for the schema. Overrides MutationPluginInterface:: |
|
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 |
TypedPluginTrait:: |
protected | function |