Skip to content

Commit fa5613b

Browse files
committed
GraphQL-375: Customer can get shipping/billing address data of any other customer
1 parent 1301a42 commit fa5613b

File tree

4 files changed

+6
-279
lines changed

4 files changed

+6
-279
lines changed

app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
namespace Magento\QuoteGraphQl\Model\Cart;
99

10-
use Magento\Customer\Api\Data\AddressInterface;
1110
use Magento\CustomerGraphQl\Model\Customer\CheckCustomerAccount;
12-
use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException;
1311
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
1412
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
1513
use Magento\Quote\Api\Data\CartInterface;
@@ -64,18 +62,13 @@ public function __construct(
6462
}
6563

6664
/**
67-
* @inheritdoc
65+
* Set billing address for a specified shopping cart
6866
*
6967
* @param ContextInterface $context
7068
* @param CartInterface $cart
7169
* @param array $billingAddress
72-
* @throws GraphQlAuthorizationException
70+
* @return void
7371
* @throws GraphQlInputException
74-
* @throws \Magento\Framework\Exception\InputException
75-
* @throws \Magento\Framework\Exception\LocalizedException
76-
* @throws \Magento\Framework\Exception\NoSuchEntityException
77-
* @throws \Magento\Framework\GraphQl\Exception\GraphQlAuthenticationException
78-
* @throws \Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException
7972
*/
8073
public function execute(ContextInterface $context, CartInterface $cart, array $billingAddress): void
8174
{

app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressOnCart.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
namespace Magento\QuoteGraphQl\Model\Cart;
99

1010
use Magento\CustomerGraphQl\Model\Customer\CheckCustomerAccount;
11-
use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException;
1211
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
1312
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
1413
use Magento\Quote\Api\Data\CartInterface;
@@ -64,13 +63,7 @@ public function __construct(
6463
* @param ContextInterface $context
6564
* @param CartInterface $cart
6665
* @param array $shippingAddresses
67-
* @throws GraphQlAuthorizationException
6866
* @throws GraphQlInputException
69-
* @throws \Magento\Framework\Exception\InputException
70-
* @throws \Magento\Framework\Exception\LocalizedException
71-
* @throws \Magento\Framework\Exception\NoSuchEntityException
72-
* @throws \Magento\Framework\GraphQl\Exception\GraphQlAuthenticationException
73-
* @throws \Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException
7467
*/
7568
public function execute(ContextInterface $context, CartInterface $cart, array $shippingAddresses): void
7669
{

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

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ input SetShippingMethodsOnCartInput {
6565

6666
input ShippingMethodForAddressInput {
6767
cart_address_id: Int!
68-
shipping_carrier_code: String!
69-
shipping_method_code: String!
68+
carrier_code: String!
69+
method_code: String!
7070
}
7171

7272
type SetBillingAddressOnCartOutput {
@@ -117,7 +117,7 @@ type CartAddress {
117117
country: CartAddressCountry
118118
telephone: String
119119
address_type: AdressTypeEnum
120-
selected_shipping_method: ShippingMethod
120+
selected_shipping_method: SelectedShippingMethod
121121
available_shipping_methods: [AvailableShippingMethod] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAdress\\AvailableShippingMethods")
122122
items_weight: Float
123123
customer_notes: String
@@ -139,15 +139,8 @@ type CartAddressCountry {
139139
label: String
140140
}
141141

142-
type ShippingMethod {
143-
code: String
144-
label: String
145-
free_shipping: Boolean!
146-
error_message: String
142+
type SelectedShippingMethod {
147143
amount: Float!
148-
base_amount: Float!
149-
amount_incl_tax: Float!
150-
base_amount_incl_tax: Float!
151144
}
152145

153146
type AvailableShippingMethod {

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingMethodOnCartTest.php

Lines changed: 0 additions & 252 deletions
This file was deleted.

0 commit comments

Comments
 (0)