Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

📺 Visual Editor & GraphQL IDE.

License

NotificationsYou must be signed in to change notification settings

graphql-editor/graphql-editor

Repository files navigation

Graph sorcery, that makes reading GraphQL schemas easier!

Licensestarsnpmnpm downloadsTwitter

Website  |  Documentation  |  Discord

graphql-editor-gif


GraphQLEditor makes it easier to understand GraphQL schemas. Create a schema by using visual blocks system. GraphQL Editor will transform them into code.

With GraphQL Editor you can create visual diagrams without writing any code or present your schema in a nice way!

GraphQL Editor is Graph based system for reading and designing the GraphQL schema

GraphQL Editor is a GraphQL visualizer and designer. It allows you to create and display GraphQL schemas as a visual graph.


Table of contents


How It Works

Create GraphQL nodes and connect them to generate a database schema. You can also use builtin text IDE with GraphQL syntax validation


🚀 Features

  • Visual GraphQL Editing.
  • GraphQL Monaco based IDE
  • Selection observer. When node is clicked in visual Graph it automatically scrolls the code to the same node. When cursor is moved in code space
  • Automatically bound interfaces. When interface is implemented on type fields of the interface add to the type. If it is already implemented editing interface edits all implementing nodes
  • Writing,generating and displaying GraphQL Documentation in markdown. Generating GraphQL docs out of GraphQL descriptions in markdown
  • Comparing different versions of GraphQL schemas with special node-sort sorting nodes and its fields to show the real difference in GraphQL Schema on AST omitting line numbers

Installation

npm i -D worker-loader css-loader file-loader webpack
npm i  graphql-editor react react-dom monaco-editor @monaco-editor/react

GraphQL SDL Editor

Usage

importReact,{useState}from'react';import{render}from'react-dom';import{GraphQLEditor,PassedSchema}from'graphql-editor';constschemas={pizza:`type Query{pizzas: [Pizza!]}`,pizzaLibrary:`type Pizza{  name:String;}`,};exportconstApp=()=>{const[mySchema,setMySchema]=useState<PassedSchema>({code:schemas.pizza,libraries:schemas.pizzaLibrary,});return(<divstyle={{flex:1,width:'100%',height:'100%',alignSelf:'stretch',display:'flex',position:'relative',}}><GraphQLEditorsetSchema={(props)=>{setMySchema(props);}}schema={mySchema}/></div>);};render(<App/>,document.getElementById('root'));

GraphQLEditor Component Props

GraphQLEditor

propertytypedescriptionrequireddefault
schemaPassedSchemavalue of the schematrue
setSchema(props: PassedSchema, isInvalid?: boolean) => void;Function to be called when schema is set by the editortrue
readonlybooleanlock editingfalsefalse
diffSchemasRecord<string, string>Record containing graphql schemas with "name" as a key and graphql schema as a "value"false
themeEditorThemecurrent themeMainTheme
routeStateEditorRouteslisten to route changes. Don't bind it with routeState though!false
onStateChange( r: EditorRoutes ) => void;on route state changedfalse
onTreeChange(tree: ParserTree) => voidFunction that could be fired if tree changesfalse
placeholderstringplaceholder - empty editorfalse

PassedSchema

propertytypedescription
codestringvalue of the schema code
librariesstringvalue of the current libraries

ActivePane

"relation" | "diagram" | "diff"


GraphQL Gql Editor

Usage

importReact,{useState}from'react';import{render}from'react-dom';import{GraphQLEditor,PassedSchema}from'graphql-editor';constschema=`type Query{pizzas: [Pizza!]}`;exportconstApp=()=>{const[gql,setGql]=useState('');return(||<divstyle={{flex:1,width:'100%',height:'100%',alignSelf:'stretch',display:'flex',position:'relative',}}><GraphQLGqlEditorgql={gql}setGql={(gqlString)=>setGql(gqlString)}schema={{code:schema}}/></div>);};render(<App/>,document.getElementById('root'));

GraphQLGqlEditor Component Props

GraphQLEditor

propertytypedescriptionrequireddefault
schemaPassedSchemavalue of the schematrue
gqlstringvalue of the gqltrue
placeholderstringplaceholder - empty editorfalseundefined
setGql(props: PassedSchema, isInvalid?: boolean) => void;set value of the gqltrueundefined
readonlybooleanlock editingfalsefalse
themeEditorThemecurrent themefalseMainTheme

GraphQL Embedded Readonly Editor

If you only want to view the schema and embed it somewhere in your app you can use our embedded editor for that reason

importReactfrom'react';import{EmbeddedGraphQLEditor}from'graphql-editor';import*asschemasfrom'../schema';exportconstembeddedEditor=()=>{return(<divstyle={{flex:1,width:'100%',height:'100%',alignSelf:'stretch',display:'flex',position:'relative',}}><EmbeddedGraphQLEditorschema={{code:schemas.googleDirectionsNew,libraries:'',}}/></div>);};

MORE INFO

Support

For support and help, join ourDiscord Channel.

  About Us

We are devs and contributors to the GraphQL ecosystem with a lot of experience. We want to enter Vendure to create developer-friendly e-commerce solutions that don't rely on clunky and outdated stuff like Shopify's Liquid wrapped with JavaScript.

Authors:


Underlying Parsing Technology

GraphQL-Editor parsing is based on underlyingZeus technology.


GraphQL Tutorials

To learn more about how to use GraphQL, we recommend:


About

📺 Visual Editor & GraphQL IDE.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors19

Languages


[8]ページ先頭

©2009-2025 Movatter.jp