| Conditions | 2 |
| Paths | 3 |
| Total Lines | 29 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function execute( |
||
| 26 | Schema $schema, |
||
| 27 | DocumentNode $documentNode, |
||
| 28 | $rootValue = null, |
||
| 29 | $contextValue = null, |
||
| 30 | $variableValues = [], |
||
| 31 | $operationName = null, |
||
| 32 | callable $fieldResolver = null |
||
| 33 | ) : ExecutionResult { |
||
| 34 | try { |
||
| 35 | //@TODO Get context builder from container? |
||
| 36 | $contextBuilder = new ExecutionContextBuilder(); |
||
| 37 | |||
| 38 | $context = $contextBuilder->buildContext( |
||
| 39 | $schema, |
||
| 40 | $documentNode, |
||
| 41 | $rootValue, |
||
| 42 | $contextValue, |
||
| 43 | $variableValues, |
||
| 44 | $operationName, |
||
| 45 | $fieldResolver |
||
| 46 | ); |
||
| 47 | } catch (ExecutionException $error) { |
||
| 48 | return new ExecutionResult(['data' => null], [$error]); |
||
| 49 | } |
||
| 50 | |||
| 51 | $data = $context->getExecutionStrategy()->execute(); |
||
| 52 | |||
| 53 | return new ExecutionResult($data, $context->getErrors()); |
||
| 54 | } |
||
| 56 |