Skip to content

Commit 267db35

Browse files
🔃 [Magento Community Engineering] Community Contributions - GraphQL daily delivery
Accepted Community Pull Requests: - magento/graphql-ce#953: Rename PayflowProToken Type (by @pmclain) - magento/graphql-ce#952: Add Store Name to Config Schema (by @pmclain) - magento/graphql-ce#959: GraphQL-879 Change description for createBraintreeClientToken mutation (by @karyna-tsymbal-atwix) - magento/graphql-ce#951: #878 - Deprecated the column increment_id (by @strell) - magento/graphql-ce#949: magento/graphql-ce#948 - Move preference for ErrorHandlerInterface (by @vpodorozh) Fixed GitHub Issues: - #881: Installation with sample data failing (reported by @jameswithers) has been fixed in magento/graphql-ce#953 by @pmclain in 2.3-develop branch Related commits: 1. 17ea087 - #926: Failed due to line endings (reported by @snky1987) has been fixed in magento/graphql-ce#952 by @pmclain in 2.3-develop branch Related commits: 1. 5b32e8e - #878: CMS page is not editable (reported by @shivkumarsingh7) has been fixed in magento/graphql-ce#951 by @strell in 2.3-develop branch Related commits: 1. 746038e 2. 225c9f7 - #948: varnish cache - odd states, price update question (reported by @robfico) has been fixed in magento/graphql-ce#949 by @vpodorozh in 2.3-develop branch Related commits: 1. fda524e
2 parents fc6b5aa + 0973d97 commit 267db35

File tree

10 files changed

+38
-28
lines changed

10 files changed

+38
-28
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# See COPYING.txt for license details.
33

44
type Mutation {
5-
createBraintreeClientToken: String! @resolver(class: "\\Magento\\BraintreeGraphQl\\Model\\Resolver\\CreateBraintreeClientToken") @doc(description:"Creates Braintree Client Token for creating client-side nonce.")
5+
createBraintreeClientToken: String! @resolver(class: "\\Magento\\BraintreeGraphQl\\Model\\Resolver\\CreateBraintreeClientToken") @doc(description:"Creates Client Token for Braintree Javascript SDK initialization.")
66
}
77

88
input PaymentMethodInput {

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type Query {
88

99
type Mutation {
1010
createPaypalExpressToken(input: PaypalExpressTokenInput!): PaypalExpressToken @resolver(class: "\\Magento\\PaypalGraphQl\\Model\\Resolver\\PaypalExpressToken") @doc(description:"Initiates an Express Checkout transaction and receives a token. Use this mutation for Express Checkout and Payments Standard payment methods.")
11-
createPayflowProToken(input: PayflowProTokenInput!): PayflowProToken @resolver(class: "\\Magento\\PaypalGraphQl\\Model\\Resolver\\PayflowProToken") @doc(description: "Initiates a transaction and receives a token. Use this mutation for Payflow Pro and Payments Pro payment methods")
11+
createPayflowProToken(input: PayflowProTokenInput!): CreatePayflowProTokenOutput @resolver(class: "\\Magento\\PaypalGraphQl\\Model\\Resolver\\PayflowProToken") @doc(description: "Initiates a transaction and receives a token. Use this mutation for Payflow Pro and Payments Pro payment methods")
1212
handlePayflowProResponse(input: PayflowProResponseInput!): PayflowProResponseOutput @resolver(class: "\\Magento\\PaypalGraphQl\\Model\\Resolver\\PayflowProResponse") @doc(description: "Handles payment response and saves payment in Quote. Use this mutations for Payflow Pro and Payments Pro payment methods.")
1313
}
1414

@@ -112,7 +112,15 @@ input PayflowProUrlInput @doc(description:"A set of relative URLs that PayPal wi
112112
error_url: String! @doc(description:"The relative URL of the transaction error page that PayPal will redirect to upon payment error. If the full URL to this page is https://www.example.com/paypal/action/error.html, the relative URL is paypal/action/error.html.")
113113
}
114114

115-
type PayflowProToken @doc(description: "Contains the secure information used to authorize transaction. Applies to Payflow Pro and Payments Pro payment methods.") {
115+
type PayflowProToken @deprecated(reason: "Use CreatePayflowProTokenOutput instead.") @doc(description: "Contains the secure information used to authorize transaction. Applies to Payflow Pro and Payments Pro payment methods.") {
116+
secure_token: String!
117+
secure_token_id: String!
118+
response_message: String!
119+
result: Int!
120+
result_code: Int!
121+
}
122+
123+
type CreatePayflowProTokenOutput @doc(description: "Contains the secure information used to authorize transaction. Applies to Payflow Pro and Payments Pro payment methods.") {
116124
secure_token: String!
117125
secure_token_id: String!
118126
response_message: String!

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public function resolve(
5656
$items[] = [
5757
'id' => $order->getId(),
5858
'increment_id' => $order->getIncrementId(),
59+
'order_number' => $order->getIncrementId(),
5960
'created_at' => $order->getCreatedAt(),
6061
'grand_total' => $order->getGrandTotal(),
6162
'status' => $order->getStatus(),

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ type Query {
77

88
type CustomerOrder @doc(description: "Order mapping fields") {
99
id: Int
10-
increment_id: String
10+
increment_id: String @deprecated(reason: "Use the order_number instaed.")
11+
order_number: String! @doc(description: "The order number")
1112
created_at: String
1213
grand_total: Float
1314
status: String

app/code/Magento/StoreGraphQl/etc/graphql/di.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,11 @@
2323
</argument>
2424
</arguments>
2525
</type>
26+
<type name="Magento\StoreGraphQl\Model\Resolver\Store\StoreConfigDataProvider">
27+
<arguments>
28+
<argument name="extendedConfigData" xsi:type="array">
29+
<item name="store_name" xsi:type="string">store/information/name</item>
30+
</argument>
31+
</arguments>
32+
</type>
2633
</config>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ type StoreConfig @doc(description: "The type contains information about a store
3030
secure_base_link_url : String @doc(description: "Secure base link URL for the store")
3131
secure_base_static_url : String @doc(description: "Secure base static URL for the store")
3232
secure_base_media_url : String @doc(description: "Secure base media URL for the store")
33+
store_name : String @doc(description: "Name of the store")
3334
}

app/etc/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,4 +1781,5 @@
17811781
<type name="Magento\Framework\DB\Adapter\AdapterInterface">
17821782
<plugin name="execute_commit_callbacks" type="Magento\Framework\Model\ExecuteCommitCallbacks" />
17831783
</type>
1784+
<preference for="Magento\Framework\GraphQl\Query\ErrorHandlerInterface" type="Magento\Framework\GraphQl\Query\ErrorHandler"/>
17841785
</config>

app/etc/graphql/di.xml

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

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

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ public function testOrdersQuery()
3838
query {
3939
customerOrders {
4040
items {
41-
id
42-
increment_id
43-
created_at
41+
order_number
4442
grand_total
4543
status
4644
}
@@ -54,27 +52,27 @@ public function testOrdersQuery()
5452

5553
$expectedData = [
5654
[
57-
'increment_id' => '100000002',
55+
'order_number' => '100000002',
5856
'status' => 'processing',
5957
'grand_total' => 120.00
6058
],
6159
[
62-
'increment_id' => '100000003',
60+
'order_number' => '100000003',
6361
'status' => 'processing',
6462
'grand_total' => 130.00
6563
],
6664
[
67-
'increment_id' => '100000004',
65+
'order_number' => '100000004',
6866
'status' => 'closed',
6967
'grand_total' => 140.00
7068
],
7169
[
72-
'increment_id' => '100000005',
70+
'order_number' => '100000005',
7371
'status' => 'complete',
7472
'grand_total' => 150.00
7573
],
7674
[
77-
'increment_id' => '100000006',
75+
'order_number' => '100000006',
7876
'status' => 'complete',
7977
'grand_total' => 160.00
8078
]
@@ -84,19 +82,19 @@ public function testOrdersQuery()
8482

8583
foreach ($expectedData as $key => $data) {
8684
$this->assertEquals(
87-
$data['increment_id'],
88-
$actualData[$key]['increment_id'],
89-
"increment_id is different than the expected for order - " . $data['increment_id']
85+
$data['order_number'],
86+
$actualData[$key]['order_number'],
87+
"order_number is different than the expected for order - " . $data['order_number']
9088
);
9189
$this->assertEquals(
9290
$data['grand_total'],
9391
$actualData[$key]['grand_total'],
94-
"grand_total is different than the expected for order - " . $data['increment_id']
92+
"grand_total is different than the expected for order - " . $data['order_number']
9593
);
9694
$this->assertEquals(
9795
$data['status'],
9896
$actualData[$key]['status'],
99-
"status is different than the expected for order - " . $data['increment_id']
97+
"status is different than the expected for order - " . $data['order_number']
10098
);
10199
}
102100
}

dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreConfigResolverTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ protected function setUp()
3030

3131
/**
3232
* @magentoApiDataFixture Magento/Store/_files/store.php
33+
* @magentoConfigFixture default_store store/information/name Test Store
3334
*/
3435
public function testGetStoreConfig()
3536
{
@@ -62,7 +63,8 @@ public function testGetStoreConfig()
6263
secure_base_url,
6364
secure_base_link_url,
6465
secure_base_static_url,
65-
secure_base_media_url
66+
secure_base_media_url,
67+
store_name
6668
}
6769
}
6870
QUERY;
@@ -89,5 +91,6 @@ public function testGetStoreConfig()
8991
$response['storeConfig']['secure_base_static_url']
9092
);
9193
$this->assertEquals($storeConfig->getSecureBaseMediaUrl(), $response['storeConfig']['secure_base_media_url']);
94+
$this->assertEquals('Test Store', $response['storeConfig']['store_name']);
9295
}
9396
}

0 commit comments

Comments
 (0)