|
@@ 413-420 (lines=8) @@
|
| 410 |
|
* |
| 411 |
|
* @return mixed |
| 412 |
|
*/ |
| 413 |
|
protected function resolveRootValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
| 414 |
|
$root = $config->getRootValue(); |
| 415 |
|
if (is_callable($root)) { |
| 416 |
|
$root = $root($params, $document, $operation); |
| 417 |
|
} |
| 418 |
|
|
| 419 |
|
return $root; |
| 420 |
|
} |
| 421 |
|
|
| 422 |
|
/** |
| 423 |
|
* @param \GraphQL\Server\ServerConfig $config |
|
@@ 430-437 (lines=8) @@
|
| 427 |
|
* |
| 428 |
|
* @return mixed |
| 429 |
|
*/ |
| 430 |
|
protected function resolveContextValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
| 431 |
|
$context = $config->getContext(); |
| 432 |
|
if (is_callable($context)) { |
| 433 |
|
$context = $context($params, $document, $operation); |
| 434 |
|
} |
| 435 |
|
|
| 436 |
|
return $context; |
| 437 |
|
} |
| 438 |
|
|
| 439 |
|
/** |
| 440 |
|
* @param \GraphQL\Server\ServerConfig $config |