|
7 | 7 |
|
8 | 8 | namespace Magento\QuoteGraphQl\Model\Resolver;
|
9 | 9 |
|
| 10 | +use Magento\Framework\App\ObjectManager; |
10 | 11 | use Magento\Framework\Exception\CouldNotSaveException;
|
11 | 12 | use Magento\Framework\GraphQl\Config\Element\Field;
|
12 | 13 | use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException;
|
@@ -50,19 +51,21 @@ class MergeCarts implements ResolverInterface
|
50 | 51 | /**
|
51 | 52 | * @param GetCartForUser $getCartForUser
|
52 | 53 | * @param CartRepositoryInterface $cartRepository
|
53 |
| - * @param CustomerCartResolver $customerCartResolver |
54 |
| - * @param QuoteIdToMaskedQuoteIdInterface $quoteIdToMaskedQuoteId |
| 54 | + * @param CustomerCartResolver|null $customerCartResolver |
| 55 | + * @param QuoteIdToMaskedQuoteIdInterface|null $quoteIdToMaskedQuoteId |
55 | 56 | */
|
56 | 57 | public function __construct(
|
57 | 58 | GetCartForUser $getCartForUser,
|
58 | 59 | CartRepositoryInterface $cartRepository,
|
59 |
| - CustomerCartResolver $customerCartResolver, |
60 |
| - QuoteIdToMaskedQuoteIdInterface $quoteIdToMaskedQuoteId |
| 60 | + CustomerCartResolver $customerCartResolver = null, |
| 61 | + QuoteIdToMaskedQuoteIdInterface $quoteIdToMaskedQuoteId = null |
61 | 62 | ) {
|
62 | 63 | $this->getCartForUser = $getCartForUser;
|
63 | 64 | $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); |
66 | 69 | }
|
67 | 70 |
|
68 | 71 | /**
|
|
0 commit comments