From 5229cd6eed7b5e08174268245f23158513feabd9 Mon Sep 17 00:00:00 2001 From: vitaliyboyko Date: Wed, 18 Jul 2018 19:52:55 +0000 Subject: [PATCH] graphql-ce-120: added api-functional test fixed resolver and dataprovider --- .../Model/Resolver/Store/StoreConfigsDataProvider.php | 5 ++++- .../Magento/StoreGraphQl/Model/Resolver/StoreConfigs.php | 8 ++++---- app/code/Magento/StoreGraphQl/etc/schema.graphqls | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/StoreGraphQl/Model/Resolver/Store/StoreConfigsDataProvider.php b/app/code/Magento/StoreGraphQl/Model/Resolver/Store/StoreConfigsDataProvider.php index 4fb7dc9cdbb0e..0d7ce3aa1555f 100644 --- a/app/code/Magento/StoreGraphQl/Model/Resolver/Store/StoreConfigsDataProvider.php +++ b/app/code/Magento/StoreGraphQl/Model/Resolver/Store/StoreConfigsDataProvider.php @@ -39,7 +39,9 @@ public function getStoreConfigsByStoreCodes(array $storeCodes = null) : array { $storeConfigs = $this->storeConfigManager->getStoreConfigs($storeCodes); - return ['items' => $this->hidrateStoreConfigs($storeConfigs)]; + return [ + 'items' => $this->hidrateStoreConfigs($storeConfigs) + ]; } /** @@ -66,6 +68,7 @@ private function hidrateStoreConfigs(array $storeConfigs) : array 'base_link_url' => $storeConfig->getBaseLinkUrl(), 'base_static_url' => $storeConfig->getSecureBaseStaticUrl(), 'base_media_url' => $storeConfig->getBaseMediaUrl(), + 'secure_base_url' => $storeConfig->getSecureBaseUrl(), 'secure_base_link_url' => $storeConfig->getSecureBaseLinkUrl(), 'secure_base_static_url' => $storeConfig->getSecureBaseStaticUrl(), 'secure_base_media_url' => $storeConfig->getSecureBaseMediaUrl() diff --git a/app/code/Magento/StoreGraphQl/Model/Resolver/StoreConfigs.php b/app/code/Magento/StoreGraphQl/Model/Resolver/StoreConfigs.php index e03ab72167f1e..c1daef97d5c60 100644 --- a/app/code/Magento/StoreGraphQl/Model/Resolver/StoreConfigs.php +++ b/app/code/Magento/StoreGraphQl/Model/Resolver/StoreConfigs.php @@ -70,11 +70,11 @@ public function resolve( * @return array * @throws GraphQlInputException */ - private function getStoreCodes($args) : array + private function getStoreCodes($args) { - if (isset($args['store_codes'])) { - if (is_array($args['store_codes'])) { - return $args['store_codes']; + if (isset($args['storeCodes'])) { + if (is_array($args['storeCodes'])) { + return $args['storeCodes']; } throw new GraphQlInputException(__('"store codes should contain a valid array')); } diff --git a/app/code/Magento/StoreGraphQl/etc/schema.graphqls b/app/code/Magento/StoreGraphQl/etc/schema.graphqls index 67515a01fac93..2b45190c540eb 100644 --- a/app/code/Magento/StoreGraphQl/etc/schema.graphqls +++ b/app/code/Magento/StoreGraphQl/etc/schema.graphqls @@ -4,7 +4,7 @@ type Query { storeConfigs ( storeCodes: [String] @doc(description: "Store Codes of the store configs") ): StoreConfigs - @resolver(class: "Magento\\StoreGraphQl\\Model\\Resolver\\StoreConfigs") @doc(description: "The products query searches for products that match the criteria specified in the search and filter attributes") + @resolver(class: "Magento\\StoreGraphQl\\Model\\Resolver\\StoreConfigs") @doc(description: "The store configs query") } type Website @doc(description: "The type contains information about a website") {