JsonLeafValue::resolveValues()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 4
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Drupal\graphql_json\Plugin\GraphQL\Fields;
4
5
use Drupal\graphql\GraphQL\Execution\ResolveContext;
6
use Drupal\graphql\Plugin\GraphQL\Fields\FieldPluginBase;
7
use GraphQL\Type\Definition\ResolveInfo;
8
9
/**
10
 * Retrieve json leaf values.
11
 *
12
 * @GraphQLField(
13
 *   id = "json_leaf_value",
14
 *   secure = true,
15
 *   name = "value",
16
 *   type = "String",
17
 *   parents = {"JsonLeaf"}
18
 * )
19
 */
20
class JsonLeafValue extends FieldPluginBase {
21
22
  /**
23
   * {@inheritdoc}
24
   */
25
  public function resolveValues($value, array $args, ResolveContext $context, ResolveInfo $info) {
26
    yield (string) $value;
27
  }
28
29
}
30