diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/GetAllowedCustomerAttributes.php b/app/code/Magento/CustomerGraphQl/Model/Customer/GetAllowedCustomerAttributes.php index 76186cc7423c2..0c715a021096b 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Customer/GetAllowedCustomerAttributes.php +++ b/app/code/Magento/CustomerGraphQl/Model/Customer/GetAllowedCustomerAttributes.php @@ -84,9 +84,9 @@ public function execute($attributeKeys, $addRequiredAttributes = false): array $customerDataDummy, CustomerInterface::class ); + $attributeKeys = array_merge($attributeKeys, array_keys($requiredDataAttributes)); } - - $attributeKeys = array_merge($attributeKeys, array_keys($requiredDataAttributes)); + $this->searchCriteriaBuilder->addFilter('attribute_code', $attributeKeys, 'in'); $searchCriteria = $this->searchCriteriaBuilder->create(); try {