for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Date: 17.05.16
*
* @author Portey Vasil <[email protected]>
*/
namespace Youshido\GraphQL\Relay\Fetcher;
class CallableFetcher implements FetcherInterface
{
/** @var callable */
protected $resolveNodeCallable;
protected $resolveTypeCallable;
public function __construct(callable $resolveNode, callable $resolveType)
$this->resolveNodeCallable = $resolveNode;
$this->resolveTypeCallable = $resolveType;
}
* @inheritdoc
public function resolveNode($type, $id)
$callable = $this->resolveNodeCallable;
return $callable($type, $id);
public function resolveType($object)
$callable = $this->resolveTypeCallable;
return $callable($object);