0.14.4-3 • Published 4 years ago

@sgrove/graphiql-with-extensions v0.14.4-3

Weekly downloads
7
License
SEE LICENSE IN LI...
Repository
github
Last release
4 years ago

GraphiQL with extensions

This is a meta-package meant to bring together the most popular GraphiQL plugins and make them easy to flip on and off.

The original GraphiQL package is consumable as a single React component, even without JSX. This makes it very easy to embed just about anywhere you can put JavaScript that might not have a full modern build pipeline (e.g. Rails with a sprockets setup).

Usage is easy:

npm install --save graphiql-with-extensions
# or
yarn add graphiql-with-extensions
import React from 'react';
import ReactDOM from 'react-dom';
import GraphiQL from 'graphiql-with-extensions';
import fetch from 'isomorphic-fetch';

function graphQLFetcher(graphQLParams) {
  return fetch(window.location.origin + '/graphql', {
    method: 'post',
    headers: {'Content-Type': 'application/json'},
    body: JSON.stringify(graphQLParams),
  }).then(response => response.json());
}

ReactDOM.render(
  <GraphiQL
    fetcher={graphQLFetcher}
    // Some optional props
    // defaultQuery={''}
    // disableExplorer={false}
  />,
  document.body,
);

Included extensions

Rigth now we only include the latest version of OneGraph's GraphiQL Explorer plugin. Please open an issue if you'd like to see other plugins included.

License

graphiql-with-extensions is licensed under the MIT License. graphiql is licensed under the MIT License. Documentation is licensed under Creative Common License.

graphiql-with-extensions

0.14.4-3

4 years ago

0.14.4-2

4 years ago

0.14.4

4 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago