@@ 289-296 (lines=8) @@ | ||
286 | * |
|
287 | * @return mixed |
|
288 | */ |
|
289 | protected function resolveRootValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
|
290 | $root = $config->getRootValue(); |
|
291 | if (is_callable($root)) { |
|
292 | $root = $root($params, $document, $operation); |
|
293 | } |
|
294 | ||
295 | return $root; |
|
296 | } |
|
297 | ||
298 | /** |
|
299 | * @param \GraphQL\Server\ServerConfig $config |
|
@@ 306-313 (lines=8) @@ | ||
303 | * |
|
304 | * @return mixed |
|
305 | */ |
|
306 | protected function resolveContextValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
|
307 | $context = $config->getContext(); |
|
308 | if (is_callable($context)) { |
|
309 | $context = $context($params, $document, $operation); |
|
310 | } |
|
311 | ||
312 | return $context; |
|
313 | } |
|
314 | ||
315 | /** |
|
316 | * @param \GraphQL\Server\ServerConfig $config |