Completed
Push — master ( ac54ef...b19cf5 )
by Tomáš
01:31
created

SomeMutationField::resolve()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 3
1
<?php
2
3
namespace Portiny\GraphQL\Tests\Source\Provider;
4
5
use GraphQL\Type\Definition\Type;
6
use Portiny\GraphQL\Contract\Mutation\MutationFieldInterface;
7
8
9
class SomeMutationField implements MutationFieldInterface
10
{
11
12
	/**
13
	 * {@inheritdoc}
14
	 */
15
	public function getName(): string
16
	{
17
		return 'someMutationName';
18
	}
19
20
21
	/**
22
	 * {@inheritdoc}
23
	 */
24
	public function getType(): Type
25
	{
26
		return Type::string();
27
	}
28
29
30
	/**
31
	 * {@inheritdoc}
32
	 */
33
	public function getDescription(): string
34
	{
35
		return 'Some description';
36
	}
37
38
39
	/**
40
	 * {@inheritdoc}
41
	 */
42
	public function getArgs(): array
43
	{
44
		return [
45
			'someArg' => ['type' => Type::string()]
46
		];
47
	}
48
49
50
	/**
51
	 * {@inheritdoc}
52
	 */
53
	public function resolve(array $root, array $args, $context = NULL)
54
	{
55
		return $args['someArg'] . ' resolved';
56
	}
57
58
}
59