Completed
Pull Request — master (#15)
by Christoffer
03:18 queued 01:12
created

graphql()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 7
1
<?php
2
3
namespace Digia\GraphQL;
4
5
use Digia\GraphQL\Execution\Execution;
6
use Digia\GraphQL\Execution\ExecutionResult;
7
use function Digia\GraphQL\Language\parse;
8
use Digia\GraphQL\Type\Schema;
9
10
/**
11
 * @param Schema        $schema
12
 * @param string        $source
13
 * @param null          $rootValue
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $operationName is correct as it would always require null to be passed?
Loading history...
Documentation Bug introduced by
Are you sure the doc-type for parameter $rootValue is correct as it would always require null to be passed?
Loading history...
Documentation Bug introduced by
Are you sure the doc-type for parameter $variableValues is correct as it would always require null to be passed?
Loading history...
Documentation Bug introduced by
Are you sure the doc-type for parameter $contextValue is correct as it would always require null to be passed?
Loading history...
14
 * @param null          $contextValue
15
 * @param null          $variableValues
16
 * @param null          $operationName
17
 * @param callable|null $fieldResolver
18
 * @return ExecutionResult
19
 * @throws Error\GraphQLError
20
 * @throws \Exception
21
 */
22
function graphql(
23
    Schema $schema,
24
    string $source,
25
    $rootValue = null,
26
    $contextValue = null,
27
    $variableValues = null,
28
    $operationName = null,
29
    callable $fieldResolver = null
30
): ExecutionResult {
31
    return Execution::execute(
32
        $schema,
33
        parse($source),
34
        $rootValue,
35
        $contextValue,
36
        $variableValues,
37
        $operationName,
38
        $fieldResolver
39
    );
40
}
41