0.0.2 • Published 5 years ago

gatsby-theme-graphql-components v0.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

Gatsby Theme Graphql Components

components for showing and updating graphql code in gatsby themes

npm.io

Install

yarn add gatsby-graphql-components

Usage

import { Code, LiveGraphql } from 'gatsby-graphql-components';

import 'gatsby-graphql-components/prism.css';

Code Component:

<Code
code={'import React from 'react';
  import { Code, LiveGraphql } from 'gatsby-graphql-components'

  function App() {
    return (
      <div className="App">
        <header className="App-header">
        <Code
        code=''
        />

        </header>
      </div>
    );
  }

  export default App;'}
  />

LiveGraphql Component:

<LiveGraphql
  query={query} // initial query
  updateQuery={updateQuery} // callback function to update query
  src={'http://localhost:8000/___graphql?query='} // src url for graphiql, should include initial query
/>