{"name":"graphql-disable-introspection","version":"1.1.0","description":"Disable introspection in graphql-js with a validation rule","main":"index.js","directories":{"doc":"docs","test":"tests"},"scripts":{"test":"mocha test.js"},"repository":{"type":"git","url":"git+https://github.com/helfer/graphql-disable-introspection.git"},"keywords":["GraphQL","Introspection","Node","disable","query","validation","rule"],"author":{"name":"Jonas Helfer","email":"jonas@helfer.email"},"license":"MIT","bugs":{"url":"https://github.com/helfer/graphql-disable-introspection/issues"},"homepage":"https://github.com/helfer/graphql-disable-introspection#readme","devDependencies":{"body-parser":"^1.17.1","chai":"^3.5.0","express":"^4.15.2","graphql":"^14.0.0","graphql-server-express":"^0.6.0","mocha":"^3.2.0","supertest":"^3.0.0","supertest-as-promised":"^4.0.2"},"peerDependencies":{"graphql":"^0.9.2 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0"},"gitHead":"5d0ec905aea0893a5682fe8decf36ef85f344bf3","_id":"graphql-disable-introspection@1.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"helfer","email":"jonas@helfer.email"},"dist":{"integrity":"sha512-OXCgpr7jQH+4O1QLlyMxS5R/vZY3mGoE5swl1Ghw2A/eMb0yANFW8KadsR5lvXHfsrHjUjeTGzE6pRx6MjffDA==","shasum":"6ac86aaf64e64979435f12e0851f142262509885","tarball":"http://registry-npm.ywwl.com/graphql-disable-introspection/download/graphql-disable-introspection-1.1.0.tgz","fileCount":5,"unpackedSize":6744,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCh2CCRA9TVsSAnZWagAA8+AP/3bgJ9MZrXAGvCS9nYoJ\nWQCL9CSvwqgdSDhct5wdh9GWKJQE9cSSaXWVUKW+umX/NQHbYhDvtIHFwBP4\nPy7JqjGrOh98kWvRXAHD88CJ/mbJS16lGrJWhsUjEGAGfXBApGtcq3YcmI7A\nB+MyYqz5Hyp93+KoOn/6JNduq4a73E1YnrpQ6bdus0DvzTdWOYG8tQXaG4BW\nS8BZXTb5rQJqS4CZ16l12oiJPACqRks0iHNEAAs3Vpho5H3yxKac8znHnFg6\n73hBH4zP6r0tHRaQxhd75vmEpYXNyuubh2TDLUlgdoQuy0ykcU2PQUAndvB9\nKEyjCxPeObqOSyhPMinYVuCqWuUQqpmAYp+fh3cgSr5W1xvMY3kTyO11TvaB\nGL5+znzHO8CwgAXIolZylrLnjJ0VsodozvO6EbajkhzZnmzrGSrV74JBzdYm\ny0KJCuxwfCSbgUUeJYFIs5QXk5LeXCVaj4c2DNHazB8w/8cjJ9DhnMx8/08a\nVzAQB+mFzXBXtxiWGD475X0deUf2Z1mNEjqkIP70ghAxJMLde2EKgyITcnYA\n6T8sFk1OtHJPb2rqyrFlK+SsODWuxWKoAJPomPB5AS88Vu6oKLqKd8ofvHLV\n6kdCFrrn2oekxCt+mYWPculdHHrG9ugMVchrug13qxzTx9SkFJSbWRxk0oQU\nWOqW\r\n=4nSM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAKU3gMOfiJPH3V99+hEYHugDu1fS9RRqt3qwFhULnqTAiEAuVw9Ltb02VSrX0G/8YjZHcbH+v1dt3N+sHuRys3IRAU="}],"size":2634,"noattachment":false,"key":"/graphql-disable-introspection/-/graphql-disable-introspection-1.1.0.tgz"},"maintainers":[{"name":"helfer","email":"helfer@meteor.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-disable-introspection_1.1.0_1544166785819_0.30812532142152693"},"_hasShrinkwrap":false,"readme":"# graphql-disable-introspection\nDisable introspection queries in GraphQL with a simple validation rule. Queries that contain `__schema` or `__type` will fail validation with this rule. For example, the following queries will be rejected:\n\n```graphql\nquery {\n  __schema {\n    queryType {\n      name\n    }\n  }\n}\n\nquery {\n  __type(name: \"Query\") {\n    description\n    fields {\n      name\n    }\n  }\n}\n```\n\n## Usage\n\nThe package can be installed from npm\n\n```sh\nnpm install -save graphql-disable-introspection\n```\n\nIt exports a single validation rule which you can pass to your node GraphQL server with the `validationRules` argument. \n\nHere's an example for `graphql-server-express`:\n\n```diff\nimport express from 'express';\nimport bodyParser from 'body-parser';\nimport { graphqlExpress } from 'graphql-server-express';\n+ import NoIntrospection from 'graphql-disable-introspection';\n\nconst myGraphQLSchema = // ... define or import your schema here!\nconst PORT = 3000;\n\nvar app = express();\n\n// bodyParser is needed just for POST.\napp.use('/graphql', bodyParser.json(), graphqlExpress({\n   schema: myGraphQLSchema,\n+  validationRules: [NoIntrospection]\n}));\n\napp.listen(PORT);\n\n```\n\nIf you're using `express-graphql`, it works exactly the same way:\n\n```diff\napp.use('/graphql', graphqlHTTP({\n  schema: MyGraphQLSchema,\n+ validationRules: [NoIntrospection]\n}));\n```\n","publish_time":1544166785919,"_cnpm_publish_time":1544166785919,"dist-tags":{"latest":"1.2.0"}}