@@ 379-386 (lines=8) @@ | ||
376 | * |
|
377 | * @return mixed |
|
378 | */ |
|
379 | protected function resolveRootValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
|
380 | $root = $config->getRootValue(); |
|
381 | if (is_callable($root)) { |
|
382 | $root = $root($params, $document, $operation); |
|
383 | } |
|
384 | ||
385 | return $root; |
|
386 | } |
|
387 | ||
388 | /** |
|
389 | * @param \GraphQL\Server\ServerConfig $config |
|
@@ 396-403 (lines=8) @@ | ||
393 | * |
|
394 | * @return mixed |
|
395 | */ |
|
396 | protected function resolveContextValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
|
397 | $context = $config->getContext(); |
|
398 | if (is_callable($context)) { |
|
399 | $context = $context($params, $document, $operation); |
|
400 | } |
|
401 | ||
402 | return $context; |
|
403 | } |
|
404 | ||
405 | /** |
|
406 | * @param \GraphQL\Server\ServerConfig $config |