Skip to content

Commit 17bd44f

Browse files
committed
LYNX-303: Added in storeConfig graphql query
1 parent 821d884 commit 17bd44f

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
<argument name="extendedConfigData" xsi:type="array">
6666
<item name="is_guest_checkout_enabled" xsi:type="string">checkout/options/guest_checkout</item>
6767
<item name="is_one_page_checkout_enabled" xsi:type="string">checkout/options/onepage_checkout_enabled</item>
68+
<item name="max_items_in_order_summary" xsi:type="string">checkout/options/max_items_display_count</item>
6869
</argument>
6970
</arguments>
7071
</type>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,4 +445,5 @@ enum CartUserInputErrorType {
445445
type StoreConfig {
446446
is_guest_checkout_enabled: Boolean @doc(description: "Extended Config Data - checkout/options/guest_checkout")
447447
is_one_page_checkout_enabled: Boolean @doc(description: "Extended Config Data - checkout/options/onepage_checkout_enabled")
448+
max_items_in_order_summary: Int @doc(description: "Extended Config Data - checkout/options/max_items_display_count")
448449
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
/**
3+
* Copyright 2023 Adobe
4+
* All Rights Reserved.
5+
*
6+
* NOTICE: All information contained herein is, and remains
7+
* the property of Adobe and its suppliers, if any. The intellectual
8+
* and technical concepts contained herein are proprietary to Adobe
9+
* and its suppliers and are protected by all applicable intellectual
10+
* property laws, including trade secret and copyright laws.
11+
* Dissemination of this information or reproduction of this material
12+
* is strictly forbidden unless prior written permission is obtained from
13+
* Adobe.
14+
*/
15+
declare(strict_types=1);
16+
17+
namespace Magento\GraphQl\Quote;
18+
19+
use Magento\Framework\DataObject;
20+
use Magento\TestFramework\Fixture\Config;
21+
use Magento\TestFramework\TestCase\GraphQlAbstract;
22+
23+
/**
24+
* Test for getting max_items_in_order_summary from storeConfig query
25+
*/
26+
class GetMaxItemsInOrderSummaryTest extends GraphQlAbstract
27+
{
28+
private const MAX_ITEMS_TO_DISPLAY = 5;
29+
30+
#[
31+
Config('checkout/options/max_items_display_count', self::MAX_ITEMS_TO_DISPLAY)
32+
]
33+
public function testGetMaxItemsInOrderSummary()
34+
{
35+
$query = $this->getQuery();
36+
$response = $this->graphQlMutation($query);
37+
$responseDataObject = new DataObject($response);
38+
39+
self::assertEquals(self::MAX_ITEMS_TO_DISPLAY, $responseDataObject->getData('storeConfig/max_items_in_order_summary'));
40+
}
41+
42+
/**
43+
* Create storeConfig query
44+
*
45+
* @return string
46+
*/
47+
private function getQuery(): string
48+
{
49+
return <<<QUERY
50+
{
51+
storeConfig {
52+
max_items_in_order_summary
53+
}
54+
}
55+
QUERY;
56+
}
57+
}

0 commit comments

Comments
 (0)