Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/disable introspectionsg #23

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 4 additions & 0 deletions node/middlewares/run.ts
Original file line number Diff line number Diff line change
@@ -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<void>) {
const {
Expand All @@ -8,6 +9,8 @@ export default async function run(ctx: Context, next: () => Promise<void>) {
request,
} = ctx

console.log(request)

const { graphqlResponse, responseInit } = await runHttpQuery([], {
method,
options: {
Expand All @@ -20,6 +23,7 @@ export default async function run(ctx: Context, next: () => Promise<void>) {
schema,
schemaHash: '' as any,
tracing: false,
validationRules: [NoIntrospection]
},
query,
request,
Expand Down
3 changes: 2 additions & 1 deletion node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 5 additions & 1 deletion node/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@
"strict": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true
}
},
"typeAcquisition": {
"enable": false
},
"include": ["./**/*.ts", "./typings/*.d.ts"]
}
3 changes: 3 additions & 0 deletions node/typings/graphql-disable-introspection.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module 'graphql-disable-introspection' {
export default function NoIntrospection(context: any): any
}
15 changes: 10 additions & 5 deletions node/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down