@expo/codemirror-graphql

0.6.11 • Public • Published

GraphQL mode for CodeMirror

Build Status

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

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @expo/codemirror-graphql

Weekly Downloads

0

Version

0.6.11

License

BSD-3-Clause

Last publish

Collaborators

  • schestakov
  • janicduplessis
  • wkozyra
  • barthec
  • quinlanj
  • sjchmiela
  • tsapeta
  • dsokal
  • esamelson
  • expoadmin
  • ide
  • brentvatne
  • nikki93
  • ccheever
  • terribleben
  • jesseruder
  • fson
  • evanbacon