Skip to content

Commit b454299

Browse files
committed
updated marketplace graphql
1 parent 3397f79 commit b454299

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Model/Resolver/Sellers.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ public function resolve(
9898
throw new GraphQlInputException(__('pageSize value must be greater than 0.'));
9999
}
100100
$store = $context->getExtensionAttributes()->getStore();
101-
$args[Filter::ARGUMENT_NAME] = $this->formatMatchFilters($args['filter'], $store);
101+
if(isset($args['filter']) && $args['filter']){
102+
$args[Filter::ARGUMENT_NAME] = $this->formatMatchFilters($args['filter'], $store);
103+
}
102104
$searchCriteria = $this->searchCriteriaBuilder->build('lof_marketplace_seller', $args);
103105
$searchCriteria->setCurrentPage($args['currentPage']);
104106
$searchCriteria->setPageSize($args['pageSize']);

etc/schema.graphqls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ type Query {
5858

5959
lofProductBySellerId(
6060
seller_id: Int! @doc(description: "Seller id")
61-
search: String @doc(description: "Performs a full-text search using the specified key words."),
61+
search: String = "" @doc(description: "Performs a full-text search using the specified key words."),
6262
filter: ProductAttributeFilterInput @doc(description: "Identifies which product attributes to search for and return."),
6363
pageSize: Int = 20 @doc(description: "Specifies the maximum number of results to return at once. This attribute is optional."),
6464
currentPage: Int = 1 @doc(description: "Specifies which page of results to return. The default value is 1."),
6565
sort: ProductAttributeSortInput @doc(description: "Specifies which attributes to sort on, and whether to return the results in ascending or descending order.")
6666
): Products @resolver(class: "\\Lof\\MarketplaceGraphQl\\Model\\Resolver\\ProductBySellerId") @doc(description: "Get Product by Seller ID")
6767

6868
lofProductList(
69-
search: String @doc(description: "Performs a full-text search using the specified key words."),
69+
search: String = "" @doc(description: "Performs a full-text search using the specified key words."),
7070
filter: ProductAttributeFilterInput @doc(description: "Identifies which product attributes to search for and return."),
7171
pageSize: Int = 20 @doc(description: "Specifies the maximum number of results to return at once. This attribute is optional."),
7272
currentPage: Int = 1 @doc(description: "Specifies which page of results to return. The default value is 1."),

0 commit comments

Comments
 (0)