Skip to content

Commit 327c603

Browse files
committed
#29927:Search should be disabled from products query when general configuration chooses to disabled it
Initial draft.
1 parent 7ddd47e commit 327c603

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/code/Magento/CatalogGraphQl/Model/Resolver/Products.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ public function resolve(
5757
array $value = null,
5858
array $args = null
5959
) {
60+
if (isset($args['searchAllowed']) && $args['searchAllowed'] === false) {
61+
throw new GraphQlInputException(__('Product search has been disabled.'));
62+
}
6063
if ($args['currentPage'] < 1) {
6164
throw new GraphQlInputException(__('currentPage value must be greater than 0.'));
6265
}

0 commit comments

Comments
 (0)