Registry / devops / graphql-editor

graphql-editor

JSON →
library7.3.1jsnpmunverified

GraphQL Editor is a visual node editor for GraphQL that allows developers to design, build, and manage GraphQL schemas using a drag-and-drop interface. Current stable version is 7.3.1. It is actively maintained with frequent releases. Key differentiators include real-time visualization, support for resolver binding, and integration with Monaco Editor for code editing. It requires React 18 and other peer dependencies.

npm install graphql-editor
INSTALL
IMPORT
SIG · GRAPHQL-EDITOR
G
graphql-editor
devopsjavascriptv7.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GraphQLDocumentor
import { GraphQLDocumentor } from 'graphql-editor'
import GraphQLDocumentor from 'graphql-editor'
Named export, not default. ESM-only since v7.
GraphQLEditor
import { GraphQLEditor } from 'graphql-editor'
const GraphQLEditor = require('graphql-editor')
Named export. CJS require works only with default export, but this is a named export.
GraphQLEditorProvider
import { GraphQLEditorProvider } from 'graphql-editor'
import { GrapqhQLEditorProvider } from 'graphql-editor'
Typo error in the symbol name.
useGraphQLEditor
import { useGraphQLEditor } from 'graphql-editor'
React hook, should be used inside a component wrapped in GraphQLEditorProvider.

Renders a GraphQL editor component with a basic schema and save handler. Shows the minimal setup with React 18.

import React from 'react'; import { GraphQLEditor } from 'graphql-editor'; import '@monaco-editor/react'; function App() { const schema = `type Query { hello: String }`; return ( <div style={{ height: '100vh' }}> <GraphQLEditor schema={schema} setSchema={(s) => console.log(s)} onSave={() => console.log('Saved')} defaultLanguage="en" /> </div> ); } export default App;
Debug
Known issues
breakingGraphQLEditor is now a named export instead of a default export. Old imports will break.
fix
Change 'import GraphQLEditor from ...' to 'import { GraphQLEditor } from ...'
affects: >=7.0.0
breakingRequires React 18+. Older versions of React are not supported.
fix
Upgrade to React 18
affects: >=7.0.0
deprecatedThe 'GraphQLDocumentor' component's 'onSave' prop has been deprecated in favor of 'onChange'.
fix
Use 'onChange' instead of 'onSave'
affects: >=7.1.0
gotchaMonaco Editor and worker-loader must be correctly configured in webpack. If not, the editor may fail silently.
fix
Ensure webpack config includes worker-loader for .worker.ts files and file-loader for fonts.
affects: >=7.0.0
gotchaThe editor's schema prop is a string; using a parsed GraphQLSchema object will break.
fix
Pass schema as a string, not as a GraphQLSchema object.
affects: >=7.0.0
Errors
Common errors & fixes
Module not found: Can't resolve 'graphql-editor'
Package not installed or import path incorrect.
fix
Run 'npm install graphql-editor' and ensure import is correct: 'import { GraphQLEditor } from 'graphql-editor''
Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component.
useGraphQLEditor hook used outside of a GraphQLEditorProvider.
fix
Wrap your component with <GraphQLEditorProvider> before using useGraphQLEditor.
Monaco Editor not loading. Check your webpack configuration for worker-loader.
Missing or misconfigured worker-loader for Monaco Editor workers.
fix
Add 'worker-loader' to webpack config: { test: /\.worker\.ts$/, use: 'worker-loader' }
TypeError: Cannot destructure property 'schema' of 'undefined' or 'null'.
The GraphQLEditor component is not receiving a schema string prop.
fix
Ensure the 'schema' prop is a non-null string.
Upgrade
Version history
7.3.1latest on npm
Audit
Dependencies
@monaco-editor/reactrequiredProvides the Monaco code editor component for editing GraphQL schemas and resolvers.
monaco-editorrequiredUnderlying editor core required by @monaco-editor/react.
reactrequiredUI framework dependency (React 18+).
react-domrequiredReact DOM renderer.
webpackrequiredRequired for bundling; graphql-editor uses webpack worker-loader.
worker-loaderrequiredWebpack loader for web workers used by Monaco Editor.
css-loaderoptionalWebpack loader for CSS files.
file-loaderoptionalWebpack loader for font files used by Monaco Editor.
Agent activity
6 hits · last 30 days
node
6
Resources
graphql-editor — npm install graphql-editor · libregistry