NEW! WPGraphQL for Advanced Custom Fields

Interact with ACF Field data using GraphQL Queries

WPGraphQL for ACF is here!

Many folks using WPGraphQL have asked about how to use GraphQL with their ACF data. The answer has typically been to manually map their ACF fields to the GraphQL schema using functions like register_graphql_field and register_graphql_object_type. For a few fields, this isn’t much of an issue, but when you have dozens of fields, this gets […]

Upgrading to v0.3.0

WPGraphQL v0.3.0 is one of the most substantial releases to date for the plugin. You can read more about what was included in this release here and here. Test in Staging Environment It’s best practice to test plugin updates in staging environment, but I want to re-iterate that again here. Make sure you thoroughly test […]

What’s coming in v0.3.0?

The next release of WPGraphQL will be version v0.3.0, and is slated to be released next week. This release is arguably the most substantial release to date. It’s going to made up of 2 major features: “DataLoader” and “Model Layer“ DataLoader The role of DataLoader is to load data as efficiently as possible. You can […]

WPGraphQL at WordCamp Montreal

Étienne Bélanger gave a talk at WordCamp Montreal 2018 titled: “Your First Headless WordPress Project with ReactJS and GraphQL”. In the talk, he covers some basic differences between the WP REST API and WPGraphQL, then shows how to use React and Apollo Client to consume data from a WordPress site with the WPGraphQL plugin active. […]

WPGraphQL + Gatsby Tutorial

Zac Gordon put together a group of engineers to work on a formal project, to port popular WordPress themes to Gatsby themes. Recently, Muhammad Muhsin published a tutorial showcasing how users can create a Gatsby theme using WordPress as the CMS and WPGraphQL as the API for Gatsby to consume data from. Take a […]

Release v0.2.3

Today we released a new version of WPGraphQL, v0.2.3. The release can be found here: Below is a recap of the release notes: Breaking Changes none New Features #676: New TimezoneEnum type added to the Schema #719: New graphql_menu_item_connection_args and graphql_menu_item_connection_query_argsfilters added to the MenuItemConnectionResolver. Thanks @epeli! Bug Fixes #714 Fixes global $post not properly being setup before resolving fields for […]

Easy static HTML exports of your Next.js + GraphQL site

You’re here because you’d like to learn how to create static HTML exports for your Next.js site which uses GraphQL as a data source to create dynamic pages from page components. And that site may even use WPGraphQL to pull content from WordPress. Fantastic, this article will describe the simple process of doing exactly that. […]

Preventing unauthenticated requests to your WPGraphQL API

Someone asked in the Slack channel how they could lock down the WPGraphQL endpoint so that only authenticated users could access it. Provided Solution What this does Below, I’ll walk through what this snippet does. Hook into the GraphQL request lifecycle This snippet hooks into the do_graphql_request action, which is fired when a GraphQL request […]

Build an App Using React and the GraphQL Plugin for WordPress in ~15mins

If you keep up with tech trends, you likely already know that GraphQL is one of the newer breakout technologies that people are gushing about. It’s an open source specification created and used by Facebook’s Engineering team that can be used to push and pull data between APIs and apps. REST APIs have traditionally been […]

Querying Sticky Posts with GraphQL

Recently, a WPGraphQL user asked how to query only sticky posts with a GraphQL query.  One of the great things about WPGraphQL is how customizable it is with hooks and filters, making it easy to extend the API for your needs.  End goal One (of many possible) solutions would be to allow the client to specify that […]