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