WP GraphQL

Updated 19 days ago

Welcome to WPGraphQL.

WPGraphQL is a plugin that enables a GraphQL API for your WordPress install.

What is GraphQL?

GraphQL is a technical specification, developed by Facebook, for an application level query language. What does that mean? Basically GraphQL provides a consistent way to make declarative queries, which will enable you to more easily retrieve the data you want, and the shape that you want it in. GraphQL can be implemented in any language and can cover a vast amount of use cases. WP GraphQL exposes a WordPress installation's data through a GraphQL endpoint. You can send a GraphQL query over HTTP and as a response you will get the matching JSON representation of your data.

Why use GraphQL with WordPress?

WordPress is an incredible tool for a huge variety of use cases. WordPress 4.7 ushered in a shiny new REST API, so why should we consider using WPGraphQL?

GraphQL enables you to have the power over your responses and fetch the data you want. There is only one endpoint;mysite.com/graphql. The simplicity of GraphQL is what makes it so appealing. GraphQL is designed to easily expose the relations of your data.

To replicate these types of complicated queries via SQL, the WP REST API, admin-ajax, or any other API in WordPress, you will end up writing a lot of complex code. With GraphQL, you create your query string and the GraphQL endpoint will handle the complex joins and relations of your data.

Contributors and Sources

WPGraphQL piggybacks on top of WebOnyx's GraphQL PHP implementation, which borrows from Facebook's reference implementation in JavaScript.

Please head to the wp-graphql github repo to help contribute.

Support or Contact