Skip to content

Commit dbbcdb1

Browse files
committed
magento/graphql-ce#910: [Customer] Deprecate group_id in Customer
1 parent 01e5ab5 commit dbbcdb1

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

app/code/Magento/CustomerGraphQl/Model/Customer/ExtractCustomerData.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ public function execute(CustomerInterface $customer): array
101101
}
102102
}
103103
$customerData = array_merge($customerData, $customAttributes);
104-
104+
//Field is deprecated and should not be exposed on storefront.
105+
$customerData['group_id'] = null;
105106
$customerData['model'] = $customer;
106107
return $customerData;
107108
}

app/code/Magento/CustomerGraphQl/Model/Customer/GetCustomer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,6 @@ public function execute(ContextInterface $context): CustomerInterface
9292
if ($confirmationStatus === AccountManagementInterface::ACCOUNT_CONFIRMATION_REQUIRED) {
9393
throw new GraphQlAuthenticationException(__("This account isn't confirmed. Verify and try again."));
9494
}
95-
return $customer->setGroupId(null);
95+
return $customer;
9696
}
9797
}

app/code/Magento/CustomerGraphQl/etc/schema.graphqls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ type RevokeCustomerTokenOutput {
7878

7979
type Customer @doc(description: "Customer defines the customer name and address and other details") {
8080
created_at: String @doc(description: "Timestamp indicating when the account was created")
81-
group_id: Int @doc(description: "The group assigned to the user. Default values are 0 (Not logged in), 1 (General), 2 (Wholesale), and 3 (Retailer)") @deprecated(reason: "Customer group should not be exposed in the storefront scenarios.")
81+
group_id: Int @deprecated(reason: "Customer group should not be exposed in the storefront scenarios")
8282
prefix: String @doc(description: "An honorific, such as Dr., Mr., or Mrs.")
8383
firstname: String @doc(description: "The customer's first name")
8484
middlename: String @doc(description: "The customer's middle name")

0 commit comments

Comments
 (0)