Provides CodeMirror 5 with a dedicated parser mode for GraphQL, along with live linting and typeahead autocompletion powered by a GraphQL schema. Version 2.2.7 is the latest stable release in the 2.x line, which targets CodeMirror 5 (not CodeMirror 6—use cm6-graphql for CM6). The package supports GraphQL v15, v16, and v17. It is part of the GraphiQL ecosystem and is maintained by the GraphQL Foundation. Key differentiators include deep integration with GraphQL schemas for context-aware hints and validation, support for external fragments, and custom validation rules.
npm install codemirror-graphqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up a CodeMirror 5 editor with GraphQL syntax highlighting, live linting, and autocomplete hints powered by a GraphQL schema.
If using CodeMirror 6, replace with @graphiql/cm6-graphql or cm6-graphql package.
Verify with latest CodeMirror 5 release notes.
Use `import 'codemirror-graphql/mode'` without destructuring.
Import CodeMirror addons in order: show-hint, lint, then graphql addons.
Use GraphQL v16 or v17. Check peer dependencies.
Run `npm install codemirror-graphql` and ensure import path matches installed package.
Add `import 'codemirror/addon/lint/lint'` before importing graphql lint addon.
Pass a valid GraphQLSchema object in the `lint.schema` and `hintOptions.schema` properties.