Skip to content

Commit 2ac86b4

Browse files
Dnd-Maferglo32232
authored andcommitted
Fix "Cannot return null for non-nullable field \"AppliedCoupon.code\"" error
1 parent 239d499 commit 2ac86b4

File tree

1 file changed

+1
-1
lines changed
  • app/code/Magento/SalesGraphQl/Model/Formatter

1 file changed

+1
-1
lines changed

app/code/Magento/SalesGraphQl/Model/Formatter/Order.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function format(OrderInterface $orderModel): array
5757
'shipping_address' => $this->orderAddress->getOrderShippingAddress($orderModel),
5858
'billing_address' => $this->orderAddress->getOrderBillingAddress($orderModel),
5959
'payment_methods' => $this->orderPayments->getOrderPaymentMethod($orderModel),
60-
'applied_coupons' => $orderModel->getCouponCode() ? ['code' => $orderModel->getCouponCode()] : [],
60+
'applied_coupons' => $orderModel->getCouponCode() ? [['code' => $orderModel->getCouponCode()]] : [],
6161
'model' => $orderModel,
6262
'comments' => $this->getOrderComments($orderModel)
6363
];

0 commit comments

Comments
 (0)