@@ 369-376 (lines=8) @@ | ||
366 | * |
|
367 | * @return mixed |
|
368 | */ |
|
369 | protected function resolveRootValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
|
370 | $root = $config->getRootValue(); |
|
371 | if (is_callable($root)) { |
|
372 | $root = $root($params, $document, $operation); |
|
373 | } |
|
374 | ||
375 | return $root; |
|
376 | } |
|
377 | ||
378 | /** |
|
379 | * @param \GraphQL\Server\ServerConfig $config |
|
@@ 386-393 (lines=8) @@ | ||
383 | * |
|
384 | * @return mixed |
|
385 | */ |
|
386 | protected function resolveContextValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
|
387 | $context = $config->getContext(); |
|
388 | if (is_callable($context)) { |
|
389 | $context = $context($params, $document, $operation); |
|
390 | } |
|
391 | ||
392 | return $context; |
|
393 | } |
|
394 | ||
395 | /** |
|
396 | * @param \GraphQL\Server\ServerConfig $config |