NullType.php in GraphQL 8
Same filename and directory in other branches
Namespace
Drupal\graphqlFile
src/NullType.phpView source
<?php
namespace Drupal\graphql;
use Fubhy\GraphQL\Language\Node;
use Fubhy\GraphQL\Type\Definition\Types\ScalarType;
class NullType extends ScalarType {
protected $name = 'Null';
/**
* @param mixed $value
*
* @return mixed
*/
public function coerce($value) {
return NULL;
}
/**
* @param \Fubhy\GraphQL\Language\Node $value
*
* @return mixed
*/
public function coerceLiteral(Node $value) {
return 'null';
}
}