From 21238a8819099e2973bd7cf4f1960471b10cdafc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Seixas?= Date: Tue, 3 Sep 2024 09:41:17 -0300 Subject: [PATCH 1/6] feat: return empty array to a deprecated endpoint --- node/clients/checkout.ts | 9 ++++++++- node/resolvers/checkout/index.ts | 14 ++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/node/clients/checkout.ts b/node/clients/checkout.ts index b12b2236b..464810ef0 100644 --- a/node/clients/checkout.ts +++ b/node/clients/checkout.ts @@ -220,8 +220,15 @@ export class Checkout extends JanusClient { }) } + // Deprecated: This endpoint is deprecated and any request will return an empty array public orders = () => - this.get(this.routes.orders, { metric: 'checkout-orders' }) + this.get(this.routes.orders, { metric: 'checkout-orders' }).catch((err) => { + if (err.response && err.response.status === 405) { + return [] + } + + throw err + }) public simulation = (simulation: SimulationPayload) => this.post( diff --git a/node/resolvers/checkout/index.ts b/node/resolvers/checkout/index.ts index 88e0ba92c..f0b95ff0e 100644 --- a/node/resolvers/checkout/index.ts +++ b/node/resolvers/checkout/index.ts @@ -304,6 +304,20 @@ export const queries: Record = { return checkout.orders() }, + // orders: async (_, __, { clients: { checkout } }) => { + // try { + // const result = await checkout.orders() + + // return result + // } catch (err) { + // if (err.response && err.response.status === 405) { + // return [] + // } + + // throw err + // } + // }, + shipping: (_, args: any, { clients: { checkout } }) => { return checkout.simulation(args) }, From 53fc0718b4462a7d927e0915b2ca82d47b359a1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Seixas?= Date: Tue, 3 Sep 2024 09:41:31 -0300 Subject: [PATCH 2/6] Release v2.171.1-beta --- CHANGELOG.md | 6 ++++++ manifest.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cee64f71..7c5a2ab69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [2.171.1-beta] - 2024-09-03 + ## [2.171.0] - 2024-06-28 ### Fixed @@ -2469,3 +2471,7 @@ Added documentSchema query to make it possible for retrieving masterdata schema ### Added - **Resolver** Login resolver to provide GraphQL queries and mutations. + + +[Unreleased]: https://github.com/vtex-apps/store-graphql/compare/v2.171.1-beta...HEAD +[2.171.1-beta]: https://github.com/vtex-apps/store-graphql/compare/v2.171.0...v2.171.1-beta \ No newline at end of file diff --git a/manifest.json b/manifest.json index e762a7393..3967a8a27 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "vendor": "vtex", "name": "store-graphql", - "version": "2.171.0", + "version": "2.171.1-beta", "title": "GraphQL API for the VTEX store APIs", "description": "GraphQL schema and resolvers for the VTEX API for the catalog and orders.", "credentialType": "absolute", From 980975dbdb58b4757955c24472503e4719218e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Seixas?= Date: Tue, 3 Sep 2024 12:20:05 -0300 Subject: [PATCH 3/6] add changelog --- CHANGELOG.md | 3 ++- node/resolvers/checkout/index.ts | 14 -------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c5a2ab69..61ff8a732 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] -## [2.171.1-beta] - 2024-09-03 +### Deprecated +- Checkout orders endpoint. Now returns empty array ## [2.171.0] - 2024-06-28 diff --git a/node/resolvers/checkout/index.ts b/node/resolvers/checkout/index.ts index f0b95ff0e..88e0ba92c 100644 --- a/node/resolvers/checkout/index.ts +++ b/node/resolvers/checkout/index.ts @@ -304,20 +304,6 @@ export const queries: Record = { return checkout.orders() }, - // orders: async (_, __, { clients: { checkout } }) => { - // try { - // const result = await checkout.orders() - - // return result - // } catch (err) { - // if (err.response && err.response.status === 405) { - // return [] - // } - - // throw err - // } - // }, - shipping: (_, args: any, { clients: { checkout } }) => { return checkout.simulation(args) }, From 23d6287b5edb7712cce9701705f4e827c59efc96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Seixas?= Date: Tue, 3 Sep 2024 16:37:06 -0300 Subject: [PATCH 4/6] Update manifest.json Co-authored-by: Iago Espinoza --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 3967a8a27..e762a7393 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "vendor": "vtex", "name": "store-graphql", - "version": "2.171.1-beta", + "version": "2.171.0", "title": "GraphQL API for the VTEX store APIs", "description": "GraphQL schema and resolvers for the VTEX API for the catalog and orders.", "credentialType": "absolute", From 01c881a5b63013b3f237c12f8df7246130a4c609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Seixas?= Date: Tue, 3 Sep 2024 16:37:22 -0300 Subject: [PATCH 5/6] Update CHANGELOG.md Co-authored-by: Iago Espinoza --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61ff8a732..9d5195ac7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] ### Deprecated -- Checkout orders endpoint. Now returns empty array +- Checkout orders endpoint now returns an empty array ## [2.171.0] - 2024-06-28 From 6ab8e0b705d74e8394f39feb53530393ce148154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Seixas?= Date: Tue, 3 Sep 2024 16:39:10 -0300 Subject: [PATCH 6/6] fix changelog --- CHANGELOG.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61ff8a732..d6611b8ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2472,7 +2472,3 @@ Added documentSchema query to make it possible for retrieving masterdata schema ### Added - **Resolver** Login resolver to provide GraphQL queries and mutations. - - -[Unreleased]: https://github.com/vtex-apps/store-graphql/compare/v2.171.1-beta...HEAD -[2.171.1-beta]: https://github.com/vtex-apps/store-graphql/compare/v2.171.0...v2.171.1-beta \ No newline at end of file