mirror of
https://github.com/retailcrm/graphql-php.git
synced 2025-02-06 07:49:24 +03:00
Added missing short-hand notation for input type fields
This commit is contained in:
parent
8f80389ecf
commit
443845d1f9
@ -55,7 +55,11 @@ class InputObjectType extends Type implements InputType
|
||||
$fields = isset($this->config['fields']) ? $this->config['fields'] : [];
|
||||
$fields = is_callable($fields) ? call_user_func($fields) : $fields;
|
||||
foreach ($fields as $name => $field) {
|
||||
$this->fields[$name] = new InputObjectField($field + ['name' => $name]);
|
||||
if ($field instanceof Type) {
|
||||
$field = ['type' => $field];
|
||||
}
|
||||
$field = new InputObjectField($field + ['name' => $name]);
|
||||
$this->fields[$field->name] = $field;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user