|
@@ 275-282 (lines=8) @@
|
| 272 |
|
* |
| 273 |
|
* @return callable|mixed |
| 274 |
|
*/ |
| 275 |
|
protected function resolveRootValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
| 276 |
|
$root = $config->getRootValue(); |
| 277 |
|
if (is_callable($root)) { |
| 278 |
|
$root = $root($params, $document, $operation); |
| 279 |
|
} |
| 280 |
|
|
| 281 |
|
return $root; |
| 282 |
|
} |
| 283 |
|
|
| 284 |
|
/** |
| 285 |
|
* @param \GraphQL\Server\ServerConfig $config |
|
@@ 292-299 (lines=8) @@
|
| 289 |
|
* |
| 290 |
|
* @return callable|mixed |
| 291 |
|
*/ |
| 292 |
|
protected function resolveContextValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
| 293 |
|
$context = $config->getContext(); |
| 294 |
|
if (is_callable($context)) { |
| 295 |
|
$context = $context($params, $document, $operation); |
| 296 |
|
} |
| 297 |
|
|
| 298 |
|
return $context; |
| 299 |
|
} |
| 300 |
|
|
| 301 |
|
/** |
| 302 |
|
* @param \GraphQL\Server\ServerConfig $config |