Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

codemirror-graphql

0.12.1 • Public • Published

GraphQL mode for CodeMirror

NPM npm downloads License

Provides CodeMirror with a parser mode for GraphQL along with a live linter and typeahead hinter powered by your GraphQL Schema.

Demo .gif of GraphQL Codemirror Mode

Getting Started

npm install --save codemirror-graphql

CodeMirror helpers install themselves to the global CodeMirror when they are imported.

import CodeMirror from 'codemirror';
import 'codemirror/addon/hint/show-hint';
import 'codemirror/addon/lint/lint';
import 'codemirror-graphql/hint';
import 'codemirror-graphql/lint';
import 'codemirror-graphql/mode';
 
CodeMirror.fromTextArea(myTextarea, {
  mode: 'graphql',
  lint: {
    schema: myGraphQLSchema,
  },
  hintOptions: {
    schema: myGraphQLSchema,
  },
});

Build for the web with webpack or browserify.

Keywords

none

Install

npm i codemirror-graphql

DownloadsWeekly Downloads

91,072

Version

0.12.1

License

MIT

Unpacked Size

171 kB

Total Files

45

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar