GraphQL\Type\Definition\EnumType::parseLiteral PHP Method

parseLiteral() public method

public parseLiteral ( $value ) : null
$value
return null
    public function parseLiteral($value)
    {
        if ($value instanceof EnumValueNode) {
            $lookup = $this->getNameLookup();
            if (isset($lookup[$value->value])) {
                $enumValue = $lookup[$value->value];
                if ($enumValue) {
                    return $enumValue->value;
                }
            }
        }
        return null;
    }