You are here

NullType.php in GraphQL 8.2

Same filename and directory in other branches
  1. 8 src/NullType.php

Namespace

Drupal\graphql

File

src/NullType.php
View 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';
  }

}

Classes

Namesort descending Description
NullType