From bcc0e4d5ea86a24af9d9405518146277eb06efc4 Mon Sep 17 00:00:00 2001 From: Alexandra Zota Date: Wed, 30 Aug 2023 12:21:09 +0300 Subject: [PATCH 1/4] ACP2E-2119: update documentation with new added attribute and examples. --- .../schema/products/queries/products.md | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) diff --git a/src/pages/graphql/schema/products/queries/products.md b/src/pages/graphql/schema/products/queries/products.md index 5409465b4..df58ad253 100644 --- a/src/pages/graphql/schema/products/queries/products.md +++ b/src/pages/graphql/schema/products/queries/products.md @@ -86,6 +86,7 @@ Use the `FilterMatchTypeInput` object to construct a filter that returns product Attribute | Data type | Description --- | --- | --- `match` | String | Use this attribute to partially fuzzy match the specified string. For example, to filter on a specific SKU, specify a value such as `24-MB01` +`match_type` | FilterMatchTypeEnum | Use this attribute to finetune the type of search by specifying PARTIAL or FULL. If match_type is not provided, the search will default to match_type PARTIAL. You must specify a `FilterMatchTypeInput` object to filter on a custom product attribute of the following types: @@ -634,6 +635,138 @@ The following sample query returns product by SKU. You have to pass SKU value to } ``` +### Query with filter by name attribute and match_type + +The following sample query returns different results if match_type is provided besides the product name. You have to pass name value to return product information. If match_type is not provided, the results will default to match_type: PARTIAL. + +**Request:** + +```graphql +{ + products(filter: { name: { match: "Life", match_type: PARTIAL } }) { + items { + name + sku + url_key + stock_status + price_range { + minimum_price { + regular_price { + value + currency + } + } + } + } + total_count + page_info { + page_size + } + } +} +``` + +**Response:** + +```json +{ + "data": { + "products": { + "items": [ + { + "name": "Luma Yoga For Life", + "sku": "240-LV09", + "url_key": "luma-yoga-for-life", + "stock_status": "IN_STOCK", + "price_range": { + "minimum_price": { + "regular_price": { + "value": 0, + "currency": "USD" + } + } + } + } + ], + "total_count": 1, + "page_info": { + "page_size": 20 + } + } + } +} +``` + +```graphql +{ + products(filter: { name: { match: "Life", match_type: FULL } }) { + items { + name + sku + url_key + stock_status + price_range { + minimum_price { + regular_price { + value + currency + } + } + } + } + total_count + page_info { + page_size + } + } +} +``` + +**Response:** + +```json +{ + "data": { + "products": { + "items": [ + { + "name": "Luma Yoga For Life", + "sku": "240-LV09", + "url_key": "luma-yoga-for-life", + "stock_status": "IN_STOCK", + "price_range": { + "minimum_price": { + "regular_price": { + "value": 0, + "currency": "USD" + } + } + } + }, + { + "name": "LifeLong Fitness IV", + "sku": "240-LV05", + "url_key": "lifelong-fitness-iv", + "stock_status": "IN_STOCK", + "price_range": { + "minimum_price": { + "regular_price": { + "value": 14, + "currency": "USD" + } + } + } + } + ], + "total_count": 2, + "page_info": { + "page_size": 20 + } + } + } +} +``` + ### Query with layered navigation The following query returns aggregations for a query that filters on items with these characteristics: From 42d0e18dae47c683b7c97e5a605e29e162aa2e4b Mon Sep 17 00:00:00 2001 From: Alexandra Zota Date: Wed, 30 Aug 2023 12:27:32 +0300 Subject: [PATCH 2/4] ACP2E-2119: update documentation with new added attribute and examples. --- src/pages/graphql/schema/products/queries/products.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/graphql/schema/products/queries/products.md b/src/pages/graphql/schema/products/queries/products.md index df58ad253..5582e0440 100644 --- a/src/pages/graphql/schema/products/queries/products.md +++ b/src/pages/graphql/schema/products/queries/products.md @@ -637,7 +637,9 @@ The following sample query returns product by SKU. You have to pass SKU value to ### Query with filter by name attribute and match_type -The following sample query returns different results if match_type is provided besides the product name. You have to pass name value to return product information. If match_type is not provided, the results will default to match_type: PARTIAL. +The following sample query returns different results if match_type is provided besides the product name. +You have to pass name value and select between PARTIAL and FULL for match_type to return product information. +If match_type is not provided, the results will default to match_type: PARTIAL. **Request:** From f27a2c65398d784ceb5ebe15f4c6c58e71f09b36 Mon Sep 17 00:00:00 2001 From: Alexandra Zota Date: Mon, 11 Sep 2023 12:21:07 +0300 Subject: [PATCH 3/4] ACP2E-2119: update documentation with new added attribute and examples. --- .../graphql/schema/products/queries/products.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/graphql/schema/products/queries/products.md b/src/pages/graphql/schema/products/queries/products.md index 94a824e75..70853b1ff 100644 --- a/src/pages/graphql/schema/products/queries/products.md +++ b/src/pages/graphql/schema/products/queries/products.md @@ -81,12 +81,12 @@ Attribute | Data type | Description #### FilterMatchTypeInput attributes -Use the `FilterMatchTypeInput` object to construct a filter that returns products that partially fuzzy match a string or contain the specified pattern. +Use the `FilterMatchTypeInput` object to construct a filter that returns products that partially match a string or contain the specified pattern. Attribute | Data type | Description --- | --- | --- -`match` | String | Use this attribute to partially fuzzy match the specified string. For example, to filter on a specific SKU, specify a value such as `24-MB01` -`match_type` | FilterMatchTypeEnum | Use this attribute to finetune the type of search by specifying PARTIAL or FULL. If match_type is not provided, the search will default to match_type PARTIAL. +`match` | String | Use this attribute to partially match the specified string. For example, to filter on a specific SKU, specify a value such as `24-MB01` +`match_type` | FilterMatchTypeEnum | Use this attribute to finetune the type of search by specifying the word type match, PARTIAL or FULL. If match_type is not provided, the search will default to match_type FULL. You must specify a `FilterMatchTypeInput` object to filter on a custom product attribute of the following types: @@ -639,13 +639,13 @@ The following sample query returns product by SKU. You have to pass SKU value to The following sample query returns different results if match_type is provided besides the product name. You have to pass name value and select between PARTIAL and FULL for match_type to return product information. -If match_type is not provided, the results will default to match_type: PARTIAL. +If match_type is not provided, the results will default to match_type: FULL. **Request:** ```graphql { - products(filter: { name: { match: "Life", match_type: PARTIAL } }) { + products(filter: { name: { match: "Life", match_type: FULL } }) { items { name sku @@ -701,7 +701,7 @@ If match_type is not provided, the results will default to match_type: PARTIAL. ```graphql { - products(filter: { name: { match: "Life", match_type: FULL } }) { + products(filter: { name: { match: "Life", match_type: PARTIAL } }) { items { name sku From dba07811fae993270ad69adafc2dd4aedb6a1972 Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Tue, 26 Mar 2024 14:52:56 -0500 Subject: [PATCH 4/4] Updating for grammar --- src/pages/graphql/schema/products/queries/products.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/pages/graphql/schema/products/queries/products.md b/src/pages/graphql/schema/products/queries/products.md index 82a619053..1057a8a89 100644 --- a/src/pages/graphql/schema/products/queries/products.md +++ b/src/pages/graphql/schema/products/queries/products.md @@ -372,11 +372,10 @@ The following sample query returns product by SKU. You have to pass SKU value to } ``` -### Query with filter by name attribute and match_type +### Query with filter by `name` attribute and `match_type` -The following sample query returns different results if match_type is provided besides the product name. -You have to pass name value and select between PARTIAL and FULL for match_type to return product information. -If match_type is not provided, the results will default to match_type: FULL. +The following sample query returns different results, depending on the value of `match_type`. The default value of `FULL` +indicates the query returns full word matches. If you specify `PARTIAL`, the query performs a partial word search, **Request:**