Skip to content

Commit 7a8e203

Browse files
committed
Fix issues in Blog
1 parent 6ccb764 commit 7a8e203

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
@@ -97,7 +97,7 @@ public function resolve(
9797

9898
$scopeFilter = $this->filterBuilder
9999
->setField('store_id')
100-
->setValue($scope)
100+
->setValue($args['storeId'] ?? $scope)
101101
->setConditionType('eq')
102102
->create();
103103
$filterGroups[] = $this->filterGroupBuilder->addFilter($scopeFilter)->create();

Model/Resolver/Posts.php

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

109109
$scopeFilter = $this->filterBuilder
110110
->setField('store_id')
111-
->setValue($scope)
111+
->setValue($args['storeId'] ?? $scope)
112112
->setConditionType('eq')
113113
->create();
114114
$filterGroups[] = $this->filterGroupBuilder->addFilter($scopeFilter)->create();

Model/Resolver/Tags.php

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

9898
$scopeFilter = $this->filterBuilder
9999
->setField('store_id')
100-
->setValue($scope)
100+
->setValue($args['storeId'] ?? $scope)
101101
->setConditionType('eq')
102102
->create();
103103
$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)