for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Date: 03.12.15
*
* @author Portey Vasil <[email protected]>
*/
namespace Youshido\GraphQL\Introspection;
use Youshido\GraphQL\Type\Config\TypeConfigInterface;
use Youshido\GraphQL\Type\Field\Field;
use Youshido\GraphQL\Type\Object\AbstractObjectType;
use Youshido\GraphQL\Type\TypeMap;
class FieldType extends AbstractObjectType
{
protected function build(TypeConfigInterface $config)
$config
->addField('name', TypeMap::TYPE_STRING)
->addField('description', TypeMap::TYPE_STRING)
->addField('isDeprecated', TypeMap::TYPE_BOOLEAN)
->addField('deprecationReason', TypeMap::TYPE_STRING)
->addField('type', new QueryType(), [
'resolve' => function($value, $args) {
$args
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
/** @var $value Field */
if($value->getConfig()->getType()->getKind() == TypeMap::KIND_INPUT_OBJECT) {
return $value->getConfig()->getType()->getConfig()->getOutputType();
}
return $value->getType();
])
->addField('args', new InputValueListType());
public function resolve($value = null, $args = [])
* @return String type name
public function getName()
return '__Field';
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.