for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Drupal\graphql\GraphQL\Type;
use Drupal\graphql\Plugin\GraphQL\Types\TypePluginBase;
use Drupal\graphql\Plugin\GraphQL\TypeSystemPluginReferenceInterface;
use Drupal\graphql\Plugin\GraphQL\TypeSystemPluginReferenceTrait;
use Youshido\GraphQL\Config\Object\ObjectTypeConfig;
use Youshido\GraphQL\Type\Object\AbstractObjectType;
class ObjectType extends AbstractObjectType implements TypeSystemPluginReferenceInterface {
use TypeSystemPluginReferenceTrait;
/**
* The associated type system plugin.
*
* @var \Drupal\graphql\Plugin\GraphQL\Types\TypePluginBase
*/
protected $plugin;
* {@inheritdoc}
public function __construct(TypePluginBase $plugin, array $config = []) {
$this->plugin = $plugin;
$this->config = new ObjectTypeConfig($config, $this, TRUE);
}
public function getName() {
return $this->getConfigValue('name');
* Checks whether this type applies to a given object.
* @param mixed $object
* The object to check against.
* @return bool
* TRUE if this type applies to the given object, FALSE otherwise.
public function applies($object) {
return $this->plugin->applies($object);
public function build($config) {
// Nothing to do here.