diff --git a/manifest.json b/manifest.json index 44d506c..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.0.0", + "version": "1.1.0-beta.2", "title": "GraphQL Gateway for VTEX APIs", "description": "A Graph containing all VTEX's commerce APIs", "builders": { diff --git a/node/middlewares/run.ts b/node/middlewares/run.ts index 3bae4fc..c01b535 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 { @@ -8,6 +9,8 @@ export default async function run(ctx: Context, next: () => Promise) { request, } = ctx + console.log(request) + const { graphqlResponse, responseInit } = await runHttpQuery([], { method, options: { @@ -20,6 +23,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..c85e364 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", + "graphql-disable-introspection": "^1.2.0", "isomorphic-unfetch": "^3.1.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/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"] } diff --git a/node/typings/graphql-disable-introspection.d.ts b/node/typings/graphql-disable-introspection.d.ts new file mode 100644 index 0000000..8daed1f --- /dev/null +++ b/node/typings/graphql-disable-introspection.d.ts @@ -0,0 +1,3 @@ +declare module 'graphql-disable-introspection' { + export default function NoIntrospection(context: any): any +} 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: