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