class Any in GraphQL 8.3
Plugin annotation
@GraphQLScalar(
id = "any",
name = "Any",
type = "any",
deriver = "Drupal\graphql_core\Plugin\Deriver\Scalars\TypedDataPrimitiveFallback"
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\graphql\Plugin\GraphQL\Scalars\ScalarPluginBase implements TypePluginInterface uses CacheablePluginTrait, DescribablePluginTrait
- class \Drupal\graphql_core\Plugin\GraphQL\Scalars\TypedData\Any
- class \Drupal\graphql\Plugin\GraphQL\Scalars\ScalarPluginBase implements TypePluginInterface uses CacheablePluginTrait, DescribablePluginTrait
Expanded class hierarchy of Any
File
- modules/
graphql_core/ src/ Plugin/ GraphQL/ Scalars/ TypedData/ Any.php, line 15
Namespace
Drupal\graphql_core\Plugin\GraphQL\Scalars\TypedDataView source
class Any extends ScalarPluginBase {
/**
* {@inheritdoc}
*/
public static function serialize($value) {
if (is_scalar($value)) {
return $value;
}
if (is_array($value)) {
return json_encode($value);
}
if (is_object($value) && method_exists($value, '__toString')) {
return (string) $value;
}
return '';
}
/**
* {@inheritdoc}
*/
public static function parseValue($value) {
return $value;
}
/**
* {@inheritdoc}
*/
public static function parseLiteral($ast) {
return $ast->value;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Any:: |
public static | function |
Parses a node. Overrides ScalarPluginBase:: |
|
Any:: |
public static | function |
Parses a value. Overrides ScalarPluginBase:: |
|
Any:: |
public static | function |
Serializes the scalar value. Overrides ScalarPluginBase:: |
|
CacheablePluginTrait:: |
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 |
ScalarPluginBase:: |
public static | function |
Overrides TypePluginInterface:: |
6 |
ScalarPluginBase:: |
public | function |
Returns the plugin's type or field definition for the schema. Overrides TypePluginInterface:: |