A standalone GraphQL Playground package with a custom dark UI, schema explorer, smart editors, workspace import/export, and Docker support.
This package serves a browser-based GraphQL playground that helps developers:
- write and run GraphQL queries, mutations, and subscriptions
- inspect the schema in a side panel
- edit variables and headers with guided autocomplete
- view formatted JSON responses with syntax highlighting
- save, import, and export full workspaces with multiple tabs
It is designed to be embedded into an Express application or run as a standalone local server.
- standalone Express server for quick local usage
- custom schema viewer with search and hover details
- query editor with GraphQL autocomplete and inline tooltips
- variables editor with schema-aware suggestions
- headers editor with common header suggestions
- response viewer with JSON syntax highlighting
- multi-tab workspace with import/export support
- Docker image support for a compiled runtime
npm install @bestcodetools/graphql-playgroundFor development:
npm run standaloneThe playground will be available at:
http://localhost:3000/playground
You can change the port with:
PLAYGROUND_PORT=4000 npm run standaloneTo run the compiled standalone server without ts-node-dev:
npm run build
npm startBuild the image:
docker build -t graphql-playground .Run the container:
docker run -p 3000:3000 graphql-playgroundThen open:
http://localhost:3000/playground
npm run standalone: starts the standalone server withts-node-devnpm run build: transpiles TypeScript intodistnpm start: runs the transpiled standalone servernpm test: runs the Jest test suitenpm run transpile:sass:watch: watches and transpiles Sass files
This package includes a basic integration test for the standalone server.
Run:
npm testThe test verifies that the standalone server starts on an automatically assigned port and responds with 200 on the configured playground path.
- The standalone runtime disables live reload in production mode.
- Workspace export sanitizes sensitive header values such as authorization, token, and key headers by replacing them with placeholders.
ISC