@slash-graphql/visual-schema-builder

1.2.9 • Public • Published

@slash-graphql/visual-schema-builder

Visual Schema Builder for Slash GraphQL

NPM JavaScript Style Guide

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

Readme

Keywords

none

Package Sidebar

Install

npm i @slash-graphql/visual-schema-builder

Weekly Downloads

1

Version

1.2.9

License

MIT

Unpacked Size

380 kB

Total Files

6

Last publish

Collaborators

  • dgraphlabs