for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Arthem\GraphQLMapper\Schema\Resolve;
use Arthem\GraphQLMapper\Mapping\Field;
use GraphQL\Type\Definition\ObjectType;
use GraphQL\Type\Definition\ResolveInfo;
class PropertyResolver extends SingletonResolver
{
/**
* {@inheritdoc}
*/
public function getName()
return 'property';
}
public function createFunction(array $config, Field $field)
return function ($node, array $arguments, ResolveInfo $info) {
/** @var ObjectType $parentType */
$parentType = $info->parentType;
$field = $parentType->getField($info->fieldName);
$resolveConfig = $field->config['resolve_config'];
return call_user_func([$node, $resolveConfig['method']]);
};