|
@@ -42,7 +42,7 @@ discard block |
|
|
block discarded – undo |
|
42
|
42
|
return new InputObjectType([ |
|
43
|
43
|
'name' => $targetEntity->getTypeName() . '_Input', |
|
44
|
44
|
'description' => $targetEntity->getDescription(), |
|
45
|
|
- 'fields' => function () use ($id, $targetEntity, $requiredFields, $optionalFields): array { |
|
|
45
|
+ 'fields' => function() use ($id, $targetEntity, $requiredFields, $optionalFields): array { |
|
46
|
46
|
$fields = []; |
|
47
|
47
|
|
|
48
|
48
|
foreach ($this->entityManager->getClassMetadata($id)->getFieldNames() as $fieldName) { |
|
@@ -51,7 +51,7 @@ discard block |
|
|
block discarded – undo |
|
51
|
51
|
* no reason to set or update an identifier. For the case where an identifier |
|
52
|
52
|
* should be set or updated, this facotry is not the correct solution. |
|
53
|
53
|
*/ |
|
54
|
|
- if (! empty($optionalFields)) { |
|
|
54
|
+ if (!empty($optionalFields)) { |
|
55
|
55
|
// Include field as optional |
|
56
|
56
|
if (in_array($fieldName, $optionalFields) || $optionalFields === ['*']) { |
|
57
|
57
|
if ($optionalFields === ['*'] && $this->entityManager->getClassMetadata($id)->isIdentifier($fieldName)) { |
|
@@ -61,7 +61,7 @@ discard block |
|
|
block discarded – undo |
|
61
|
61
|
$fields[$fieldName]['description'] = $targetEntity->getMetadataConfig()['fields'][$fieldName]['description']; |
|
62
|
62
|
$fields[$fieldName]['type'] = $this->typeManager->get($targetEntity->getMetadataConfig()['fields'][$fieldName]['type']); |
|
63
|
63
|
} |
|
64
|
|
- } elseif (! empty($requiredFields)) { |
|
|
64
|
+ } elseif (!empty($requiredFields)) { |
|
65
|
65
|
// Include fields as required |
|
66
|
66
|
if (in_array($fieldName, $requiredFields) || $requiredFields === ['*']) { |
|
67
|
67
|
if ($requiredFields === ['*'] && $this->entityManager->getClassMetadata($id)->isIdentifier($fieldName)) { |