Bike.php in GraphQL 8.3
File
tests/modules/graphql_plugin_test/src/Plugin/GraphQL/Types/Bike.phpView source
<?php
namespace Drupal\graphql_plugin_test\Plugin\GraphQL\Types;
use Drupal\graphql\GraphQL\Execution\ResolveContext;
use Drupal\graphql\Plugin\GraphQL\Types\TypePluginBase;
use GraphQL\Type\Definition\ResolveInfo;
/**
* A bike type.
*
* @GraphQLType(
* id = "bike",
* name = "Bike",
* interfaces = {"Vehicle"}
* )
*/
class Bike extends TypePluginBase {
/**
* {@inheritdoc}
*/
public function applies($object, ResolveContext $context, ResolveInfo $info) {
return $object['type'] == 'Bike';
}
}