LanguageSwitchLinkActive.php in GraphQL 8.3
File
modules/graphql_core/src/Plugin/GraphQL/Fields/LanguageSwitch/LanguageSwitchLinkActive.php
View source
<?php
namespace Drupal\graphql_core\Plugin\GraphQL\Fields\LanguageSwitch;
use Drupal\graphql\GraphQL\Execution\ResolveContext;
use Drupal\graphql\Plugin\GraphQL\Fields\FieldPluginBase;
use GraphQL\Type\Definition\ResolveInfo;
class LanguageSwitchLinkActive extends FieldPluginBase {
protected function resolveValues($value, array $args, ResolveContext $context, ResolveInfo $info) {
$context = $value['context'];
$language = $value['link']['language'];
(yield $context
->getId() === $language
->getId());
}
}
Classes
Name |
Description |
LanguageSwitchLinkActive |
Plugin annotation
@GraphQLField(
id = "language_switch_link_active",
secure = true,
name = "active",
type = "Boolean",
parents = {"LanguageSwitchLink"}
) |