Skip to content

Commit 647628a

Browse files
andrewbessAndrii Beziazychnyi
authored andcommitted
Backward Compatibility fixes
1 parent d4e5894 commit 647628a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

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

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

88
namespace Magento\QuoteGraphQl\Model\Resolver;
99

10+
use Magento\Framework\App\ObjectManager;
1011
use Magento\Framework\Exception\CouldNotSaveException;
1112
use Magento\Framework\GraphQl\Config\Element\Field;
1213
use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException;
@@ -50,19 +51,21 @@ class MergeCarts implements ResolverInterface
5051
/**
5152
* @param GetCartForUser $getCartForUser
5253
* @param CartRepositoryInterface $cartRepository
53-
* @param CustomerCartResolver $customerCartResolver
54-
* @param QuoteIdToMaskedQuoteIdInterface $quoteIdToMaskedQuoteId
54+
* @param CustomerCartResolver|null $customerCartResolver
55+
* @param QuoteIdToMaskedQuoteIdInterface|null $quoteIdToMaskedQuoteId
5556
*/
5657
public function __construct(
5758
GetCartForUser $getCartForUser,
5859
CartRepositoryInterface $cartRepository,
59-
CustomerCartResolver $customerCartResolver,
60-
QuoteIdToMaskedQuoteIdInterface $quoteIdToMaskedQuoteId
60+
CustomerCartResolver $customerCartResolver = null,
61+
QuoteIdToMaskedQuoteIdInterface $quoteIdToMaskedQuoteId = null
6162
) {
6263
$this->getCartForUser = $getCartForUser;
6364
$this->cartRepository = $cartRepository;
64-
$this->customerCartResolver = $customerCartResolver;
65-
$this->quoteIdToMaskedQuoteId = $quoteIdToMaskedQuoteId;
65+
$this->customerCartResolver = $customerCartResolver
66+
?: ObjectManager::getInstance()->get(CustomerCartResolver::class);
67+
$this->quoteIdToMaskedQuoteId = $quoteIdToMaskedQuoteId
68+
?: ObjectManager::getInstance()->get(QuoteIdToMaskedQuoteIdInterface::class);
6669
}
6770

6871
/**

0 commit comments

Comments
 (0)