|
@@ 426-433 (lines=8) @@
|
| 423 |
|
* |
| 424 |
|
* @return mixed |
| 425 |
|
*/ |
| 426 |
|
protected function resolveRootValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
| 427 |
|
$root = $config->getRootValue(); |
| 428 |
|
if (is_callable($root)) { |
| 429 |
|
$root = $root($params, $document, $operation); |
| 430 |
|
} |
| 431 |
|
|
| 432 |
|
return $root; |
| 433 |
|
} |
| 434 |
|
|
| 435 |
|
/** |
| 436 |
|
* @param \GraphQL\Server\ServerConfig $config |
|
@@ 443-450 (lines=8) @@
|
| 440 |
|
* |
| 441 |
|
* @return mixed |
| 442 |
|
*/ |
| 443 |
|
protected function resolveContextValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
| 444 |
|
$context = $config->getContext(); |
| 445 |
|
if (is_callable($context)) { |
| 446 |
|
$context = $context($params, $document, $operation); |
| 447 |
|
} |
| 448 |
|
|
| 449 |
|
return $context; |
| 450 |
|
} |
| 451 |
|
|
| 452 |
|
/** |
| 453 |
|
* @param \GraphQL\Server\ServerConfig $config |