Skip to content

Commit 7c85d61

Browse files
committed
Added filter nfinset in product search
- Deprecate "finset" and "nfinset" fields.
1 parent 4937617 commit 7c85d61

File tree

7 files changed

+2
-89
lines changed

7 files changed

+2
-89
lines changed

app/code/Magento/GraphQl/etc/schema.graphqls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ type Mutation {
99

1010
input FilterTypeInput @doc(description: "FilterTypeInput specifies which action will be performed in a query ") {
1111
eq: String @doc(description: "Equals")
12-
finset: [String] @doc(description: "Find in set. The value can contain a set of comma-separated values")
13-
nfinset: [String] @doc(description: "Not find in set. The value can contain a set of comma-separated values")
12+
finset: [String] @deprecated (reason: "The finset filter is deprecated. Magento doesn't recomend to store comma separated values, therefore finset filter is redundant.")
13+
nfinset: [String] @deprecated (reason: "The finset filter is deprecated. Magento doesn't recomend to store comma separated values, therefore finset filter is redundant.")
1414
from: String @doc(description: "From. Must be used with 'to'")
1515
gt: String @doc(description: "Greater than")
1616
gteq: String @doc(description: "Greater than or equal to")

dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -670,30 +670,6 @@ public function testProductPrices()
670670
$this->assertBaseFields($secondProduct, $response['products']['items'][1]);
671671
}
672672

673-
/**
674-
* @magentoApiDataFixture Magento/Catalog/_files/products_for_search.php
675-
*/
676-
public function testProductFilterNfinset()
677-
{
678-
$productSku = 'search_product_1';
679-
680-
$query = <<<QUERY
681-
{
682-
products(filter: {sku: {nfinset: ["$productSku"]}})
683-
{
684-
items {
685-
id
686-
name
687-
sku
688-
}
689-
}
690-
}
691-
QUERY;
692-
693-
$response = $this->graphQlQuery($query);
694-
$this->assertNotContains($productSku, array_column($response['products']['items'], 'sku'));
695-
}
696-
697673
/**
698674
* @param ProductInterface $product
699675
* @param array $actualResponse

dev/tests/integration/testsuite/Magento/Framework/GraphQl/_files/schemaA.graphqls

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ type Mutation {
88

99
input FilterTypeInput @doc(description:"Comment for FilterTypeInput") {
1010
eq: String @doc(description:"Equal")
11-
finset: [String]
12-
nfinset: [String]
1311
from: String
1412
gt: String
1513
gteq: String

dev/tests/integration/testsuite/Magento/Framework/GraphQl/_files/schemaC.graphqls

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ type Attribute @doc(description: "Attribute contains the attribute_type of the s
1919
}
2020
input FilterTypeInput @doc(description:"Comment for FilterTypeInput") {
2121
eq: String @doc(description:"Equal")
22-
finset: [String]
23-
nfinset: [String]
2422
from: String
2523
gt: String
2624
gteq: String

dev/tests/integration/testsuite/Magento/Framework/GraphQl/_files/schema_response_sdl_description.php

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -505,34 +505,6 @@
505505
],
506506
'defaultValue' => null
507507
],
508-
[
509-
'name' => 'finset',
510-
'description' => '',
511-
'type' => [
512-
'kind' => 'LIST',
513-
'name' => null,
514-
'ofType' => [
515-
'kind' => 'SCALAR',
516-
'name' => 'String',
517-
'ofType' => null
518-
]
519-
],
520-
'defaultValue' => null
521-
],
522-
[
523-
'name' => 'nfinset',
524-
'description' => '',
525-
'type' => [
526-
'kind' => 'LIST',
527-
'name' => null,
528-
'ofType' => [
529-
'kind' => 'SCALAR',
530-
'name' => 'String',
531-
'ofType' => null
532-
]
533-
],
534-
'defaultValue' => null
535-
],
536508
[
537509
'name' => 'from',
538510
'description' => '',

dev/tests/integration/testsuite/Magento/Framework/GraphQl/_files/schema_with_description_sdl.php

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -505,34 +505,6 @@
505505
],
506506
'defaultValue' => null
507507
],
508-
[
509-
'name' => 'finset',
510-
'description' => '',
511-
'type' => [
512-
'kind' => 'LIST',
513-
'name' => null,
514-
'ofType' => [
515-
'kind' => 'SCALAR',
516-
'name' => 'String',
517-
'ofType' => null
518-
]
519-
],
520-
'defaultValue' => null
521-
],
522-
[
523-
'name' => 'nfinset',
524-
'description' => '',
525-
'type' => [
526-
'kind' => 'LIST',
527-
'name' => null,
528-
'ofType' => [
529-
'kind' => 'SCALAR',
530-
'name' => 'String',
531-
'ofType' => null
532-
]
533-
],
534-
'defaultValue' => null
535-
],
536508
[
537509
'name' => 'from',
538510
'description' => '',

lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2976,9 +2976,6 @@ public function prepareSqlCondition($fieldName, $condition)
29762976
if (($key == 'in' || $key == 'nin') && is_string($value)) {
29772977
$value = explode(',', $value);
29782978
}
2979-
if (($key == 'finset' || $key == 'nfinset') && is_array($value)) {
2980-
$value = implode(',', $value);
2981-
}
29822979
$query = $this->_prepareQuotedSqlCondition($conditionKeyMap[$key], $value, $fieldName);
29832980
} else {
29842981
$queries = [];

0 commit comments

Comments
 (0)