Repository navigation
feat: increments commerce client - #2647
Merged
lucasfp13 merged 3 commits intoFeb 6, 2025
Merged
Conversation
Guilera
requested review from
eduardoformiga and
lariciamota
and removed request for
a team
January 29, 2025 14:40
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Guilera
force-pushed
the
feat/reviews-and-ratings-api-client
branch
from
January 29, 2025 17:09
ce8c9eb to
c6b757a
Compare
This was referenced Jan 29, 2025
Guilera
force-pushed
the
feat/reviews-and-ratings-api-client
branch
from
January 30, 2025 14:26
c6b757a to
e09bd30
Compare
Guilera
force-pushed
the
feat/reviews-and-ratings-api-client
branch
from
January 30, 2025 14:39
e09bd30 to
9f3b8a6
Compare
lucasfp13
reviewed
Feb 4, 2025
lucasfp13
left a comment
Contributor
There was a problem hiding this comment.
Raise some discussions 💭
lucasfp13
approved these changes
Feb 4, 2025
lucasfp13
left a comment
Contributor
There was a problem hiding this comment.
The commerce functions are working as expected, LGTM!
pedromtec
reviewed
Feb 5, 2025
pedromtec
reviewed
Feb 5, 2025
pedromtec
reviewed
Feb 5, 2025
lucasfp13
reviewed
Feb 5, 2025
pedromtec
approved these changes
Feb 6, 2025
artursantiago
pushed a commit
that referenced
this pull request
Feb 7, 2025
## What's the purpose of this pull request?
To add the Reviews & Ratings API integration through commerce client
## How it works?
Adds 3 new calls to the client:
- client.commerce.rating (retrieves rating information for a specific
product)
- client.commerce.reviews.list (retrieves all reviews for a specific
product)
- client.commerce.reviews.create (creates a new review for a specific
product)
## How to test it?
Creates a `.ts` file on the root folder of the project and adds the
following code:
```typescript
import { getContextFactory, Options } from "./packages/api/src/platforms/vtex";
const apiOptions = {
platform: 'vtex',
account: 'storeframework',
locale: 'en-US',
environment: 'vtexcommercestable',
channel: '{"salesChannel":"1"}',
showSponsored: false,
} as Options
const apiCtx = getContextFactory(apiOptions)
const commerceApiClient = apiCtx({}).clients.commerce
```
After that you can use the `commerceApiClient` to call the new methods.
To run the file locally use the following command:
```bash
npx tsx
```
## References
[JIRA Task: SFS-2092](https://vtex-dev.atlassian.net/browse/SFS-2092)
[Reviews & Ratings API
Doc](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#overview)
## Checklist
**PR Description**
- [ ] Added Rating types
- [ ] Added Reviews types
- [ ] Incremented ProductSearchReviewResult
- [ ] Created adapatObject function on `utils`
- [ ] Created camelToSnakeCase function on `utils`
artursantiago
pushed a commit
that referenced
this pull request
Feb 7, 2025
## What's the purpose of this pull request?
To add the Reviews & Ratings API integration through commerce client
## How it works?
Adds 3 new calls to the client:
- client.commerce.rating (retrieves rating information for a specific
product)
- client.commerce.reviews.list (retrieves all reviews for a specific
product)
- client.commerce.reviews.create (creates a new review for a specific
product)
## How to test it?
Creates a `.ts` file on the root folder of the project and adds the
following code:
```typescript
import { getContextFactory, Options } from "./packages/api/src/platforms/vtex";
const apiOptions = {
platform: 'vtex',
account: 'storeframework',
locale: 'en-US',
environment: 'vtexcommercestable',
channel: '{"salesChannel":"1"}',
showSponsored: false,
} as Options
const apiCtx = getContextFactory(apiOptions)
const commerceApiClient = apiCtx({}).clients.commerce
```
After that you can use the `commerceApiClient` to call the new methods.
To run the file locally use the following command:
```bash
npx tsx
```
## References
[JIRA Task: SFS-2092](https://vtex-dev.atlassian.net/browse/SFS-2092)
[Reviews & Ratings API
Doc](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#overview)
## Checklist
**PR Description**
- [ ] Added Rating types
- [ ] Added Reviews types
- [ ] Incremented ProductSearchReviewResult
- [ ] Created adapatObject function on `utils`
- [ ] Created camelToSnakeCase function on `utils`
Guilera
added a commit
that referenced
this pull request
Feb 12, 2025
>⚠️ THIS PR DEPENDS ON [PR#2647](#2647)⚠️ ## What's the purpose of this pull request? To add a reviews mutation resolver on graphQL for allowing a new review to be created ## How it works? It defines a few new types and adds a new mutation resolver called: `createProductReview` ## How to test it? run the api graphql server locally with the following command: ```bash yarn dev:server ``` and make a query call ## References [JIRA TASK: SFS-2095](https://vtex-dev.atlassian.net/browse/SFS-2095) [API Reviews Docs](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#post-/reviews-and-ratings/api/review) ## Checklist <em>You may erase this after checking them all 😉</em> **PR Description** - [ ] Adds graphQL types - [ ] Creates a new mutation resolver for `Reviews`
Guilera
added a commit
that referenced
this pull request
Feb 14, 2025
## What's the purpose of this pull request?
To add the Reviews & Ratings API integration through commerce client
## How it works?
Adds 3 new calls to the client:
- client.commerce.rating (retrieves rating information for a specific
product)
- client.commerce.reviews.list (retrieves all reviews for a specific
product)
- client.commerce.reviews.create (creates a new review for a specific
product)
## How to test it?
Creates a `.ts` file on the root folder of the project and adds the
following code:
```typescript
import { getContextFactory, Options } from "./packages/api/src/platforms/vtex";
const apiOptions = {
platform: 'vtex',
account: 'storeframework',
locale: 'en-US',
environment: 'vtexcommercestable',
channel: '{"salesChannel":"1"}',
showSponsored: false,
} as Options
const apiCtx = getContextFactory(apiOptions)
const commerceApiClient = apiCtx({}).clients.commerce
```
After that you can use the `commerceApiClient` to call the new methods.
To run the file locally use the following command:
```bash
npx tsx
```
## References
[JIRA Task: SFS-2092](https://vtex-dev.atlassian.net/browse/SFS-2092)
[Reviews & Ratings API
Doc](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#overview)
## Checklist
**PR Description**
- [ ] Added Rating types
- [ ] Added Reviews types
- [ ] Incremented ProductSearchReviewResult
- [ ] Created adapatObject function on `utils`
- [ ] Created camelToSnakeCase function on `utils`
Guilera
added a commit
that referenced
this pull request
Feb 14, 2025
>⚠️ THIS PR DEPENDS ON [PR#2647](#2647)⚠️ ## What's the purpose of this pull request? To add a reviews mutation resolver on graphQL for allowing a new review to be created ## How it works? It defines a few new types and adds a new mutation resolver called: `createProductReview` ## How to test it? run the api graphql server locally with the following command: ```bash yarn dev:server ``` and make a query call ## References [JIRA TASK: SFS-2095](https://vtex-dev.atlassian.net/browse/SFS-2095) [API Reviews Docs](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#post-/reviews-and-ratings/api/review) ## Checklist <em>You may erase this after checking them all 😉</em> **PR Description** - [ ] Adds graphQL types - [ ] Creates a new mutation resolver for `Reviews`
artursantiago
pushed a commit
that referenced
this pull request
Feb 14, 2025
## What's the purpose of this pull request?
To add the Reviews & Ratings API integration through commerce client
## How it works?
Adds 3 new calls to the client:
- client.commerce.rating (retrieves rating information for a specific
product)
- client.commerce.reviews.list (retrieves all reviews for a specific
product)
- client.commerce.reviews.create (creates a new review for a specific
product)
## How to test it?
Creates a `.ts` file on the root folder of the project and adds the
following code:
```typescript
import { getContextFactory, Options } from "./packages/api/src/platforms/vtex";
const apiOptions = {
platform: 'vtex',
account: 'storeframework',
locale: 'en-US',
environment: 'vtexcommercestable',
channel: '{"salesChannel":"1"}',
showSponsored: false,
} as Options
const apiCtx = getContextFactory(apiOptions)
const commerceApiClient = apiCtx({}).clients.commerce
```
After that you can use the `commerceApiClient` to call the new methods.
To run the file locally use the following command:
```bash
npx tsx
```
## References
[JIRA Task: SFS-2092](https://vtex-dev.atlassian.net/browse/SFS-2092)
[Reviews & Ratings API
Doc](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#overview)
## Checklist
**PR Description**
- [ ] Added Rating types
- [ ] Added Reviews types
- [ ] Incremented ProductSearchReviewResult
- [ ] Created adapatObject function on `utils`
- [ ] Created camelToSnakeCase function on `utils`
artursantiago
pushed a commit
that referenced
this pull request
Feb 14, 2025
>⚠️ THIS PR DEPENDS ON [PR#2647](#2647)⚠️ ## What's the purpose of this pull request? To add a reviews mutation resolver on graphQL for allowing a new review to be created ## How it works? It defines a few new types and adds a new mutation resolver called: `createProductReview` ## How to test it? run the api graphql server locally with the following command: ```bash yarn dev:server ``` and make a query call ## References [JIRA TASK: SFS-2095](https://vtex-dev.atlassian.net/browse/SFS-2095) [API Reviews Docs](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#post-/reviews-and-ratings/api/review) ## Checklist <em>You may erase this after checking them all 😉</em> **PR Description** - [ ] Adds graphQL types - [ ] Creates a new mutation resolver for `Reviews`
artursantiago
pushed a commit
that referenced
this pull request
Feb 14, 2025
## What's the purpose of this pull request?
To add the Reviews & Ratings API integration through commerce client
## How it works?
Adds 3 new calls to the client:
- client.commerce.rating (retrieves rating information for a specific
product)
- client.commerce.reviews.list (retrieves all reviews for a specific
product)
- client.commerce.reviews.create (creates a new review for a specific
product)
## How to test it?
Creates a `.ts` file on the root folder of the project and adds the
following code:
```typescript
import { getContextFactory, Options } from "./packages/api/src/platforms/vtex";
const apiOptions = {
platform: 'vtex',
account: 'storeframework',
locale: 'en-US',
environment: 'vtexcommercestable',
channel: '{"salesChannel":"1"}',
showSponsored: false,
} as Options
const apiCtx = getContextFactory(apiOptions)
const commerceApiClient = apiCtx({}).clients.commerce
```
After that you can use the `commerceApiClient` to call the new methods.
To run the file locally use the following command:
```bash
npx tsx
```
## References
[JIRA Task: SFS-2092](https://vtex-dev.atlassian.net/browse/SFS-2092)
[Reviews & Ratings API
Doc](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#overview)
## Checklist
**PR Description**
- [ ] Added Rating types
- [ ] Added Reviews types
- [ ] Incremented ProductSearchReviewResult
- [ ] Created adapatObject function on `utils`
- [ ] Created camelToSnakeCase function on `utils`
artursantiago
pushed a commit
that referenced
this pull request
Feb 14, 2025
>⚠️ THIS PR DEPENDS ON [PR#2647](#2647)⚠️ ## What's the purpose of this pull request? To add a reviews mutation resolver on graphQL for allowing a new review to be created ## How it works? It defines a few new types and adds a new mutation resolver called: `createProductReview` ## How to test it? run the api graphql server locally with the following command: ```bash yarn dev:server ``` and make a query call ## References [JIRA TASK: SFS-2095](https://vtex-dev.atlassian.net/browse/SFS-2095) [API Reviews Docs](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#post-/reviews-and-ratings/api/review) ## Checklist <em>You may erase this after checking them all 😉</em> **PR Description** - [ ] Adds graphQL types - [ ] Creates a new mutation resolver for `Reviews`
artursantiago
pushed a commit
that referenced
this pull request
Feb 14, 2025
## What's the purpose of this pull request?
To add the Reviews & Ratings API integration through commerce client
## How it works?
Adds 3 new calls to the client:
- client.commerce.rating (retrieves rating information for a specific
product)
- client.commerce.reviews.list (retrieves all reviews for a specific
product)
- client.commerce.reviews.create (creates a new review for a specific
product)
## How to test it?
Creates a `.ts` file on the root folder of the project and adds the
following code:
```typescript
import { getContextFactory, Options } from "./packages/api/src/platforms/vtex";
const apiOptions = {
platform: 'vtex',
account: 'storeframework',
locale: 'en-US',
environment: 'vtexcommercestable',
channel: '{"salesChannel":"1"}',
showSponsored: false,
} as Options
const apiCtx = getContextFactory(apiOptions)
const commerceApiClient = apiCtx({}).clients.commerce
```
After that you can use the `commerceApiClient` to call the new methods.
To run the file locally use the following command:
```bash
npx tsx
```
## References
[JIRA Task: SFS-2092](https://vtex-dev.atlassian.net/browse/SFS-2092)
[Reviews & Ratings API
Doc](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#overview)
## Checklist
**PR Description**
- [ ] Added Rating types
- [ ] Added Reviews types
- [ ] Incremented ProductSearchReviewResult
- [ ] Created adapatObject function on `utils`
- [ ] Created camelToSnakeCase function on `utils`
artursantiago
pushed a commit
that referenced
this pull request
Feb 14, 2025
>⚠️ THIS PR DEPENDS ON [PR#2647](#2647)⚠️ ## What's the purpose of this pull request? To add a reviews mutation resolver on graphQL for allowing a new review to be created ## How it works? It defines a few new types and adds a new mutation resolver called: `createProductReview` ## How to test it? run the api graphql server locally with the following command: ```bash yarn dev:server ``` and make a query call ## References [JIRA TASK: SFS-2095](https://vtex-dev.atlassian.net/browse/SFS-2095) [API Reviews Docs](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#post-/reviews-and-ratings/api/review) ## Checklist <em>You may erase this after checking them all 😉</em> **PR Description** - [ ] Adds graphQL types - [ ] Creates a new mutation resolver for `Reviews`
artursantiago
pushed a commit
that referenced
this pull request
Feb 14, 2025
## What's the purpose of this pull request?
To add the Reviews & Ratings API integration through commerce client
## How it works?
Adds 3 new calls to the client:
- client.commerce.rating (retrieves rating information for a specific
product)
- client.commerce.reviews.list (retrieves all reviews for a specific
product)
- client.commerce.reviews.create (creates a new review for a specific
product)
## How to test it?
Creates a `.ts` file on the root folder of the project and adds the
following code:
```typescript
import { getContextFactory, Options } from "./packages/api/src/platforms/vtex";
const apiOptions = {
platform: 'vtex',
account: 'storeframework',
locale: 'en-US',
environment: 'vtexcommercestable',
channel: '{"salesChannel":"1"}',
showSponsored: false,
} as Options
const apiCtx = getContextFactory(apiOptions)
const commerceApiClient = apiCtx({}).clients.commerce
```
After that you can use the `commerceApiClient` to call the new methods.
To run the file locally use the following command:
```bash
npx tsx
```
## References
[JIRA Task: SFS-2092](https://vtex-dev.atlassian.net/browse/SFS-2092)
[Reviews & Ratings API
Doc](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#overview)
## Checklist
**PR Description**
- [ ] Added Rating types
- [ ] Added Reviews types
- [ ] Incremented ProductSearchReviewResult
- [ ] Created adapatObject function on `utils`
- [ ] Created camelToSnakeCase function on `utils`
artursantiago
pushed a commit
that referenced
this pull request
Feb 14, 2025
>⚠️ THIS PR DEPENDS ON [PR#2647](#2647)⚠️ ## What's the purpose of this pull request? To add a reviews mutation resolver on graphQL for allowing a new review to be created ## How it works? It defines a few new types and adds a new mutation resolver called: `createProductReview` ## How to test it? run the api graphql server locally with the following command: ```bash yarn dev:server ``` and make a query call ## References [JIRA TASK: SFS-2095](https://vtex-dev.atlassian.net/browse/SFS-2095) [API Reviews Docs](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#post-/reviews-and-ratings/api/review) ## Checklist <em>You may erase this after checking them all 😉</em> **PR Description** - [ ] Adds graphQL types - [ ] Creates a new mutation resolver for `Reviews`
Guilera
added a commit
that referenced
this pull request
Feb 18, 2025
## What's the purpose of this pull request?
To add the Reviews & Ratings API integration through commerce client
## How it works?
Adds 3 new calls to the client:
- client.commerce.rating (retrieves rating information for a specific
product)
- client.commerce.reviews.list (retrieves all reviews for a specific
product)
- client.commerce.reviews.create (creates a new review for a specific
product)
## How to test it?
Creates a `.ts` file on the root folder of the project and adds the
following code:
```typescript
import { getContextFactory, Options } from "./packages/api/src/platforms/vtex";
const apiOptions = {
platform: 'vtex',
account: 'storeframework',
locale: 'en-US',
environment: 'vtexcommercestable',
channel: '{"salesChannel":"1"}',
showSponsored: false,
} as Options
const apiCtx = getContextFactory(apiOptions)
const commerceApiClient = apiCtx({}).clients.commerce
```
After that you can use the `commerceApiClient` to call the new methods.
To run the file locally use the following command:
```bash
npx tsx
```
## References
[JIRA Task: SFS-2092](https://vtex-dev.atlassian.net/browse/SFS-2092)
[Reviews & Ratings API
Doc](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#overview)
## Checklist
**PR Description**
- [ ] Added Rating types
- [ ] Added Reviews types
- [ ] Incremented ProductSearchReviewResult
- [ ] Created adapatObject function on `utils`
- [ ] Created camelToSnakeCase function on `utils`
Guilera
added a commit
that referenced
this pull request
Feb 18, 2025
>⚠️ THIS PR DEPENDS ON [PR#2647](#2647)⚠️ ## What's the purpose of this pull request? To add a reviews mutation resolver on graphQL for allowing a new review to be created ## How it works? It defines a few new types and adds a new mutation resolver called: `createProductReview` ## How to test it? run the api graphql server locally with the following command: ```bash yarn dev:server ``` and make a query call ## References [JIRA TASK: SFS-2095](https://vtex-dev.atlassian.net/browse/SFS-2095) [API Reviews Docs](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#post-/reviews-and-ratings/api/review) ## Checklist <em>You may erase this after checking them all 😉</em> **PR Description** - [ ] Adds graphQL types - [ ] Creates a new mutation resolver for `Reviews`
artursantiago
pushed a commit
that referenced
this pull request
Feb 18, 2025
## What's the purpose of this pull request?
To add the Reviews & Ratings API integration through commerce client
## How it works?
Adds 3 new calls to the client:
- client.commerce.rating (retrieves rating information for a specific
product)
- client.commerce.reviews.list (retrieves all reviews for a specific
product)
- client.commerce.reviews.create (creates a new review for a specific
product)
## How to test it?
Creates a `.ts` file on the root folder of the project and adds the
following code:
```typescript
import { getContextFactory, Options } from "./packages/api/src/platforms/vtex";
const apiOptions = {
platform: 'vtex',
account: 'storeframework',
locale: 'en-US',
environment: 'vtexcommercestable',
channel: '{"salesChannel":"1"}',
showSponsored: false,
} as Options
const apiCtx = getContextFactory(apiOptions)
const commerceApiClient = apiCtx({}).clients.commerce
```
After that you can use the `commerceApiClient` to call the new methods.
To run the file locally use the following command:
```bash
npx tsx
```
## References
[JIRA Task: SFS-2092](https://vtex-dev.atlassian.net/browse/SFS-2092)
[Reviews & Ratings API
Doc](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#overview)
## Checklist
**PR Description**
- [ ] Added Rating types
- [ ] Added Reviews types
- [ ] Incremented ProductSearchReviewResult
- [ ] Created adapatObject function on `utils`
- [ ] Created camelToSnakeCase function on `utils`
artursantiago
pushed a commit
that referenced
this pull request
Feb 18, 2025
>⚠️ THIS PR DEPENDS ON [PR#2647](#2647)⚠️ ## What's the purpose of this pull request? To add a reviews mutation resolver on graphQL for allowing a new review to be created ## How it works? It defines a few new types and adds a new mutation resolver called: `createProductReview` ## How to test it? run the api graphql server locally with the following command: ```bash yarn dev:server ``` and make a query call ## References [JIRA TASK: SFS-2095](https://vtex-dev.atlassian.net/browse/SFS-2095) [API Reviews Docs](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#post-/reviews-and-ratings/api/review) ## Checklist <em>You may erase this after checking them all 😉</em> **PR Description** - [ ] Adds graphQL types - [ ] Creates a new mutation resolver for `Reviews`
Guilera
added a commit
that referenced
this pull request
Feb 19, 2025
## What's the purpose of this pull request?
To add the Reviews & Ratings API integration through commerce client
## How it works?
Adds 3 new calls to the client:
- client.commerce.rating (retrieves rating information for a specific
product)
- client.commerce.reviews.list (retrieves all reviews for a specific
product)
- client.commerce.reviews.create (creates a new review for a specific
product)
## How to test it?
Creates a `.ts` file on the root folder of the project and adds the
following code:
```typescript
import { getContextFactory, Options } from "./packages/api/src/platforms/vtex";
const apiOptions = {
platform: 'vtex',
account: 'storeframework',
locale: 'en-US',
environment: 'vtexcommercestable',
channel: '{"salesChannel":"1"}',
showSponsored: false,
} as Options
const apiCtx = getContextFactory(apiOptions)
const commerceApiClient = apiCtx({}).clients.commerce
```
After that you can use the `commerceApiClient` to call the new methods.
To run the file locally use the following command:
```bash
npx tsx
```
## References
[JIRA Task: SFS-2092](https://vtex-dev.atlassian.net/browse/SFS-2092)
[Reviews & Ratings API
Doc](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#overview)
## Checklist
**PR Description**
- [ ] Added Rating types
- [ ] Added Reviews types
- [ ] Incremented ProductSearchReviewResult
- [ ] Created adapatObject function on `utils`
- [ ] Created camelToSnakeCase function on `utils`
Guilera
added a commit
that referenced
this pull request
Feb 19, 2025
>⚠️ THIS PR DEPENDS ON [PR#2647](#2647)⚠️ ## What's the purpose of this pull request? To add a reviews mutation resolver on graphQL for allowing a new review to be created ## How it works? It defines a few new types and adds a new mutation resolver called: `createProductReview` ## How to test it? run the api graphql server locally with the following command: ```bash yarn dev:server ``` and make a query call ## References [JIRA TASK: SFS-2095](https://vtex-dev.atlassian.net/browse/SFS-2095) [API Reviews Docs](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#post-/reviews-and-ratings/api/review) ## Checklist <em>You may erase this after checking them all 😉</em> **PR Description** - [ ] Adds graphQL types - [ ] Creates a new mutation resolver for `Reviews`
pedromtec
pushed a commit
that referenced
this pull request
Mar 11, 2025
## What's the purpose of this pull request?
To add the Reviews & Ratings API integration through commerce client
## How it works?
Adds 3 new calls to the client:
- client.commerce.rating (retrieves rating information for a specific
product)
- client.commerce.reviews.list (retrieves all reviews for a specific
product)
- client.commerce.reviews.create (creates a new review for a specific
product)
## How to test it?
Creates a `.ts` file on the root folder of the project and adds the
following code:
```typescript
import { getContextFactory, Options } from "./packages/api/src/platforms/vtex";
const apiOptions = {
platform: 'vtex',
account: 'storeframework',
locale: 'en-US',
environment: 'vtexcommercestable',
channel: '{"salesChannel":"1"}',
showSponsored: false,
} as Options
const apiCtx = getContextFactory(apiOptions)
const commerceApiClient = apiCtx({}).clients.commerce
```
After that you can use the `commerceApiClient` to call the new methods.
To run the file locally use the following command:
```bash
npx tsx
```
## References
[JIRA Task: SFS-2092](https://vtex-dev.atlassian.net/browse/SFS-2092)
[Reviews & Ratings API
Doc](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#overview)
## Checklist
**PR Description**
- [ ] Added Rating types
- [ ] Added Reviews types
- [ ] Incremented ProductSearchReviewResult
- [ ] Created adapatObject function on `utils`
- [ ] Created camelToSnakeCase function on `utils`
pedromtec
pushed a commit
that referenced
this pull request
Mar 11, 2025
>⚠️ THIS PR DEPENDS ON [PR#2647](#2647)⚠️ ## What's the purpose of this pull request? To add a reviews mutation resolver on graphQL for allowing a new review to be created ## How it works? It defines a few new types and adds a new mutation resolver called: `createProductReview` ## How to test it? run the api graphql server locally with the following command: ```bash yarn dev:server ``` and make a query call ## References [JIRA TASK: SFS-2095](https://vtex-dev.atlassian.net/browse/SFS-2095) [API Reviews Docs](https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#post-/reviews-and-ratings/api/review) ## Checklist <em>You may erase this after checking them all 😉</em> **PR Description** - [ ] Adds graphQL types - [ ] Creates a new mutation resolver for `Reviews`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's the purpose of this pull request?
To add the Reviews & Ratings API integration through commerce client
How it works?
Adds 3 new calls to the client:
How to test it?
Creates a
.tsfile on the root folder of the project and adds the following code:After that you can use the
commerceApiClientto call the new methods.To run the file locally use the following command:
References
JIRA Task: SFS-2092
Reviews & Ratings API Doc
Checklist
PR Description
utilsutils