@graphiql/plugin-explorer
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

GraphiQL Explorer Plugin

This package provides a plugin that integrated the GraphiQL Explorer into the GraphiQL UI.

Install

Use your favorite package manager to install the package:

npm i -S @graphiql/plugin-explorer

The following packages are peer dependencies, so make sure you have them installed as well:

npm i -S react react-dom graphql

Usage

import { explorerPlugin } from '@graphiql/plugin-explorer';
import { createGraphiQLFetcher } from '@graphiql/toolkit';
import { GraphiQL } from 'graphiql';
import { useState } from 'react';

import 'graphiql/graphiql.css';
import '@graphiql/plugin-explorer/dist/style.css';

const fetcher = createGraphiQLFetcher({
  url: 'https://swapi-graphql.netlify.app/.netlify/functions/index',
});

// pass the explorer props here if you want
const explorer = explorerPlugin();

return <GraphiQL fetcher={fetcher} plugins={[explorer]} />;

CDN bundles

You can also use this plugin with unpkg, jsdelivr, and other CDNs.

See the example HTML file for this plugin

Package Sidebar

Install

npm i @graphiql/plugin-explorer

Weekly Downloads

41,891

Version

2.0.0

License

MIT

Unpacked Size

67.9 kB

Total Files

12

Last publish

Collaborators

  • mjmahone
  • benjie
  • acao
  • i1g
  • leebyron