Standalone App
GraphQL Explorer also comes packaged as a standalone app. The app offers a generic way to connect to any graphql service, with the ability to set headers (eg Authorization). To see the standalone app in action directly on this documentation site, click here
#
InstallInstall the standalone package:
yarn add graphql-explorer-html
There are several ways to serve the app. Here are some suggestions.
#
Serving the directoryThis is quick and easy way to serve the app. simply serve the directory node_modules/graphql-explorer-html/build
. For example, using http-server:
npx http-server node_modules/graphql-explorer-html/build
#
Importing the javascriptsimply importing the package will run the application.
import 'graphql-explorer-html';
This will require, as an "entry point", that there is an HTML tag with id app
to mount the app from.