From ed10118b2abdfb0f0fbaaff3780228dafc39d66e Mon Sep 17 00:00:00 2001 From: Mariana Caetano Pereira Date: Thu, 19 Dec 2024 13:42:07 -0300 Subject: [PATCH 1/3] New FastStore release note --- ...roviders-gift-card-transaction-analysis.md | 1 - ...024-12-20-new-sponsored-count-parameter.md | 64 +++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 docs/release-notes/2024-12-20-new-sponsored-count-parameter.md diff --git a/docs/release-notes/2024-12-19-new-feature-available-for-anti-fraud-providers-gift-card-transaction-analysis.md b/docs/release-notes/2024-12-19-new-feature-available-for-anti-fraud-providers-gift-card-transaction-analysis.md index c9bab2a55f..7a5f04d910 100644 --- a/docs/release-notes/2024-12-19-new-feature-available-for-anti-fraud-providers-gift-card-transaction-analysis.md +++ b/docs/release-notes/2024-12-19-new-feature-available-for-anti-fraud-providers-gift-card-transaction-analysis.md @@ -58,5 +58,4 @@ To enable the gift card data analysis at your anti-fraud provider, follow the st 2. Open a ticket with [VTEX Support](https://help.vtex.com/support) requesting the provider integration update. 3. Contact VTEX merchants with whom you have contracts to inform them about the availability of this new anti-fraud analysis service. - > ⚠️ Learn more in the [Announcement Anti-fraud analysis for gift cards](https://help.vtex.com/en/announcements/anti-fraud-analysis-for-gift-cards). \ No newline at end of file diff --git a/docs/release-notes/2024-12-20-new-sponsored-count-parameter.md b/docs/release-notes/2024-12-20-new-sponsored-count-parameter.md new file mode 100644 index 0000000000..8ca185c757 --- /dev/null +++ b/docs/release-notes/2024-12-20-new-sponsored-count-parameter.md @@ -0,0 +1,64 @@ +--- +title: "FastStore: Improved search query with the `sponsoredCount` parameter" +slug: "2024-12-20-new-sponsored-count-parameter" +hidden: false +type: "added" +createdAt: "2024-12-20T00:00:00.219Z" +excerpt: "FastStore projects now include a new parameter to improve the management of sponsored product search results." +--- + +We've added a new parameter, `sponsoredCount`, to the search query. This parameter gives more control over the number of sponsored products returned in your store’s search results. + +> ⚠ Extension API users: If you are using the [`ClientProductGallery`](https://developers.vtex.com/docs/guides/faststore/api-extensions-extending-queries-using-fragments#clientproductgalleryquery) fragment, this change may cause errors. Make sure your implementation is updated to handle the `sponsoredCount` parameter accordingly by following the instructions in the [next section](#api-extension-users). + +## What needs to be done? + +To have the new parameter enabled in your project, follow these steps: + +1. Open your FastStore project using your preferred code editor. +2. Update your FastStore project to version `3.0.157` or later, by running the following: + + ```bash + yarn upgrade -L --scope @faststore + ``` + +3. Run `yarn build`. + +### API extension users + +If you are using the [`ClientProductGallery`](https://developers.vtex.com/docs/guides/faststore/api-extensions-extending-queries-using-fragments#clientproductgalleryquery) fragment, after updating the store version to the latest one, you may encounter the following error: + +```bash +[FAILED] GraphQL Document Validation failed with 1 errors; +[FAILED] Error 0: Fields "search" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional. +[FAILED] at /Users/fanny.chien/Work/faststore.store/.faststore/src/sdk/product/usePageProductsQuery.ts:11:5 +[FAILED] at /Users/fanny.chien/Work/faststore.store/.faststore/src/sdk/product/usePageProductsQuery.ts:3:5 +[SUCCESS] Generate outputs +Running lifecycle hook "afterStart" scripts... +``` + +To fix it, follow these steps: + +1. Go to the file where you are using the `ClientManyProducts` fragment, and add the missing `sponsoredCount` parameter. + + ```ts mark=8 + import { gql } from "@faststore/core/api"; + + export const fragment = gql(` + fragment ClientManyProducts on Query { + search( + first: $first + after: $after + sort: $sort + term: $term + selectedFacets: $selectedFacets + sponsoredCount: $sponsoredCount // Add this parameter! + ) { + … + } + } + `); + ``` + +2. Save the changes. +3. Run `yarn build` once again. From 34105f70fcbc7d936d3c3476a50e440215a45aa6 Mon Sep 17 00:00:00 2001 From: Mariana Caetano Pereira Date: Thu, 19 Dec 2024 14:18:53 -0300 Subject: [PATCH 2/3] markdown lint --- ...e-for-anti-fraud-providers-gift-card-transaction-analysis.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/release-notes/2024-12-19-new-feature-available-for-anti-fraud-providers-gift-card-transaction-analysis.md b/docs/release-notes/2024-12-19-new-feature-available-for-anti-fraud-providers-gift-card-transaction-analysis.md index 7a5f04d910..ba28f2c43e 100644 --- a/docs/release-notes/2024-12-19-new-feature-available-for-anti-fraud-providers-gift-card-transaction-analysis.md +++ b/docs/release-notes/2024-12-19-new-feature-available-for-anti-fraud-providers-gift-card-transaction-analysis.md @@ -58,4 +58,4 @@ To enable the gift card data analysis at your anti-fraud provider, follow the st 2. Open a ticket with [VTEX Support](https://help.vtex.com/support) requesting the provider integration update. 3. Contact VTEX merchants with whom you have contracts to inform them about the availability of this new anti-fraud analysis service. -> ⚠️ Learn more in the [Announcement Anti-fraud analysis for gift cards](https://help.vtex.com/en/announcements/anti-fraud-analysis-for-gift-cards). \ No newline at end of file +> ⚠️ Learn more in the [Announcement Anti-fraud analysis for gift cards](https://help.vtex.com/en/announcements/anti-fraud-analysis-for-gift-cards). From 62b906274fcfbd21c5eae990b8779deb78fa43a1 Mon Sep 17 00:00:00 2001 From: Mariana Caetano Pereira <67270558+mariana-caetano@users.noreply.github.com> Date: Fri, 20 Dec 2024 07:58:36 -0300 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Carolina Menezes <60782333+carolinamenezes@users.noreply.github.com> --- .../2024-12-20-new-sponsored-count-parameter.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/release-notes/2024-12-20-new-sponsored-count-parameter.md b/docs/release-notes/2024-12-20-new-sponsored-count-parameter.md index 8ca185c757..179f39dae0 100644 --- a/docs/release-notes/2024-12-20-new-sponsored-count-parameter.md +++ b/docs/release-notes/2024-12-20-new-sponsored-count-parameter.md @@ -7,13 +7,13 @@ createdAt: "2024-12-20T00:00:00.219Z" excerpt: "FastStore projects now include a new parameter to improve the management of sponsored product search results." --- -We've added a new parameter, `sponsoredCount`, to the search query. This parameter gives more control over the number of sponsored products returned in your store’s search results. +We've added a new parameter, `sponsoredCount`, to FastStore's search query. This new parameter allows you to control the number of sponsored products displayed in your store’s search results, providing more flexibility in managing search relevance and sponsored content. -> ⚠ Extension API users: If you are using the [`ClientProductGallery`](https://developers.vtex.com/docs/guides/faststore/api-extensions-extending-queries-using-fragments#clientproductgalleryquery) fragment, this change may cause errors. Make sure your implementation is updated to handle the `sponsoredCount` parameter accordingly by following the instructions in the [next section](#api-extension-users). +> ❗️ Extension API users: If you are using the [`ClientProductGallery`](https://developers.vtex.com/docs/guides/faststore/api-extensions-extending-queries-using-fragments#clientproductgalleryquery) fragment, this change may cause errors. To prevent issues, ensure your implementation is updated to handle the `sponsoredCount` parameter by following the instructions in the [API Extension Users](#api-extension-users) section below. ## What needs to be done? -To have the new parameter enabled in your project, follow these steps: +To enable this new feature in your FastStore project, follow these steps: 1. Open your FastStore project using your preferred code editor. 2. Update your FastStore project to version `3.0.157` or later, by running the following: @@ -26,7 +26,7 @@ To have the new parameter enabled in your project, follow these steps: ### API extension users -If you are using the [`ClientProductGallery`](https://developers.vtex.com/docs/guides/faststore/api-extensions-extending-queries-using-fragments#clientproductgalleryquery) fragment, after updating the store version to the latest one, you may encounter the following error: +If you are using the [`ClientProductGallery`](https://developers.vtex.com/docs/guides/faststore/api-extensions-extending-queries-using-fragments#clientproductgalleryquery) fragment, you may encounter the following error after upgrading your FastStore version: ```bash [FAILED] GraphQL Document Validation failed with 1 errors; @@ -39,7 +39,7 @@ Running lifecycle hook "afterStart" scripts... To fix it, follow these steps: -1. Go to the file where you are using the `ClientManyProducts` fragment, and add the missing `sponsoredCount` parameter. +1. Go to the file where you are using the `ClientManyProducts` fragment, and add the missing `sponsoredCount` parameter. For example: ```ts mark=8 import { gql } from "@faststore/core/api";