{"name":"codemirror-graphql","version":"0.11.3","license":"MIT","_id":"codemirror-graphql@0.11.3","maintainers":[{"name":"ags-","email":"agomezs@fb.com"},{"name":"asiandrummer","email":"asiandrummer@gmail.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/graphiql/tree/master/packages/codemirror-graphql#readme","bugs":{"url":"https://github.com/graphql/graphiql/issues?q=issue+label:codemirror-graphql"},"dist":{"shasum":"88f3fd51e26d33902ac985945b9fe7200d8b49dd","tarball":"http://registry-npm.ywwl.com/codemirror-graphql/download/codemirror-graphql-0.11.3.tgz","fileCount":64,"integrity":"sha512-TIrKk5/wkrGAo15vGgaSYfl+PylBdpWqpecnOzdnPMfobGfA1papbDu1WzawB9L1lV+qGnSNKkf1Bsvf4u66zw==","signatures":[{"sig":"MEQCICsvBbVjG7jz2PD2bBnZNUALLh47yge0Lkk7dqda1wYaAiA60jhWzD5t7dkhIdk2xVeMSSJfhang+ez7MyF/lo7f/w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":247048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3bFjCRA9TVsSAnZWagAAeaIP/i3evYSJfENyKJDAEgb7\ndRjNERB+ZeVlTEdZgtT3WZCkPBFWQXdxgR2E3AIWIUbQHcVDuq8bG6KkYixy\n7YlWD1hz3kCfENHfTCX3JZ90VdglEplagnuU2AAxCZfjNVNfZzT0sMNE6bDz\n0CdmamSZeGq+L9IGPj5T7Stc/EdvTh6ZT3FlVe2FboLI1M/9RIk8KG44XCN0\n6pxaUYe2W7ihjoQsKWOzoKvRL37Ts3ZFWvc0n60H+aiBTs8cMf9reyflAahg\nB1gohS2zkjDq6irrY6TGww1l3Q5RiE592IXZFM6wbjI5gOJZE0Rza1RmasVy\nzf9+Hh8pyGJ7MHL7uqc/EH0uIanpSL9NouacZOh+ZH/szdMm/2MJvalXQFIP\nt4buw+cTT+71xVhkaMkFA4oqE4Sjfvkoq5kwU9yVZH3NmKo3CSrQYNI/EAHX\nFBeW/YmnhAZ408DTAe81B8kYBVM2FR07YjG1M99Hsg1hzNJSOqIGNsjxpBAz\n3Ppzu/ylDQMAxvBekjEzJ0BjFdhdh2+aslBofhhjz2Ujyr5eBVo90pPvVImR\ntgss0/C7pWqVxdeg+0hBD1FAJRFQ+UOESP7w3e3fpEcG0a7Xodde/F+xMWI8\nO05B9QZudVs+8x3YkD8SqupJbQFA0VrevfqTir9B9MxKh/M7P+luCmN4RDEJ\ntaoy\r\n=XiIq\r\n-----END PGP SIGNATURE-----\r\n","size":30874,"noattachment":false,"key":"/codemirror-graphql/-/codemirror-graphql-0.11.3.tgz"},"main":"dist","gitHead":"1a24c79073c70690d4a1b56080a58c8158fb11aa","options":{"mocha":"--full-trace --require resources/mochaBootload src/*/__tests__/*-test.js","mocha_tdd":"--full-trace --watch --require resources/mochaBootload src/**/*/__tests__/*-test.js"},"scripts":{"lint":"eslint src","test":"mocha $npm_package_options_mocha","build":"yarn build-clean && yarn build-js && yarn build-flow .","check":"flow check","watch":"babel --optional runtime resources/watch.js | node","build-js":"babel src --root-mode upward --ignore src/__tests__ --out-dir .","build-flow":"node ../../resources/buildFlow.js","build-clean":"rimraf '{mode,hint,info,jump,lint}.{js,js.flow}' && rimraf esm results utils variables coverage __tests__"},"_npmUser":{"name":"acao","email":"rikki.schulte@gmail.com"},"repository":{"url":"git+https://github.com/graphql/graphiql.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v11.12.0+x64 (darwin)","description":"GraphQL mode and helpers for CodeMirror.","directories":{},"_nodeVersion":"11.12.0","dependencies":{"graphql-language-service-parser":"^1.5.0","graphql-language-service-interface":"^2.3.1"},"_hasShrinkwrap":false,"devDependencies":{"chai":"4.1.1","sane":"2.0.0","jsdom":"^11.2.0","mocha":"3.5.0","rimraf":"^3.0.0","graphql":"^14.0.2","codemirror":"^5.28.0","chai-subset":"1.5.0"},"peerDependencies":{"graphql":"^0.12.0 || ^0.13.0 || ^14.0.0","codemirror":"^5.26.0"},"_npmOperationalInternal":{"tmp":"tmp/codemirror-graphql_0.11.3_1574809955035_0.23941599554557436","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":1574809955258,"_cnpm_publish_time":1574809955258,"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"}}