Skip to content

Commit a253222

Browse files
committed
GraphQL-630: Schema inconsistency of "AvailableShippingMethod" declaration
1 parent c28268e commit a253222

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

app/code/Magento/QuoteGraphQl/Model/Resolver/ShippingAddress/SelectedShippingMethod.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
6565
],
6666
'base_amount' => [
6767
'value' => $address->getBaseShippingAmount(),
68-
'currency' => $currency,
68+
'currency' => $currency->getCode(),
6969
],
7070
];
7171
} else {

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,9 @@ private function setShippingAddress(string $cartId): array
309309
available_shipping_methods {
310310
carrier_code
311311
method_code
312-
amount
312+
amount {
313+
value
314+
}
313315
}
314316
}
315317
}
@@ -334,7 +336,8 @@ private function setShippingAddress(string $cartId): array
334336
self::assertNotEmpty($availableShippingMethod['method_code']);
335337

336338
self::assertArrayHasKey('amount', $availableShippingMethod);
337-
self::assertNotEmpty($availableShippingMethod['amount']);
339+
self::assertArrayHasKey('value', $availableShippingMethod['amount']);
340+
self::assertNotEmpty($availableShippingMethod['amount']['value']);
338341

339342
return $availableShippingMethod;
340343
}

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,9 @@ private function setShippingAddress(string $cartId): array
269269
available_shipping_methods {
270270
carrier_code
271271
method_code
272-
amount
272+
amount {
273+
value
274+
}
273275
}
274276
}
275277
}
@@ -294,7 +296,8 @@ private function setShippingAddress(string $cartId): array
294296
self::assertNotEmpty($availableShippingMethod['method_code']);
295297

296298
self::assertArrayHasKey('amount', $availableShippingMethod);
297-
self::assertNotEmpty($availableShippingMethod['amount']);
299+
self::assertArrayHasKey('value', $availableShippingMethod['amount']);
300+
self::assertNotEmpty($availableShippingMethod['amount']['value']);
298301

299302
return $availableShippingMethod;
300303
}

0 commit comments

Comments
 (0)