Skip to content

Commit

Permalink
EntityFieldPropertyDeriver overrides parents (#925)
Browse files Browse the repository at this point in the history
EntityFieldPropertyDeriver overrides the parents defined in the GraphQLField-annotation. In RC2, the parents defined in the annotation were added to the array instead of overridden.
  • Loading branch information
SpadXIII authored and pmelab committed Oct 31, 2019
1 parent 038dc82 commit 7d2b82c
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@ protected function getDerivativeDefinitionsFromFieldDefinition(FieldDefinitionIn
$entityType = $this->entityTypeManager->getDefinition($entityTypeId);
$supportsBundles = $entityType->hasKey('bundle');

if (!isset($basePluginDefinition['parents'])) {
$basePluginDefinition['parents'] = [];
}

$parents = [StringHelper::camelCase('field', $entityTypeId, $supportsBundles ? $fieldBundle : '', $fieldName)];
return ["$entityTypeId-$fieldBundle-$fieldName" => [
'parents' => [StringHelper::camelCase('field', $entityTypeId, $supportsBundles ? $fieldBundle : '', $fieldName)],
'parents' => array_merge($parents, $basePluginDefinition['parents']),
] + $basePluginDefinition];
}

return [];
}
}
}

0 comments on commit 7d2b82c

Please sign in to comment.