Skip to content

Commit

Permalink
graphql-ce-120: added api-functional test fixed resolver and dataprov…
Browse files Browse the repository at this point in the history
…ider
  • Loading branch information
vitaliyboyko committed Jul 18, 2018
1 parent e1f53d4 commit 5229cd6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
];
}

/**
Expand All @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions app/code/Magento/StoreGraphQl/Model/Resolver/StoreConfigs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/StoreGraphQl/etc/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down

0 comments on commit 5229cd6

Please sign in to comment.