@@ 241-248 (lines=8) @@ | ||
238 | * |
|
239 | * @return callable|mixed |
|
240 | */ |
|
241 | protected function resolveRootValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
|
242 | $root = $config->getRootValue(); |
|
243 | if (is_callable($root)) { |
|
244 | $root = $root($params, $document, $operation); |
|
245 | } |
|
246 | ||
247 | return $root; |
|
248 | } |
|
249 | ||
250 | /** |
|
251 | * @param \GraphQL\Server\ServerConfig $config |
|
@@ 258-265 (lines=8) @@ | ||
255 | * |
|
256 | * @return callable|mixed |
|
257 | */ |
|
258 | protected function resolveContextValue(ServerConfig $config, OperationParams $params, DocumentNode $document, $operation) { |
|
259 | $context = $config->getContext(); |
|
260 | if (is_callable($context)) { |
|
261 | $context = $context($params, $document, $operation); |
|
262 | } |
|
263 | ||
264 | return $context; |
|
265 | } |
|
266 | ||
267 | /** |
|
268 | * @param \GraphQL\Server\ServerConfig $config |