From f0b05d87f0b67199dcefd2c40e8bf32e1230eae9 Mon Sep 17 00:00:00 2001 From: Tiago Gimenes Date: Fri, 21 Oct 2022 14:40:24 -0300 Subject: [PATCH 01/10] disable introspection --- node/middlewares/run.ts | 2 ++ node/package.json | 5 +++-- node/yarn.lock | 15 ++++++++++----- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/node/middlewares/run.ts b/node/middlewares/run.ts index 3bae4fc..e852e61 100644 --- a/node/middlewares/run.ts +++ b/node/middlewares/run.ts @@ -1,5 +1,6 @@ import { LINKED, MAX_AGE } from '@vtex/api' import { runHttpQuery } from 'apollo-server-core' +import NoIntrospection from 'graphql-disable-introspection' export default async function run(ctx: Context, next: () => Promise) { const { @@ -20,6 +21,7 @@ export default async function run(ctx: Context, next: () => Promise) { schema, schemaHash: '' as any, tracing: false, + validationRules: [NoIntrospection] }, query, request, diff --git a/node/package.json b/node/package.json index e9d738e..849d79f 100644 --- a/node/package.json +++ b/node/package.json @@ -12,10 +12,11 @@ "co-body": "^6.0.0", "eslint-config-vtex": "^12.8.8", "graphql": "^15.3.0", - "isomorphic-unfetch": "^3.1.0" + "isomorphic-unfetch": "^3.1.0", + "graphql-disable-introspection": "^1.2.0" }, "devDependencies": { - "@vtex/api": "6.45.4", + "@vtex/api": "6.45.12", "typescript": "3.9.7", "vtex.admin-cms-graphql": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.admin-cms-graphql@0.15.0/public/@types/vtex.admin-cms-graphql", "vtex.checkout-graphql": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.checkout-graphql@0.55.1/public/@types/vtex.checkout-graphql", diff --git a/node/yarn.lock b/node/yarn.lock index 7922128..4e44ec3 100644 --- a/node/yarn.lock +++ b/node/yarn.lock @@ -411,10 +411,10 @@ dependencies: eslint-visitor-keys "^1.1.0" -"@vtex/api@6.45.4": - version "6.45.4" - resolved "https://registry.yarnpkg.com/@vtex/api/-/api-6.45.4.tgz#58be7497c0c0f91a388fabd42149e48cb95e271d" - integrity sha512-DVAJr5BkSjXupjn2h5Z1In8C3Li9kZwCXPwRQbpIgyS7s9dN2ZEFQc6nQlJm6ZoDCoyYBg62LgD7Kurvz9jc3w== +"@vtex/api@6.45.12": + version "6.45.12" + resolved "https://registry.yarnpkg.com/@vtex/api/-/api-6.45.12.tgz#b13c04398b12f576263ea823369f09c970d57479" + integrity sha512-SVLKo+Q/TxQy+1UKzH8GswTI3F2OCRCLfgaNQOrVAVdbM6Ci4wzTeX8j/S4Q1aEEnqBFlH/wVpHf8I6NBa+g9A== dependencies: "@types/koa" "^2.11.0" "@types/koa-compose" "^3.2.3" @@ -1439,6 +1439,11 @@ graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== +graphql-disable-introspection@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/graphql-disable-introspection/-/graphql-disable-introspection-1.2.0.tgz#3813885ea1053c65a7a0090e2cb160388a5575a2" + integrity sha512-bRY1LWCOzho/snYsLZ0N2J78zgCDtcFdbdZILxWGi8TifLLYf2bHZ3yw5r1NX42K87AMEOT0d11XScVrcJ+Zig== + graphql-extensions@^0.12.4: version "0.12.4" resolved "https://registry.yarnpkg.com/graphql-extensions/-/graphql-extensions-0.12.4.tgz#c0aa49a20f983a2da641526d1e505996bd2b4188" @@ -2386,7 +2391,7 @@ spdx-license-ids@^3.0.0: resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz#c80757383c28abf7296744998cbc106ae8b854ce" integrity sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw== -"stats-lite@github:vtex/node-stats-lite#dist": +stats-lite@vtex/node-stats-lite#dist: version "2.2.0" resolved "https://codeload.github.com/vtex/node-stats-lite/tar.gz/1b0d39cc41ef7aaecfd541191f877887a2044797" dependencies: From a5d52caaad84f5bedfbfe197767e0d404d0d37ce Mon Sep 17 00:00:00 2001 From: Tiago Gimenes Date: Fri, 21 Oct 2022 14:40:38 -0300 Subject: [PATCH 02/10] Release v1.1.0-beta.0 --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 44d506c..96ad41e 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema", "vendor": "vtex", "name": "graphql-gateway", - "version": "1.0.0", + "version": "1.1.0-beta.0", "title": "GraphQL Gateway for VTEX APIs", "description": "A Graph containing all VTEX's commerce APIs", "builders": { From a05f0480bf5e3cebed4bba20b06ffb8597890cb6 Mon Sep 17 00:00:00 2001 From: Tiago Gimenes Date: Fri, 21 Oct 2022 14:43:40 -0300 Subject: [PATCH 03/10] fix typings --- node/typings/graphql-disabe-introspection.d.ts | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 node/typings/graphql-disabe-introspection.d.ts diff --git a/node/typings/graphql-disabe-introspection.d.ts b/node/typings/graphql-disabe-introspection.d.ts new file mode 100644 index 0000000..8daed1f --- /dev/null +++ b/node/typings/graphql-disabe-introspection.d.ts @@ -0,0 +1,3 @@ +declare module 'graphql-disable-introspection' { + export default function NoIntrospection(context: any): any +} From e795324f198f8e1a0ad546867155fde6eb5e875f Mon Sep 17 00:00:00 2001 From: Tiago Gimenes Date: Fri, 21 Oct 2022 14:44:44 -0300 Subject: [PATCH 04/10] renname file --- ...sabe-introspection.d.ts => graphql-disable-introspection.d.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename node/typings/{graphql-disabe-introspection.d.ts => graphql-disable-introspection.d.ts} (100%) diff --git a/node/typings/graphql-disabe-introspection.d.ts b/node/typings/graphql-disable-introspection.d.ts similarity index 100% rename from node/typings/graphql-disabe-introspection.d.ts rename to node/typings/graphql-disable-introspection.d.ts From 70cacd9b4ad0217380c6d98d23dbbfa33dbec26c Mon Sep 17 00:00:00 2001 From: Tiago Gimenes Date: Fri, 21 Oct 2022 14:51:11 -0300 Subject: [PATCH 05/10] include d..ts --- node/package.json | 4 ++-- node/tsconfig.json | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/node/package.json b/node/package.json index 849d79f..c85e364 100644 --- a/node/package.json +++ b/node/package.json @@ -12,8 +12,8 @@ "co-body": "^6.0.0", "eslint-config-vtex": "^12.8.8", "graphql": "^15.3.0", - "isomorphic-unfetch": "^3.1.0", - "graphql-disable-introspection": "^1.2.0" + "graphql-disable-introspection": "^1.2.0", + "isomorphic-unfetch": "^3.1.0" }, "devDependencies": { "@vtex/api": "6.45.12", diff --git a/node/tsconfig.json b/node/tsconfig.json index 7abe215..cd13a17 100644 --- a/node/tsconfig.json +++ b/node/tsconfig.json @@ -5,5 +5,9 @@ "strict": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true - } + }, + "typeAcquisition": { + "enable": false + }, + "include": ["./**/*.ts", "./typings/*.d.ts"] } From dd1399875726124097b783fde43d8d816c69500c Mon Sep 17 00:00:00 2001 From: Tiago Gimenes Date: Fri, 21 Oct 2022 14:51:33 -0300 Subject: [PATCH 06/10] Release v1.1.0-beta.1 --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 96ad41e..1b6463b 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema", "vendor": "vtex", "name": "graphql-gateway", - "version": "1.1.0-beta.0", + "version": "1.1.0-beta.1", "title": "GraphQL Gateway for VTEX APIs", "description": "A Graph containing all VTEX's commerce APIs", "builders": { From dee1f3dce02782d731de5675594dfec7a3ff1d86 Mon Sep 17 00:00:00 2001 From: Guilherme Carvalho Date: Wed, 26 Oct 2022 11:19:03 -0300 Subject: [PATCH 07/10] Log request --- node/middlewares/run.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node/middlewares/run.ts b/node/middlewares/run.ts index e852e61..c01b535 100644 --- a/node/middlewares/run.ts +++ b/node/middlewares/run.ts @@ -9,6 +9,8 @@ export default async function run(ctx: Context, next: () => Promise) { request, } = ctx + console.log(request) + const { graphqlResponse, responseInit } = await runHttpQuery([], { method, options: { From 363b3dc2f6eff459335f6ff40def97a20702930c Mon Sep 17 00:00:00 2001 From: Guilherme Carvalho Date: Wed, 26 Oct 2022 11:29:41 -0300 Subject: [PATCH 08/10] Release v1.1.0-beta.2 --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 1b6463b..62293ec 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema", "vendor": "vtex", "name": "graphql-gateway", - "version": "1.1.0-beta.1", + "version": "1.1.0-beta.2", "title": "GraphQL Gateway for VTEX APIs", "description": "A Graph containing all VTEX's commerce APIs", "builders": { From 7c8c67c666ee9ef96646fc1a76dcb732b08bf616 Mon Sep 17 00:00:00 2001 From: Guilherme Carvalho Date: Wed, 26 Oct 2022 11:33:27 -0300 Subject: [PATCH 09/10] Revert "Release v1.1.0-beta.2" This reverts commit 363b3dc2f6eff459335f6ff40def97a20702930c. --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 62293ec..1b6463b 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema", "vendor": "vtex", "name": "graphql-gateway", - "version": "1.1.0-beta.2", + "version": "1.1.0-beta.1", "title": "GraphQL Gateway for VTEX APIs", "description": "A Graph containing all VTEX's commerce APIs", "builders": { From 8d9fab68b1b4d0ad225342a0db979c219f440822 Mon Sep 17 00:00:00 2001 From: Guilherme Carvalho Date: Wed, 26 Oct 2022 11:34:02 -0300 Subject: [PATCH 10/10] Release v1.1.0-beta.2 --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 1b6463b..62293ec 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema", "vendor": "vtex", "name": "graphql-gateway", - "version": "1.1.0-beta.1", + "version": "1.1.0-beta.2", "title": "GraphQL Gateway for VTEX APIs", "description": "A Graph containing all VTEX's commerce APIs", "builders": {