|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Digia\GraphQL\Execution; |
|
4
|
|
|
|
|
5
|
|
|
use Digia\GraphQL\GraphQL; |
|
6
|
|
|
use Digia\GraphQL\Language\Node\ArgumentsAwareInterface; |
|
7
|
|
|
use Digia\GraphQL\Language\Node\VariableDefinitionNode; |
|
8
|
|
|
use Digia\GraphQL\Type\Definition\Directive; |
|
9
|
|
|
use Digia\GraphQL\Type\Definition\DirectiveInterface; |
|
10
|
|
|
use Digia\GraphQL\Type\Definition\Field; |
|
11
|
|
|
use Digia\GraphQL\Schema\SchemaInterface; |
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* @param SchemaInterface $schema |
|
15
|
|
|
* @param VariableDefinitionNode[] $nodes |
|
16
|
|
|
* @param array $inputs |
|
17
|
|
|
* @return array |
|
18
|
|
|
*/ |
|
19
|
|
|
function coerceVariableValues(SchemaInterface $schema, array $nodes, array $inputs): CoercedValue |
|
20
|
|
|
{ |
|
21
|
|
|
return GraphQL::make(ValuesHelper::class)->coerceVariableValues($schema, $nodes, $inputs); |
|
22
|
|
|
} |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* @param Field|Directive $definition |
|
26
|
|
|
* @param ArgumentsAwareInterface $node |
|
27
|
|
|
* @param array $variableValues |
|
28
|
|
|
* @return array |
|
29
|
|
|
*/ |
|
30
|
|
|
function coerceArgumentValues($definition, ArgumentsAwareInterface $node, array $variableValues = []): array |
|
31
|
|
|
{ |
|
32
|
|
|
return GraphQL::make(ValuesHelper::class)->coerceArgumentValues($definition, $node, $variableValues); |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* @param DirectiveInterface $directive |
|
37
|
|
|
* @param mixed $node |
|
38
|
|
|
* @param array $variableValues |
|
39
|
|
|
* @return array|null |
|
40
|
|
|
*/ |
|
41
|
|
|
function coerceDirectiveValues(Directive $directive, $node, array $variableValues = []): ?array |
|
42
|
|
|
{ |
|
43
|
|
|
return GraphQL::make(ValuesHelper::class)->coerceDirectiveValues($directive, $node, $variableValues); |
|
44
|
|
|
} |
|
45
|
|
|
|