graphql/graphql-playground โ an API project โ sits at 8.8k GitHub stars in the API space. ๐ฎ GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration)
Snapshot summary built from the project's own GitHub metadata โ there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then โ see the READ ME tab for the original README in full.
2026-04: This repository is now archived and future GraphQL IDE developments will happen in GraphiQL.
SECURITY WARNING: both graphql-playground-html and all four (4) of it's middleware dependents until [email protected] were subject to an XSS Reflection attack vulnerability only to unsanitized user input strings to the functions therein. This was resolved in graphql-playground-html@^1.6.22. More Information CVE-2020-4038
Future of this repository: See this issue for details.
GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).
โ GraphQL Config support with multiple Projects & Endpoints
๐ฅ Apollo Tracing support
Security Details
NOTE: only unsanitized user input to the functions in these packages is vulnerable to the recently reported XSS Reflection attack.
Impact
Impacted are any and all unsanitized user-defined input to:
-renderPlaygroundPage()
-koaPlayground()
-expressPlayground()
-koaPlayground()
-`lambdaPlayground()
If you used static values, such as graphql-playground-electron does in it's webpack config, as well as the most common middleware implementations out there, they were not vulnerable to the attack.
The only reason this vulnerability exists is because we are using template strings in renderPlaygroundPage() with potentially unsanitized user defined variables. This allows an attacker to inject html and javascript into the page.
Read more about preventing XSS in react
Common examples may be user-defined path parameters, query string, unsanitized UI provided values in database, etc., that are used to build template strings or passed directly to a renderPlaygroundPage() or the matching middleware function equivalent listed above.
Impacted Packages
All versions of these packages are impacted until the ones specified below, which are now safe for user defined input:
graphql-playground-html: โ safe @ 1.6.22
graphql-playground-expressโ safe @ 1.7.16
graphql-playground-koaโ safe @ 1.6.15
graphql-playground-hapiโ safe @ 1.6.13
graphql-playground-lambdaโ safe @ 1.7.17
graphql-playground-electron has always been โ safe from XSS attacks! This is because configuration is statically defined it's webpack config
graphql-playground-react is safe because it does not use renderPlaygroundPage() anywhere, and thus is not susceptible to template string XSS reflection attacks.
More Information
See the security docs for more details on how your implementation might be impacted by this vulnerability. It contains safe examples, unsafe examples, workarounds, and more details.
We've also provided 'an example of the xss using the express middleware
FAQ
How is this different from GraphiQL?
GraphQL Playground uses components of GraphiQL under the hood but is meant as a more powerful GraphQL IDE enabling better (local) development workflows. Compared to GraphiQL, the GraphQL Playground ships with the following additional features:
Interactive, multi-column schema documentation
Automatic schema reloading
Support for GraphQL Subscriptions
Query history
Configuration of HTTP headers
Tabs
See the following question for more additonal features.
What's the difference between the desktop app and the web version?
The desktop app is the same as the web version but includes these additional features:
Partial support for graphql-config enabling features like multi-environment setups (no support for sending HTTP headers).
Double click on *.graphql files.
How does GraphQL Bin work?
You can easily share your Playgrounds with others by clicking on the "Share" button and sharing the generated link. You can think about GraphQL Bin like Pastebin for your GraphQL queries including the context (endpoint, HTTP headers, open tabs etc).
You can also find the announcement blog post here.
Settings
In the top right corner of the Playground window you can click on the settings icon.
These are the settings currently available:
{
'editor.cursorShape': 'line', // possible values: 'line', 'block', 'underline'
'editor.fontFamily': `'Source Code Pro', 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace`,
'editor.fontSize': 14,
'editor.reuseHeaders': true, // new tab reuses headers from last tab
'editor.theme': 'dark', // possible values: 'dark', 'light'
'general.betaUpdates': false,
'prettier.printWidth': 80,
'prettier.tabWidth': 2,
'prettier.useTabs': false,
'request.credentials': 'omit', // possible values: 'omit', 'include', 'same-origin'
'schema.polling.enable': true, // enables automatic schema polling
'schema.polling.endpointFilter': '*localhost*', // endpoint filter for schema polling
'schema.polling.interval': 2000, // schema polling interval in ms
'schema.disableComments': boolean,
'tracing.hideTracingResponse': true,
'tracing.tracingSupported': true, // set false to remove x-apollo-tracing header from Schema fetch requests
}
Usage
Properties
The React component <Playground /> and all middlewares expose the following options:
props (Middlewares & React Component)
endpointstring - the GraphQL endpoint url.
subscriptionEndpointstring - the GraphQL subscriptions endpoint url.
workspaceNamestring - in case you provide a GraphQL Config, you can name your workspace here
configstring - the JSON of a GraphQL Config. See an example here
settingsISettings - Editor settings in json format as described here
schemaIntrospectionResult - The result of an introspection query (an object of this form: {__schema: {...}}) The playground automatically fetches the schema from the endpoint. This is only needed when you want to override the schema.
tabsTab[] - An array of tabs to inject. Note: When using this feature, tabs will be resetted each time the page is reloaded
In addition to this, the React app provides some more properties:
props (React Component)
createApolloLink [(session: Session, subscriptionEndpoint?: string) => ApolloLink] - this is the equivalent to the fetcher of GraphiQL. For each query that is being executed, this function will be called
createApolloLink is only available in the React Component and not the middlewares, because the content must be serializable as it is being printed into a HTML template.
As HTML Page
If you simply want to render the Playground HTML on your own, for example when implementing a GraphQL Server, there are 2 options for you:
The bare minimum HTML needed to render the Playground
The Playground HTML with full loading animation
Note: In case you do not want to serve assets from a CDN (like jsDelivr) and instead use a local copy, you will need to install graphql-playground-react from npm, and then replace all instances of //cdn.jsdelivr.net/npm with ./node_modules. An example can be found here
As React Component
Install
yarn add graphql-playground-react
Use
GraphQL Playground provides a React component responsible for rendering the UI and Session management.
There are 3 dependencies needed in order to run the graphql-playground-react React component.
import React from 'react'
import ReactDOM from 'react-dom'
import { Provider } from 'react-redux'
import { Playground, store } from 'graphql-playground-react'
ReactDOM.render(
<Provider store={store}>
<Playground endpoint='https://api.graph.cool/simple/v1/swapi' />
</Provider>,
document.body,
)
As Server Middleware
Install
# Pick the one that matches your server framework
yarn add graphql-playground-middleware-express # for Express or Connect
yarn add graphql-playground-middleware-hapi
yarn add graphql-playground-middleware-koa
yarn add graphql-playground-middleware-lambda
Usage with example
We have a full example for each of the frameworks below:
Express: See packages/graphql-playground-middleware-express/examples/basic
Hapi: See packages/graphql-playground-middleware-hapi
Koa: See packages/graphql-playground-middleware-koa
Lambda (as serverless handler): See serverless-graphql-apollo or a quick example below.
There is an XSS Reflection Vulnerability when using these middlewares with unsanitized user input before
Development
$ cd packages/graphql-playground-react
$ yarn
$ yarn start
Open
localhost:3000/localDev.html?endpoint=https://api.graph.cool/simple/v1/swapi for local development!
Contributing to this project
This repository is managed by EasyCLA. Project participants must sign the free (GraphQL Specification Membership agreement before making a contribution. You only need to do this one time, and it can be signed by individual contributors or their employers.
To initiate the signature process please open a PR against this repo. The EasyCLA bot will block the merge if we still need a membership agreement from you.
You can find detailed information here. If you have issues, please email [email protected].
If your company benefits from GraphQL and you would like to provide essential financial support for the systems and people that power our community, please also consider membership in the GraphQL Foundation.
Custom Theme
From [email protected] on you can provide a codeTheme property to the React Component to customize your color theme.
These are the available options:
This is repository is a "mono repo" and contains multiple packages using Yarn workspaces. Please be aware that versions are not synchronised between packages. The versions of the release page refer to the electron app.
Packages
In the folder packages you'll find the following packages:
graphql-playground-electron: Cross-platform electron app which uses graphql-playground-react
graphql-playground-html: Simple HTML page rendering a version of graphql-playground-react hosted on JSDeliver
graphql-playground-middleware-express: Express middleware using graphql-playground-html
graphql-playground-middleware-hapi: Hapi middleware using graphql-playground-html
graphql-playground-middleware-koa: Koa middleware using graphql-playground-html
graphql-playground-middleware-lambda: AWS Lambda middleware using graphql-playground-html
graphql-playground-react: Core of GraphQL Playground built with ReactJS
Help & Community
Join our Discord Server if you run into issues or have questions. We love talking to you!
Does graphql/graphql-playground have a project website?
No homepage URL was recorded for graphql/graphql-playground in TopGit's last sync. The README tab above frequently contains screenshots and demo links, or check the repository description on GitHub.
How active is development on graphql/graphql-playground?
The most recent commit recorded on graphql/graphql-playground was 5 months ago, based on the GitHub push timestamp. The repository has 724 forks โ one of the better signals of community interest.
Is graphql/graphql-playground open source?
Yes โ graphql/graphql-playground ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/graphql/graphql-playground.
What license does graphql/graphql-playground use?
graphql/graphql-playground is released under the MIT license. Always verify the LICENSE file directly on GitHub for the authoritative terms โ license strings can be edited out of sync with a project's actual stance.
What topics is graphql/graphql-playground associated with?
GitHub's repository topics for graphql/graphql-playground: "graphiql", "graphql", "graphql-playground", "ide", "prisma". TopGit's editorial category is API.
Where do I read more about graphql/graphql-playground?
This TopGit page is a snapshot โ the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/graphql/graphql-playground is the definitive source.
Read full README in the tab above.
Is graphql-playground worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of graphql-playground.