{"name":"codemirror-graphql","version":"0.8.2","license":"BSD-3-Clause","_id":"codemirror-graphql@0.8.2","maintainers":[{"name":"asiandrummer","email":"asiandrummer@gmail.com"},{"name":"fb","email":"opensource+npm@fb.com"},{"name":"kassens","email":"jkassens@fb.com"},{"name":"leebyron","email":"lee@leebyron.com"},{"name":"wincent","email":"greg@hurrell.net"}],"contributors":[{"name":"Hyohyeon Jeong","email":"asiandrummer@fb.com"},{"url":"http://leebyron.com/","name":"Lee Byron","email":"lee@leebyron.com"},{"name":"Angel Gomez Salazar","email":"agomezs@fb.com"}],"homepage":"https://github.com/graphql/codemirror-graphql","bugs":{"url":"https://github.com/graphql/codemirror-graphql/issues"},"dist":{"shasum":"387fdeb7ffe5023b5d48ef7b1e48dd53812d1383","tarball":"http://registry-npm.ywwl.com/codemirror-graphql/download/codemirror-graphql-0.8.2.tgz","fileCount":3,"integrity":"sha512-bIRvsIhbGMvaKzyq3CYlOWz55+X9JUNPPgzrJwZUO8KVxj1iZLHdp3tiUxLUsTU9MdjS6iNjHDlhJiC+5IFBeQ==","signatures":[{"sig":"MEYCIQChOn4jg0xpDb6wPaDLKvJ+qFrGsaOWxW6i7i/C0aZg+wIhAPozkbwBhZ1z1lbD+xyRa3N+Fg22qUh/9XX+Bp6NGLwZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6062,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzry4CRA9TVsSAnZWagAA3+YQAKPtOWeEF7tcIswAYar0\nsJuaCNyL8FXqYdlrZ2nHH2sb3wd7AV3DT4+mMMl2c15EjWgujcqHvNJwx82C\n6wHrMWm1WVdI7M7dz/p3M/z+mSfnh4+7cIcJBRG584zkD7UvN6mbD5rhdIKR\nwmnUPzFnI6OsTKukepbSnN74Bs0yoca9gwHQmVedzmBiWUDUYZ7M2GC7mqaR\n22bWZBmvWFAFw7Hps1tJ/0lN90XweLZ14dwck1Rm3kSgpjoRutPOQRI1VJxH\nmRIFyfPLbAhv3h2guQCF17TfaeiG0ORnFur/FoBsAdLbkEG76E0CLCJ2LfCC\nSuSXw5QpxmgKvCHQdrBvpTngZV2AH6KFPl8bpcNp5f129M1T2/icg7/OyaFg\n7rwk6EdxC7XPgiuOfSxh6C8iky7jFG1p6ui/okHiY3Jwt/uSDEzr51AnTNWk\nz/Nj0GGz+26WAAJhpuiKGpbp0q6ZXGVibWU58HMKPCp3CVJBnZDOSMMsmIuG\nUateNulnF2RTv7N5VryEyUs6ve8PRpEuRsa0PVw1XI01cUFuHB3glplpsOMN\nLn6t4XleVVUDDqju8Xt9BAJMQb5SqJyWm+ysC/1yH0ScXOwqKzOtDtScCw3h\nF6zJoX8U8uFJKNlYINQ+QzY6yDFAQPJyqkAPSK3yUvQM8UbK/Cc7ENHpp4yj\nucfh\r\n=qBxb\r\n-----END PGP SIGNATURE-----\r\n","size":2467,"noattachment":false,"key":"/codemirror-graphql/-/codemirror-graphql-0.8.2.tgz"},"gitHead":"2edb6ecae5829c67510343ef6af9d5e7311d56af","options":{"mocha":"--full-trace --require resources/mocha-bootload src/**/__tests__/**/*-test.js","mocha_tdd":"--full-trace --watch --require resources/mocha-bootload src/**/__tests__/**/*-test.js"},"scripts":{"lint":"eslint src","test":"npm run lint && npm run pretty-check && npm run testonly","build":"babel src --ignore __tests__ --out-dir .","check":"flow check","watch":"babel --optional runtime resources/watch.js | node","pretty":"node resources/pretty.js","testonly":"babel-node ./node_modules/.bin/_mocha $npm_package_options_mocha","testwatch":"babel-node --inspect ./node_modules/.bin/_mocha $npm_package_options_mocha_tdd","prepublish":". ./resources/prepublish.sh","preversion":". ./resources/checkgit.sh && npm test","pretty-check":"node resources/pretty.js --check"},"_npmUser":{"name":"ags-","email":"agomezs@fb.com"},"repository":{"url":"git+ssh://git@github.com/graphql/codemirror-graphql.git","type":"git"},"_npmVersion":"6.2.0","description":"GraphQL mode and helpers for CodeMirror.","directories":{},"_nodeVersion":"10.9.0","dependencies":{"graphql-language-service-parser":"^1.2.2","graphql-language-service-interface":"^1.3.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"4.1.1","sane":"2.0.0","jsdom":"^11.2.0","mocha":"3.5.0","eslint":"^4.5.0","graphql":"^14.0.2","flow-bin":"^0.56.0","prettier":"^1.4.4","babel-cli":"^6.26.0","codemirror":"^5.28.0","chai-subset":"1.5.0","babel-eslint":"7.2.3","eslint-plugin-babel":"4.1.2","eslint-plugin-flowtype":"2.35.0","babel-plugin-transform-regenerator":"^6.26.0","babel-plugin-check-es2015-constants":"^6.22.0","babel-plugin-syntax-async-functions":"6.13.0","babel-plugin-transform-es2015-spread":"^6.22.0","babel-plugin-transform-es2015-classes":"6.24.1","babel-plugin-transform-es2015-literals":"^6.22.0","babel-plugin-transform-class-properties":"6.24.1","babel-plugin-transform-flow-strip-types":"^6.22.0","babel-plugin-transform-es2015-parameters":"6.24.1","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-es2015-object-super":"6.24.1","babel-plugin-transform-es2015-block-scoping":"^6.26.0","babel-plugin-transform-es2015-destructuring":"6.23.0","babel-plugin-transform-es2015-function-name":"6.24.1","babel-plugin-transform-es2015-duplicate-keys":"6.24.1","babel-plugin-transform-es2015-arrow-functions":"^6.22.0","babel-plugin-transform-es2015-modules-commonjs":"^6.26.0","babel-plugin-transform-es2015-template-literals":"6.22.0","babel-plugin-transform-es2015-computed-properties":"6.24.1","babel-plugin-transform-es2015-shorthand-properties":"6.24.1","babel-plugin-transform-es2015-block-scoped-functions":"^6.22.0"},"peerDependencies":{"graphql":"^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0","codemirror":"^5.26.0"},"_npmOperationalInternal":{"tmp":"tmp/codemirror-graphql_0.8.2_1540275383039_0.6852819855494383","host":"s3://npm-registry-packages"},"readme":"# GraphQL mode for CodeMirror\n\n[![NPM](https://img.shields.io/npm/v/codemirror-graphql.svg?style=flat-square)](https://npmjs.com/codemirror-graphql)\n![npm downloads](https://img.shields.io/npm/dm/codemirror-graphql?label=npm%20downloads)\n[![License](https://img.shields.io/npm/l/codemirror-graphql.svg?style=flat-square)](LICENSE)\n[Discord Channel](https://discord.gg/cffZwk8NJW)\n\n**NOTE: For CodeMirror 6, use [cm6-graphql](/packages/cm6-graphql/) instead**\n\nProvides CodeMirror with a parser mode for GraphQL along with a live linter and\ntypeahead hinter powered by your GraphQL Schema.\n\n![Demo .gif of GraphQL Codemirror Mode](https://raw.githubusercontent.com/graphql/graphiql/main/packages/codemirror-graphql/resources/example.gif)\n\n### Getting Started\n\n```sh\nnpm install --save codemirror-graphql\n```\n\nCodeMirror helpers install themselves to the global CodeMirror when they are\nimported.\n\n```ts\nimport type { ValidationContext, SDLValidationContext } from 'graphql';\n\nimport CodeMirror from 'codemirror';\nimport 'codemirror/addon/hint/show-hint';\nimport 'codemirror/addon/lint/lint';\nimport 'codemirror-graphql/hint';\nimport 'codemirror-graphql/lint';\nimport 'codemirror-graphql/mode';\n\nCodeMirror.fromTextArea(myTextarea, {\n  mode: 'graphql',\n  lint: {\n    schema: myGraphQLSchema,\n    validationRules: [ExampleRule],\n  },\n  hintOptions: {\n    schema: myGraphQLSchema,\n  },\n});\n```\n\n## External Fragments Example\n\nIf you want to have autocompletion for external fragment definitions, there's a\nnew configuration setting available\n\n```ts\nimport CodeMirror from 'codemirror';\nimport 'codemirror/addon/hint/show-hint';\nimport 'codemirror/addon/lint/lint';\nimport 'codemirror-graphql/hint';\nimport 'codemirror-graphql/lint';\nimport 'codemirror-graphql/mode';\n\nconst externalFragments = /* GraphQL */ `\n  fragment MyFragment on Example {\n    id: ID!\n    name: String!\n  }\n   fragment AnotherFragment on Example {\n    id: ID!\n    title: String!\n  }\n`;\n\nCodeMirror.fromTextArea(myTextarea, {\n  mode: 'graphql',\n  lint: {\n    schema: myGraphQLSchema,\n  },\n  hintOptions: {\n    schema: myGraphQLSchema,\n    // here we use a string, but\n    // you can also provide an array of FragmentDefinitionNodes\n    externalFragments,\n  },\n});\n```\n\n### Custom Validation Rules\n\nIf you want to show custom validation, you can do that too! It uses the\n`ValidationRule` interface.\n\n```ts\nimport type { ValidationRule } from 'graphql';\n\nimport CodeMirror from 'codemirror';\nimport 'codemirror/addon/hint/show-hint';\nimport 'codemirror/addon/lint/lint';\nimport 'codemirror-graphql/hint';\nimport 'codemirror-graphql/lint';\nimport 'codemirror-graphql/mode';\n\nconst ExampleRule: ValidationRule = context => {\n  // your custom rules here\n  const schema = context.getSchema();\n  const document = context.getDocument();\n  return {\n    NamedType(node) {\n      if (node.name.value !== node.name.value.toLowercase()) {\n        context.reportError('only lowercase type names allowed!');\n      }\n    },\n  };\n};\n\nCodeMirror.fromTextArea(myTextarea, {\n  mode: 'graphql',\n  lint: {\n    schema: myGraphQLSchema,\n    validationRules: [ExampleRule],\n  },\n  hintOptions: {\n    schema: myGraphQLSchema,\n  },\n});\n```\n\nBuild for the web with [webpack](http://webpack.github.io/) or\n[browserify](http://browserify.org/).\n","publish_time":1540275383261,"_cnpm_publish_time":1540275383261,"dist-tags":{"alpha":"2.0.9-alpha.1","beta":"3.0.0-beta.1","canary":"2.2.4-canary-be24c1cc.0","latest":"3.0.1","next":"2.0.0-next.2","rc":"3.0.0-rc.1"}}