README
@slash-graphql/visual-schema-builder
Visual Schema Builder for Slash GraphQL
Install
npm install --save @slash-graphql/visual-schema-builder
Usage
import React, { useRef, Fragment } from 'react'
import { SchemaEditor } from '@slash-graphql/visual-schema-builder'
const App = () => {
const ref = useRef()
// dynamically provide schema to the editor
useEffect(() => ref.current.setSchema(sch), [])
// dynamically extract schema from the editor
const onClick = () => console.log(ref.current.getSchema())
return (
<Fragment>
<SchemaEditor placeholder='Enter your schema here...' ref={ref} />
<Button onClick={onClick}>Submit</Button>
</Fragment>
)
}
export default App
License
MIT © dgraph-io