@@ 304-311 (lines=8) @@ | ||
301 | * |
|
302 | * @return callable|mixed |
|
303 | */ |
|
304 | protected function resolveRootValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
|
305 | $root = $config->getRootValue(); |
|
306 | if (is_callable($root)) { |
|
307 | $root = $root($params, $document, $operation); |
|
308 | } |
|
309 | ||
310 | return $root; |
|
311 | } |
|
312 | ||
313 | /** |
|
314 | * @param \GraphQL\Server\ServerConfig $config |
|
@@ 321-328 (lines=8) @@ | ||
318 | * |
|
319 | * @return callable|mixed |
|
320 | */ |
|
321 | protected function resolveContextValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
|
322 | $context = $config->getContext(); |
|
323 | if (is_callable($context)) { |
|
324 | $context = $context($params, $document, $operation); |
|
325 | } |
|
326 | ||
327 | return $context; |
|
328 | } |
|
329 | ||
330 | /** |
|
331 | * @param \GraphQL\Server\ServerConfig $config |