Skip to content

Commit 8740903

Browse files
authored
Merge pull request #25 from ivanhrytsaim/13436-Fix-Blog
Fix issues in Blog
2 parents 1118b70 + 7a8e203 commit 8740903

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

Model/Resolver/Categories.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function resolve(
9393

9494
$scopeFilter = $this->filterBuilder
9595
->setField('store_id')
96-
->setValue($scope)
96+
->setValue($args['storeId'] ?? $scope)
9797
->setConditionType('eq')
9898
->create();
9999
$filterGroups[] = $this->filterGroupBuilder->addFilter($scopeFilter)->create();

Model/Resolver/Posts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function resolve(
104104

105105
$scopeFilter = $this->filterBuilder
106106
->setField('store_id')
107-
->setValue($scope)
107+
->setValue($args['storeId'] ?? $scope)
108108
->setConditionType('eq')
109109
->create();
110110
$filterGroups[] = $this->filterGroupBuilder->addFilter($scopeFilter)->create();

Model/Resolver/Tags.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function resolve(
9393

9494
$scopeFilter = $this->filterBuilder
9595
->setField('store_id')
96-
->setValue($scope)
96+
->setValue($args['storeId'] ?? $scope)
9797
->setConditionType('eq')
9898
->create();
9999
$filterGroups[] = $this->filterGroupBuilder->addFilter($scopeFilter)->create();

etc/schema.graphqls

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,19 @@ type Query {
2121
sort: [String] @doc(description: "Specifies which attribute to sort on, and whether to return the results in ascending or descending order.")
2222
sortFiled: String = "publish_time" @doc(description: "Specifies what field to sort posts by. The default value is publish_time.")
2323
allPosts: Boolean @doc(description: "If true get all posts.")
24+
storeId: Int = 0 @doc(description: "Specifies the store view ID to filter the results. The default value is 0, meaning no specific store filter applied.")
2425
): blogPostsOutput @resolver(class: "\\Magefan\\BlogGraphQl\\Model\\Resolver\\Posts") @doc(description: "The posts query searches for posts that match the criteria specified in the search and filter attributes")
2526
blogComments(
2627
filter: BlogCommentsFilterInput @doc(description: "Identifies which comment attributes to search for and return."),
2728
pageSize: Int = 5 @doc(description: "Specifies the maximum number of results to return at once. This attribute is optional."),
2829
currentPage: Int = 1 @doc(description: "Specifies which page of results to return. The default value is 1."),
2930
):blogCommentsOutput @resolver(class: "\\Magefan\\BlogGraphQl\\Model\\Resolver\\Comments") @doc(description: "The comments query searches for posts that match the criteria specified in the search and filter attributes")
30-
blogTags: blogTagsOutput @resolver(class: "\\Magefan\\BlogGraphQl\\Model\\Resolver\\Tags") @doc(description: "")
31-
blogCategories: blogCategoriesOutput @resolver(class: "\\Magefan\\BlogGraphQl\\Model\\Resolver\\Categories") @doc(description: "")
31+
blogTags(
32+
storeId: Int = 0 @doc(description: "Specifies the store view ID to filter the results. The default value is 0, meaning no specific store filter applied.")
33+
): blogTagsOutput @resolver(class: "\\Magefan\\BlogGraphQl\\Model\\Resolver\\Tags") @doc(description: "")
34+
blogCategories(
35+
storeId: Int = 0 @doc(description: "Specifies the store view ID to filter the results. The default value is 0, meaning no specific store filter applied.")
36+
): blogCategoriesOutput @resolver(class: "\\Magefan\\BlogGraphQl\\Model\\Resolver\\Categories") @doc(description: "")
3237
}
3338

3439
type Mutation {

0 commit comments

Comments
 (0)