<commit_before><?php

namespace ProcessWire\GraphQL\Type\Enum;

use Youshido\GraphQL\Type\Enum\AbstractEnumType;
use ProcessWire\Field;

class SelectableOptionEnumType extends AbstractEnumType {

	function __construct(Field $field)
	{
		$this->field = $field;
		parent::__construct([]);
	}

	public function getValues()
	{
		$options = [];
		foreach ($this->field->type->getOptions($this->field) as $option) {
			$options[] = [
				'value' => $option->value,
				'name' => $option->title,
			];
		}
		return $options;
	}

}<commit_msg>Fallback selectable option value to "title" if value is not provided.<commit_after><?php

namespace ProcessWire\GraphQL\Type\Enum;

use Youshido\GraphQL\Type\Enum\AbstractEnumType;
use ProcessWire\Field;

class SelectableOptionEnumType extends AbstractEnumType {

	function __construct(Field $field)
	{
		$this->field = $field;
		parent::__construct([]);
	}

	public function getValues()
	{
		$options = [];
		foreach ($this->field->type->getOptions($this->field) as $option) {
			$options[] = [
				'value' => $option->value || $option->title,
				'name' => $option->title,
			];
		}
		return $options;
	}

}
{'fraction_non_alphanumeric': 0.1590909090909091, 'fraction_numerical': 0.0, 'mean_word_length': 4.325581395348837, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7047835', 'n_tokens_mistral': 420, 'n_tokens_neox': 380, 'n_words': 75}