From 9d240e3a52af09f32799ec52dc08e3dc89e707f0 Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko Date: Wed, 1 May 2019 11:49:53 +0300 Subject: [PATCH 1/3] graphQl-535: provided catalog configs --- .../Magento/CatalogGraphQl/etc/graphql/di.xml | 22 ++++++++ .../CatalogGraphQl/etc/schema.graphqls | 19 +++++++ .../GraphQl/Catalog/StoreConfigTest.php | 55 +++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php diff --git a/app/code/Magento/CatalogGraphQl/etc/graphql/di.xml b/app/code/Magento/CatalogGraphQl/etc/graphql/di.xml index a5bd42860ded0..5d5c92edd3d57 100644 --- a/app/code/Magento/CatalogGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/CatalogGraphQl/etc/graphql/di.xml @@ -80,4 +80,26 @@ + + + + catalog/seo/product_url_suffix + catalog/seo/category_url_suffix + catalog/seo/product_use_categories + catalog/seo/save_rewrites_history + catalog/seo/title_separator + catalog/seo/category_canonical_tag + catalog/seo/product_canonical_tag + catalog/frontend/list_mode + catalog/frontend/grid_per_page_values + catalog/frontend/list_per_page_values + catalog/frontend/grid_per_page + catalog/frontend/list_per_page + catalog/frontend/flat_catalog_category + catalog/frontend/default_sort_by + catalog/frontend/parse_url_directives + catalog/frontend/remember_pagination + + + diff --git a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls index 9f102a1c6a150..1b04e2b0ff6aa 100644 --- a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls @@ -401,3 +401,22 @@ type SortFields @doc(description: "SortFields contains a default value for sort default: String @doc(description: "Default value of sort fields") options: [SortField] @doc(description: "Available sort fields") } + +type StoreConfig @doc(description: "The type contains information about a store config") { + product_url_suffix : String @doc(description: "Product URL Suffix") + category_url_suffix : String @doc(description: "Category URL Suffix") + product_use_categories : Int @doc(description: "Use Categories Path for Product URLs") + save_rewrites_history : Int @doc(description: "Create Permanent Redirect for URLs if URL Key Changed") + title_separator : String @doc(description: "Page Title Separator") + category_canonical_tag : Int @doc(description: "Use Canonical Link Meta Tag For Categories") + product_canonical_tag : Int @doc(description: "Use Canonical Link Meta Tag For Products") + list_mode : String @doc(description: "List Mode") + grid_per_page_values : String @doc(description: "Products per Page on Grid Allowed Values") + list_per_page_values : String @doc(description: "Products per Page on List Allowed Values") + grid_per_page : Int @doc(description: "Products per Page on Grid Default Value") + list_per_page : Int @doc(description: "Products per Page on List Default Value") + flat_catalog_category : Int @doc(description: "Use Flat Catalog Category") + catalog_default_sort_by : String @doc(description: "Default Sort By") + parse_url_directives : Int @doc(description: "Parse URL directives") + remember_pagination : Int @doc(description: "Remember Pagination") +} diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php new file mode 100644 index 0000000000000..813ed9faefa94 --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php @@ -0,0 +1,55 @@ +markTestIncomplete('https://github.com/magento/graphql-ce/issues/167'); + } + + /** + * @magentoApiDataFixture Magento/Store/_files/store.php + */ + public function testGetStoreConfig() + { + $query + = <<graphQlQuery($query); + $this->assertArrayHasKey('storeConfig', $response); + + //TODO: provide assertions after unmarking test as incomplete + } +} From 8f36cf21b9fda33f031c9c42457c520b84548afe Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko Date: Wed, 1 May 2019 14:04:32 +0300 Subject: [PATCH 2/3] graphQl-535: fixed namespace --- .../testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php index 813ed9faefa94..5932fd8b034e6 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php @@ -5,7 +5,7 @@ */ declare(strict_types=1); -namespace Magento\GraphQl\Store; +namespace Magento\GraphQl\Catalog; use Magento\TestFramework\TestCase\GraphQlAbstract; From 9f2f5b605564465876b391883be3f19035b5f80a Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko Date: Wed, 8 May 2019 10:30:32 +0300 Subject: [PATCH 3/3] graphQl-535: removed unnecessary configs --- app/code/Magento/CatalogGraphQl/etc/graphql/di.xml | 7 ------- app/code/Magento/CatalogGraphQl/etc/schema.graphqls | 7 ------- .../Magento/GraphQl/Catalog/StoreConfigTest.php | 9 +-------- 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/etc/graphql/di.xml b/app/code/Magento/CatalogGraphQl/etc/graphql/di.xml index 5d5c92edd3d57..2292004f3cf01 100644 --- a/app/code/Magento/CatalogGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/CatalogGraphQl/etc/graphql/di.xml @@ -85,20 +85,13 @@ catalog/seo/product_url_suffix catalog/seo/category_url_suffix - catalog/seo/product_use_categories - catalog/seo/save_rewrites_history catalog/seo/title_separator - catalog/seo/category_canonical_tag - catalog/seo/product_canonical_tag catalog/frontend/list_mode catalog/frontend/grid_per_page_values catalog/frontend/list_per_page_values catalog/frontend/grid_per_page catalog/frontend/list_per_page - catalog/frontend/flat_catalog_category catalog/frontend/default_sort_by - catalog/frontend/parse_url_directives - catalog/frontend/remember_pagination diff --git a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls index 1b04e2b0ff6aa..261d204cd19fc 100644 --- a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls @@ -405,18 +405,11 @@ type SortFields @doc(description: "SortFields contains a default value for sort type StoreConfig @doc(description: "The type contains information about a store config") { product_url_suffix : String @doc(description: "Product URL Suffix") category_url_suffix : String @doc(description: "Category URL Suffix") - product_use_categories : Int @doc(description: "Use Categories Path for Product URLs") - save_rewrites_history : Int @doc(description: "Create Permanent Redirect for URLs if URL Key Changed") title_separator : String @doc(description: "Page Title Separator") - category_canonical_tag : Int @doc(description: "Use Canonical Link Meta Tag For Categories") - product_canonical_tag : Int @doc(description: "Use Canonical Link Meta Tag For Products") list_mode : String @doc(description: "List Mode") grid_per_page_values : String @doc(description: "Products per Page on Grid Allowed Values") list_per_page_values : String @doc(description: "Products per Page on List Allowed Values") grid_per_page : Int @doc(description: "Products per Page on Grid Default Value") list_per_page : Int @doc(description: "Products per Page on List Default Value") - flat_catalog_category : Int @doc(description: "Use Flat Catalog Category") catalog_default_sort_by : String @doc(description: "Default Sort By") - parse_url_directives : Int @doc(description: "Parse URL directives") - remember_pagination : Int @doc(description: "Remember Pagination") } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php index 5932fd8b034e6..2672431dbb56c 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php @@ -30,20 +30,13 @@ public function testGetStoreConfig() storeConfig{ product_url_suffix, category_url_suffix, - product_use_categories, - save_rewrites_history, title_separator, - category_canonical_tag, - product_canonical_tag, list_mode, grid_per_page_values, list_per_page_values, grid_per_page, list_per_page, - flat_catalog_category, - catalog_default_sort_by, - parse_url_directives, - remember_pagination + catalog_default_sort_by } } QUERY;