Skip to content

Fix issues in Blog #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Model/Resolver/Categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function resolve(

$scopeFilter = $this->filterBuilder
->setField('store_id')
->setValue($scope)
->setValue($args['storeId'] ?? $scope)
->setConditionType('eq')
->create();
$filterGroups[] = $this->filterGroupBuilder->addFilter($scopeFilter)->create();
Expand Down
2 changes: 1 addition & 1 deletion Model/Resolver/Posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function resolve(

$scopeFilter = $this->filterBuilder
->setField('store_id')
->setValue($scope)
->setValue($args['storeId'] ?? $scope)
->setConditionType('eq')
->create();
$filterGroups[] = $this->filterGroupBuilder->addFilter($scopeFilter)->create();
Expand Down
2 changes: 1 addition & 1 deletion Model/Resolver/Tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function resolve(

$scopeFilter = $this->filterBuilder
->setField('store_id')
->setValue($scope)
->setValue($args['storeId'] ?? $scope)
->setConditionType('eq')
->create();
$filterGroups[] = $this->filterGroupBuilder->addFilter($scopeFilter)->create();
Expand Down
9 changes: 7 additions & 2 deletions etc/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,19 @@ type Query {
sort: [String] @doc(description: "Specifies which attribute to sort on, and whether to return the results in ascending or descending order.")
sortFiled: String = "publish_time" @doc(description: "Specifies what field to sort posts by. The default value is publish_time.")
allPosts: Boolean @doc(description: "If true get all posts.")
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.")
): 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")
blogComments(
filter: BlogCommentsFilterInput @doc(description: "Identifies which comment attributes to search for and return."),
pageSize: Int = 5 @doc(description: "Specifies the maximum number of results to return at once. This attribute is optional."),
currentPage: Int = 1 @doc(description: "Specifies which page of results to return. The default value is 1."),
):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")
blogTags: blogTagsOutput @resolver(class: "\\Magefan\\BlogGraphQl\\Model\\Resolver\\Tags") @doc(description: "")
blogCategories: blogCategoriesOutput @resolver(class: "\\Magefan\\BlogGraphQl\\Model\\Resolver\\Categories") @doc(description: "")
blogTags(
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.")
): blogTagsOutput @resolver(class: "\\Magefan\\BlogGraphQl\\Model\\Resolver\\Tags") @doc(description: "")
blogCategories(
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.")
): blogCategoriesOutput @resolver(class: "\\Magefan\\BlogGraphQl\\Model\\Resolver\\Categories") @doc(description: "")
}

type Mutation {
Expand Down