Skip to content

Commit

Permalink
Merge pull request #538 from creative-commoners/pulls/5.0/nested-wild…
Browse files Browse the repository at this point in the history
…card-queries

FIX: NestedInputBuilder doesn't work with nested '*'
  • Loading branch information
sabina-talipova authored Jun 22, 2023
2 parents 0e02071 + 6c8d0d7 commit ff11a35
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Schema/Services/NestedInputBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ public function populateSchema(): void

if ($this->fields === Schema::ALL) {
$this->fields = $this->buildAllFieldsConfig($type);
} elseif (isset($this->fields[Schema::ALL]) && $this->fields[Schema::ALL]) {
unset($this->fields[Schema::ALL]);
$this->fields = array_merge($this->fields, $this->buildAllFieldsConfig($type));
}
$this->addInputTypesToSchema($type, $this->fields, null, null, $prefix);
$rootTypeName = $prefix . $this->getTypeName($type);
Expand Down Expand Up @@ -167,10 +164,11 @@ protected function addInputTypesToSchema(
if (!$inputType) {
$inputType = InputType::create($inputTypeName);
}
if (isset($fields[Schema::ALL]) && $fields[Schema::ALL]) {
unset($fields[Schema::ALL]);
$fields = array_merge($fields, $this->buildAllFieldsConfig($type));
}
foreach ($fields as $fieldName => $data) {
if ($fieldName === Schema::ALL) {
$this->buildAllFieldsConfig($type);
}
if ($data === false) {
continue;
}
Expand Down

0 comments on commit ff11a35

Please sign in to comment.