|
@@ 419-426 (lines=8) @@
|
| 416 |
|
* |
| 417 |
|
* @return mixed |
| 418 |
|
*/ |
| 419 |
|
protected function resolveRootValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
| 420 |
|
$root = $config->getRootValue(); |
| 421 |
|
if (is_callable($root)) { |
| 422 |
|
$root = $root($params, $document, $operation); |
| 423 |
|
} |
| 424 |
|
|
| 425 |
|
return $root; |
| 426 |
|
} |
| 427 |
|
|
| 428 |
|
/** |
| 429 |
|
* @param \GraphQL\Server\ServerConfig $config |
|
@@ 436-443 (lines=8) @@
|
| 433 |
|
* |
| 434 |
|
* @return mixed |
| 435 |
|
*/ |
| 436 |
|
protected function resolveContextValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
| 437 |
|
$context = $config->getContext(); |
| 438 |
|
if (is_callable($context)) { |
| 439 |
|
$context = $context($params, $document, $operation); |
| 440 |
|
} |
| 441 |
|
|
| 442 |
|
return $context; |
| 443 |
|
} |
| 444 |
|
|
| 445 |
|
/** |
| 446 |
|
* @param \GraphQL\Server\ServerConfig $config |