mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-22 04:46:04 +03:00
Use name as value for Enums if value wasn't set in definition
This commit is contained in:
parent
9ccfb93ef2
commit
74b922ce68
@ -40,7 +40,7 @@ class EnumType extends Type implements InputType, OutputType
|
|||||||
|
|
||||||
if (!empty($config['values'])) {
|
if (!empty($config['values'])) {
|
||||||
foreach ($config['values'] as $name => $value) {
|
foreach ($config['values'] as $name => $value) {
|
||||||
$this->_values[] = Utils::assign(new EnumValueDefinition(), $value + ['name' => $name]);
|
$this->_values[] = Utils::assign(new EnumValueDefinition(), $value + ['name' => $name, 'value' => $name]); // value will be equal to name only if 'value' is not set in definition
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user