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 […]

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 […]

Denver WordPress Developer Meetup Workshop Follow Up

In preparation for the Workshop I’ll be doing at WordCamp Orange County next weekend, I hosted the Workshop for the Denver WordPress Developer Meetup to get some practice. I learned a lot about how I need to have my files organized for the workshop and learned what steps I can skip to get through the […]

Optimizing WPGraphQL for WordPress VIP

EDIT: This specific issue has been addressed by WordPress core in version WordPress 4.8, but it still shows how to filter to override resolvers in WPGraphQL. If you host your site with WordPress.com VIP, you can (and should) take advantage of the cached functions they provide to improve the performance of some WordPress core uncached functions. If […]

WPGraphQL at WordCamp for Publishers

I hosted a workshop on “Content Syndication with the WP REST API and WPGraphQL” at the first ever WordCamp for Publishers on Friday, August 18, 2017 at the Denver Post building in beautiful Denver, CO. Unfortunately, there was no video of the workshop, but the slides for the workshop are here: http://slides.com/jasonbahl-1/content-syndication In the workshop, we […]

Using GraphQL Queries in PHP within your WordPress Theme or Plugin

GraphQL is most popularly known as a way to fetch data from remote sources via HTTP requests, but with WPGraphQL, you can access your local WordPress data in your plugin or theme via declarative GraphQL queries. An example use case would be a simple shortcode for a list of posts. Let’s look at how we can build […]

Tracing for WPGraphQL

In 2015, Huey Petersen wrote an article about instrumenting a GraphQL schema to track resolver times and provide insight into how the GraphQL server is performing. Since then Apollo Optics has taken the instrumentation to a new level, providing a SaaS solution for storing data about your GraphQL requests. The Apollo team has also been working […]

Introducing playground.wpgraphql.com

I’ve done many presentations about the WPGraphQL plugin, and I find myself showing demos of many of the same features, so in order to streamline the demos before my presentation at the 2018 WordCamp Phoenix, I created https://playground.wpgraphql.com This site showcases examples of GraphQL Queries and Mutations on a live WordPress site with the WPGraphQL […]

WordCamp Orange County Recap

I had the privilege of leading a Workshop this weekend at WordCamp Orange County on building Single Page Apps with React, Apollo, WordPress and WPGraphQL. The slides for the workshop are here: http://slides.com/jasonbahl-1/wcoc The Github repo for the App we build in the workshop is here – with step-by-step commit history and detailed commit messages: https://github.com/wp-graphql/wordflix-single-page-app/ […]

WPGraphQL Featured on FreeCodeCamp

FreeCodeCamp is a popular YouTube channel that posts free videos about coding. Today, Jesse Weigel did a live coding session diving into using GraphQL with WordPress and after comparing a few options, he settled on using WPGraphQL. Watching the video was eye opening. It was great to see that folks are interested in using GraphQL with WordPress, […]