ImageResourceUrl::resolveValues()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 2
rs 10
cc 1
nc 1
nop 4
1
<?php
2
3
namespace Drupal\graphql_core\Plugin\GraphQL\Fields\Images;
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 the image url.
11
 *
12
 * @GraphQLField(
13
 *   id = "image_style_url",
14
 *   secure = true,
15
 *   name = "url",
16
 *   type = "String",
17
 *   parents = {"ImageResource"},
18
 *   provider = "image"
19
 * )
20
 */
21
class ImageResourceUrl extends FieldPluginBase {
22
23
  /**
24
   * {@inheritdoc}
25
   */
26
  protected function resolveValues($value, array $args, ResolveContext $context, ResolveInfo $info) {
27
    yield $value['url'];
28
  }
29
30
}
31