File tree Expand file tree Collapse file tree 3 files changed +75
-0
lines changed
app/code/Magento/CatalogGraphQl/etc
dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog Expand file tree Collapse file tree 3 files changed +75
-0
lines changed Original file line number Diff line number Diff line change 80
80
</virtualType >
81
81
<preference for =" Magento\Framework\Search\Adapter\Mysql\Query\Builder\Match"
82
82
type =" Magento\CatalogGraphQl\Model\Search\Adapter\Mysql\Query\Builder\Match" />
83
+ <type name =" Magento\StoreGraphQl\Model\Resolver\Store\StoreConfigDataProvider" >
84
+ <arguments >
85
+ <argument name =" extendedConfigData" xsi : type =" array" >
86
+ <item name =" product_url_suffix" xsi : type =" string" >catalog/seo/product_url_suffix</item >
87
+ <item name =" category_url_suffix" xsi : type =" string" >catalog/seo/category_url_suffix</item >
88
+ <item name =" title_separator" xsi : type =" string" >catalog/seo/title_separator</item >
89
+ <item name =" list_mode" xsi : type =" string" >catalog/frontend/list_mode</item >
90
+ <item name =" grid_per_page_values" xsi : type =" string" >catalog/frontend/grid_per_page_values</item >
91
+ <item name =" list_per_page_values" xsi : type =" string" >catalog/frontend/list_per_page_values</item >
92
+ <item name =" grid_per_page" xsi : type =" string" >catalog/frontend/grid_per_page</item >
93
+ <item name =" list_per_page" xsi : type =" string" >catalog/frontend/list_per_page</item >
94
+ <item name =" catalog_default_sort_by" xsi : type =" string" >catalog/frontend/default_sort_by</item >
95
+ </argument >
96
+ </arguments >
97
+ </type >
83
98
</config >
Original file line number Diff line number Diff line change @@ -401,3 +401,15 @@ type SortFields @doc(description: "SortFields contains a default value for sort
401
401
default : String @doc (description : " Default value of sort fields" )
402
402
options : [SortField ] @doc (description : " Available sort fields" )
403
403
}
404
+
405
+ type StoreConfig @doc (description : " The type contains information about a store config" ) {
406
+ product_url_suffix : String @doc (description : "Product URL Suffix" )
407
+ category_url_suffix : String @doc (description : "Category URL Suffix" )
408
+ title_separator : String @doc (description : "Page Title Separator" )
409
+ list_mode : String @doc (description : "List Mode" )
410
+ grid_per_page_values : String @doc (description : "Products per Page on Grid Allowed Values" )
411
+ list_per_page_values : String @doc (description : "Products per Page on List Allowed Values" )
412
+ grid_per_page : Int @doc (description : "Products per Page on Grid Default Value" )
413
+ list_per_page : Int @doc (description : "Products per Page on List Default Value" )
414
+ catalog_default_sort_by : String @doc (description : "Default Sort By" )
415
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ declare (strict_types=1 );
7
+
8
+ namespace Magento \GraphQl \Catalog ;
9
+
10
+ use Magento \TestFramework \TestCase \GraphQlAbstract ;
11
+
12
+ /**
13
+ * Test the GraphQL endpoint's StoreConfigs query for Catalog Configs
14
+ */
15
+ class StoreConfigTest extends GraphQlAbstract
16
+ {
17
+ protected function setUp ()
18
+ {
19
+ $ this ->markTestIncomplete ('https://github.com/magento/graphql-ce/issues/167 ' );
20
+ }
21
+
22
+ /**
23
+ * @magentoApiDataFixture Magento/Store/_files/store.php
24
+ */
25
+ public function testGetStoreConfig ()
26
+ {
27
+ $ query
28
+ = <<<QUERY
29
+ {
30
+ storeConfig{
31
+ product_url_suffix,
32
+ category_url_suffix,
33
+ title_separator,
34
+ list_mode,
35
+ grid_per_page_values,
36
+ list_per_page_values,
37
+ grid_per_page,
38
+ list_per_page,
39
+ catalog_default_sort_by
40
+ }
41
+ }
42
+ QUERY ;
43
+ $ response = $ this ->graphQlQuery ($ query );
44
+ $ this ->assertArrayHasKey ('storeConfig ' , $ response );
45
+
46
+ //TODO: provide assertions after unmarking test as incomplete
47
+ }
48
+ }
You can’t perform that action at this time.
0 commit comments