public function Bike::applies in GraphQL 8.3
Checks whether this type applies to a given object.
Parameters
mixed $object: The object to check against.
\Drupal\graphql\GraphQL\Execution\ResolveContext $context: The resolve context.
\GraphQL\Type\Definition\ResolveInfo $info: The resolve info object.
Return value
null|bool TRUE if this type applies to the given object or FALSE if it doesn't.
Overrides TypePluginBase::applies
File
- tests/
modules/ graphql_plugin_test/ src/ Plugin/ GraphQL/ Types/ Bike.php, line 23
Class
- Bike
- A bike type.
Namespace
Drupal\graphql_plugin_test\Plugin\GraphQL\TypesCode
public function applies($object, ResolveContext $context, ResolveInfo $info) {
return $object['type'] == 'Bike';
}