Skip to content

Commit 40cbbfa

Browse files
committed
B2B-2379: Cart is being loaded twice in multiple graphql mutation
1 parent cd826aa commit 40cbbfa

File tree

7 files changed

+0
-8
lines changed

7 files changed

+0
-8
lines changed

app/code/Magento/QuoteGraphQl/Model/Resolver/AddSimpleProductsToCart.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ private function run($context, ?array $args): array
9090
$storeId = (int)$context->getExtensionAttributes()->getStore()->getId();
9191
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId);
9292
$this->addProductsToCart->execute($cart, $cartItems);
93-
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId);
9493

9594
return [
9695
'cart' => [

app/code/Magento/QuoteGraphQl/Model/Resolver/ApplyCouponToCart.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
8585
throw new LocalizedException(__($e->getMessage()), $e);
8686
}
8787

88-
$cart = $this->getCartForUser->execute($maskedCartId, $currentUserId, $storeId);
8988
return [
9089
'cart' => [
9190
'model' => $cart,

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
6969
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId);
7070
$this->checkCartCheckoutAllowance->execute($cart);
7171
$this->setBillingAddressOnCart->execute($context, $cart, $billingAddress);
72-
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId);
7372

7473
return [
7574
'cart' => [

app/code/Magento/QuoteGraphQl/Model/Resolver/SetPaymentMethodOnCart.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
6969
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId);
7070
$this->checkCartCheckoutAllowance->execute($cart);
7171
$this->setPaymentMethodOnCart->execute($cart, $paymentData);
72-
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId);
7372

7473
return [
7574
'cart' => [

app/code/Magento/QuoteGraphQl/Model/Resolver/SetShippingAddressesOnCart.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
6969
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId);
7070
$this->checkCartCheckoutAllowance->execute($cart);
7171
$this->setShippingAddressesOnCart->execute($context, $cart, $shippingAddresses);
72-
// reload updated cart
73-
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId);
7472

7573
return [
7674
'cart' => [

app/code/Magento/QuoteGraphQl/Model/Resolver/SetShippingMethodsOnCart.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
6969
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId);
7070
$this->checkCartCheckoutAllowance->execute($cart);
7171
$this->setShippingMethodsOnCart->execute($context, $cart, $shippingMethods);
72-
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId);
7372

7473
return [
7574
'cart' => [

app/code/Magento/QuoteGraphQl/Model/Resolver/UpdateCartItems.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
9494
throw new GraphQlInputException(__($e->getMessage()), $e);
9595
}
9696

97-
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId);
9897
return [
9998
'cart' => [
10099
'model' => $cart,

0 commit comments

Comments
 (0)