{"name":"graphql-disable-introspection","version":"1.0.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","dependencies":{"graphql":"^0.9.2"},"peerDependencies":{"graphql":"^0.9.2"},"devDependencies":{"body-parser":"^1.17.1","chai":"^3.5.0","express":"^4.15.2","graphql-server-express":"^0.6.0","mocha":"^3.2.0","supertest":"^3.0.0","supertest-as-promised":"^4.0.2"},"gitHead":"01f1a4e6f900f6ff4fed7bce28bb9d3218129e24","_id":"graphql-disable-introspection@1.0.0","_shasum":"3a6476c1b29617600e75afa7ba0a2c8a76f4c660","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"helfer","email":"helfer@meteor.com"},"dist":{"shasum":"3a6476c1b29617600e75afa7ba0a2c8a76f4c660","tarball":"http://registry-npm.ywwl.com/graphql-disable-introspection/download/graphql-disable-introspection-1.0.0.tgz","integrity":"sha512-hX7Ht7FUocaxq4GkLOquotaK85krIvyQ/g1f3GD/FdNDa0/nxFV6wMiumwV41J1aAqDfl8BGzBNgUmL8n+2uqA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHaFWAN9v9pHT7DM68tszFDZ/0+HPG6I5WRRbassskxZAiEA/wYuwycuBU+5oStvlvykW4q3RZjjsa5Nz+pvKC4GZik="}],"size":2854,"noattachment":false,"key":"/graphql-disable-introspection/-/graphql-disable-introspection-1.0.0.tgz"},"maintainers":[{"name":"helfer","email":"helfer@meteor.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/graphql-disable-introspection-1.0.0.tgz_1491793742113_0.500472457613796"},"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":1491793744002,"_cnpm_publish_time":1491793744002,"dist-tags":{"latest":"1.2.0"}}