Skip to content

Commit 584eb7d

Browse files
committed
magento/graphql-ce#41: Fixed typos
1 parent ad85c95 commit 584eb7d

File tree

5 files changed

+13
-74
lines changed

5 files changed

+13
-74
lines changed

app/code/Magento/SalesGraphQl/Model/Resolver/Orders.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,13 @@ public function resolve(
6868
$orders = $this->collectionFactory->create($customerId);
6969
$items = [];
7070

71-
// @TODO Add shipping & billing address in response
72-
// @TODO Add order currency object in response
7371
/** @var \Magento\Sales\Model\Order $order */
7472
foreach ($orders as $order) {
7573
$items[] = [
7674
'id' => $order->getId(),
7775
'increment_id' => $order->getIncrementId(),
7876
'created_at' => $order->getCreatedAt(),
79-
'grant_total' => $order->getGrandTotal(),
77+
'grand_total' => $order->getGrandTotal(),
8078
'state' => $order->getState(),
8179
'status' => $order->getStatus()
8280
];
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# SalesGraphQl
22

33
**SalesGraphQl** provides type and resolver information for the GraphQl module
4-
to generate sales orders information endpoints.
5-
6-
Also will provides endpoints for modifying an order.
4+
to generate sales orders information.

app/code/Magento/SalesGraphQl/etc/schema.graphqls

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
# See COPYING.txt for license details.
33

44
type Query {
5-
customerOrders: Orders @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Orders") @doc(description: "List of customer orders")
5+
customerOrders: CustomerOrders @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Orders") @doc(description: "List of customer orders")
66
}
77

8-
type Order @doc(description: "Order mapping fields") {
8+
type CustomerOrder @doc(description: "Order mapping fields") {
99
id: Int
1010
increment_id: String
1111
created_at: String
12-
grant_total: Float
13-
state: String
12+
grand_total: Float
1413
status: String
1514
}
1615

17-
type Orders {
18-
items: [Order] @doc(description: "Array of orders")
16+
type CustomerOrders {
17+
items: [CustomerOrder] @doc(description: "Array of orders")
1918
}

dev/tests/api-functional/phpunit.xml.dist

Lines changed: 0 additions & 56 deletions
This file was deleted.

dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/OrdersTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,39 +63,39 @@ public function testOrdersQuery()
6363
'increment_id' => '100000002',
6464
'state' => \Magento\Sales\Model\Order::STATE_NEW,
6565
'status' => 'processing',
66-
'grant_total' => 120.00
66+
'grand_total' => 120.00
6767
],
6868
[
6969
'increment_id' => '100000003',
7070
'state' => \Magento\Sales\Model\Order::STATE_PROCESSING,
7171
'status' => 'processing',
72-
'grant_total' => 130.00
72+
'grand_total' => 130.00
7373
],
7474
[
7575
'increment_id' => '100000004',
7676
'state' => \Magento\Sales\Model\Order::STATE_PROCESSING,
7777
'status' => 'closed',
78-
'grant_total' => 140.00
78+
'grand_total' => 140.00
7979
],
8080
[
8181
'increment_id' => '100000005',
8282
'state' => \Magento\Sales\Model\Order::STATE_COMPLETE,
8383
'status' => 'complete',
84-
'grant_total' => 150.00
84+
'grand_total' => 150.00
8585
],
8686
[
8787
'increment_id' => '100000006',
8888
'state' => \Magento\Sales\Model\Order::STATE_COMPLETE,
8989
'status' => 'complete',
90-
'grant_total' => 160.00
90+
'grand_total' => 160.00
9191
]
9292
];
9393

9494
$actualData = $response['customerOrders']['items'];
9595

9696
foreach ($expectedData as $key => $data) {
9797
$this->assertEquals($data['increment_id'], $actualData[$key]['increment_id']);
98-
$this->assertEquals($data['grant_total'], $actualData[$key]['grant_total']);
98+
$this->assertEquals($data['grand_total'], $actualData[$key]['grand_total']);
9999
$this->assertEquals($data['state'], $actualData[$key]['state']);
100100
$this->assertEquals($data['status'], $actualData[$key]['status']);
101101
}

0 commit comments

Comments
 (0)