for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Retour plugin for Craft CMS 3.x
*
* Retour allows you to intelligently redirect legacy URLs, so that you don't
* lose SEO value when rebuilding & restructuring a website
* @link https://nystudio107.com/
* @copyright Copyright (c) 2019 nystudio107
*/
namespace nystudio107\retour\gql\types;
use nystudio107\retour\gql\interfaces\RetourInterface;
use craft\gql\base\ObjectType;
use GraphQL\Type\Definition\ResolveInfo;
* Class RetourType
* @author nystudio107
* @package Retour
* @since 3.1.26
class RetourType extends ObjectType
{
* @inheritdoc
public function __construct(array $config)
$config['interfaces'] = [
RetourInterface::getType(),
];
parent::__construct($config);
}
protected function resolve($source, $arguments, $context, ResolveInfo $resolveInfo)
$fieldName = $resolveInfo->fieldName;
return $source[$fieldName];