|
@@ 398-405 (lines=8) @@
|
| 395 |
|
* |
| 396 |
|
* @return mixed |
| 397 |
|
*/ |
| 398 |
|
protected function resolveRootValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
| 399 |
|
$root = $config->getRootValue(); |
| 400 |
|
if (is_callable($root)) { |
| 401 |
|
$root = $root($params, $document, $operation); |
| 402 |
|
} |
| 403 |
|
|
| 404 |
|
return $root; |
| 405 |
|
} |
| 406 |
|
|
| 407 |
|
/** |
| 408 |
|
* @param \GraphQL\Server\ServerConfig $config |
|
@@ 415-422 (lines=8) @@
|
| 412 |
|
* |
| 413 |
|
* @return mixed |
| 414 |
|
*/ |
| 415 |
|
protected function resolveContextValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
| 416 |
|
$context = $config->getContext(); |
| 417 |
|
if (is_callable($context)) { |
| 418 |
|
$context = $context($params, $document, $operation); |
| 419 |
|
} |
| 420 |
|
|
| 421 |
|
return $context; |
| 422 |
|
} |
| 423 |
|
|
| 424 |
|
/** |
| 425 |
|
* @param \GraphQL\Server\ServerConfig $config |