Install and Activate

New to WordPress?If you're new to WordPress we recommend getting started by downloading and using Local By Flywheel

WPGraphQL WordPress Plugin

WPGraphQL is a free, open-source WordPress plugin that turns your WordPress site into a GraphQL API server.

Breaking Change Notice

Until WPGraphQL hits a v1.0.0, breaking changes to the Schema and underlying code should be expected.

This doesn't mean that the plugin is not ready for use in production (it's used in production on some big sites today), it just means that if you choose to use WPGraphQL, you should pay attention to releases in case breaking changes are introduced.

Don’t hesitate to start using the plugin, but just be sure to follow along with releases and keep up to date with conversations in Slack join here

WPGraphQL is already in use in production on several sites, including work.qz.com, hopelabs.org and more.

For the most stable and performant experience, it’s recommended that you use the most recent version of the plugin. You can see the latest releases here.

Of course, as new features are in development, feel free to check out the latest develop branch or check out any other feature or release.

Download / Clone Plugin

WPGraphQL is available on Github: https://github.com/wp-graphql/wp-graphql

You can download the plugin or clone the plugin from Github.

Add the downloaded/cloned plugin to your WordPress plugin directory. On a typical WordPress install, this is located at /wp-content/plugins.

Install DirectoryTo minimize risk of unintended behavior, it’s best for your plugin directory to be "wp-graphql" and not something else, like "wp-graphql-master" or "wp-graphql-develop"

Activate the Plugin

Once the plugin is in the WordPress plugins directory, it can be activated by clicking “Activate” on the plugin screen, or via WP CLI wp plugin activate wp-graphql

Verify the Endpoint Works

The most common use of WPGraphQL is as an API endpoint that can be accessed via HTTP requests (although it can be used without remote HTTP requests as well)

In order for the /graphql endpoint to work, you must have pretty permalinks enabled and any permalink structure other than the default WordPress permalink structure.

Once the plugin is active, your site should have a yoursite.com/graphql endpoint and you the expected response is a JSON payload like so:

Screenshot showing the expected response for visiting the GraphQL endpoint in a browser with no
query defined

Screenshot showing the expected response for visiting the GraphQL endpoint in a browser with no query defined

GraphQL Tools and IDEs

One benefit of GraphQL is that it enables powerful developer tooling.

Throughout the documentation, we will use an embedded GraphiQL IDE to showcase how to use GraphQL against a live WPGraphQL API.

There are many GraphQL IDE tools in the wild, such as:

  • GraphiQL - A React Component that serves as an in-browser IDE for exploring GraphQL.
  • WPGraphiQL – GraphQL IDE right in your WordPress dashboard
  • GraphQL Playground – GraphQL IDE that supports multi-column schema docs, tabs, query history, configuration of HTTP headers and GraphQL Subscriptions.
  • GraphiQL.app – A light, Electron-based wrapper around GraphiQL
  • GraphQL Network – A chrome dev-tools extension for debugging GraphQL network requests.
  • GraphQL IDE – An extensive IDE for exploring GraphQL API’s
  • Altair GraphQL Client – A beautiful feature-rich GraphQL Client for all platforms
  • Insomnia – An full-featured API client with first-party GraphQL query editor
Feel free to use any of the tools mentioned, explore and discover others that aren’t mentioned, or even build your own!

Just note that guides and documentation on this site will reference WPGraphiQL and GraphiQL.app and will also make use of inline instances of the GraphiQL React component to show examples.