Homepage
Link to WPGraphQL on Github
Link to WPGraphQL on WordPress.org

Posts by Jason Bahl

Building a Bookstore using WordPress, WPGraphQL and Atlas Content Modeler

By Jason Bahl on August 17th, 2021

In this post, we’ll look at how we can create a simple Book Store using WordPress, WPGraphQL and Atlas Content Modeler, a new plugin from WP Engine that allows Custom Post Types, Custom Taxonomies and Custom Fields to be created in the WordPress dashboard and allows the data to be accessed from WPGraphQL. By the …

Gutenberg and Decoupled Applications

By Jason Bahl on March 9th, 2021

In this article I want to dive into the current state of Gutenberg and WPGraphQL. This is a technical article about using Gutenberg blocks in the context of decoupled / headless / API-driven WordPress, and makes the assumption that you already know what Gutenberg is and have some general understanding of how it works. TL;DR …

My weekend release snafu

By Jason Bahl on March 3rd, 2021

This past weekend I released v1.2.0 of WPGraphQL. And 1.2.1, and 1.2.2, and 1.2.3, and 1.2.4, and 1.2.5. I made some changes to the Github repo that caused deploys to not behave as intended, and to call it a “snafu” might be an understatement. Plugin distribution For the first 4 years of WPGraphQL, the plugin …

WPGraphQL featured on the Matt Report

By Jason Bahl on March 1st, 2021

On February 28, The Matt Report podcast published the episode where Matt and I discussed WPGraphQL and WordPress. In the interview we discussed topics such as using WordPress with Gatsby, Gutenberg, Component based architecture, and more. Check it out over at MattReport.com, or catch the video interview on YouTube:

WPGraphQL featured on Torque News Drop

By Jason Bahl on February 17th, 2021

I had the pleasure of joining Doc Pop Roberts on the Torque Magazine News Drop. We spent 18 minutes discussing headless WordPress and WPGraphQL. Give it a watch!!

Setting up a new developer environment to contribute to WPGraphQL

By Jason Bahl on February 16th, 2021

I just announced that I am now employed by WP Engine to work on WPGraphQL. With new employment comes a new Macbook, which I need to setup as a dev machine to continue working on WPGraphQL. It’s always a tedious process to get a new computer setup to be an effective developer, so I thought …

What’s next for WPGraphQL?

By Jason Bahl on February 7th, 2021

On February 1, I announced that I was no longer employed at Gatsby, and stated a blog post would be coming soon. This is that blog post. TL;DR I’m joining WP Engine as a Principal Software Engineer where I will continue maintaining WPGraphQL and will contribute to other projects and initiatives centered around the goal …

Allowing WPGraphQL to show unpublished authors in User Queries

By Jason Bahl on December 11th, 2020

Objective The goal of this article is to make a non-authenticated GraphQL query for a User with no published content and to get the User returned in the response. Like the following: NOTE: To test these queries you will want to use a GraphQL client that is not Authenticated, such as GraphQL Playground or Altair. …

Announcing WPGraphQL v1.0

By Jason Bahl on November 16th, 2020

I’m so excited to announce WPGraphQL 1.0! If you’ve been using WPGraphQL for your side projects, but are waiting for the “stable” version, then this is it! You can use WPGraphQL in production with the confidence that it is secure, well documented, and supported full time and long term. If you’re new to the WPGraphQL …

Registering Types and Fields: Pair Programming with Jacob Arriola

By Jason Bahl on March 30th, 2020

On Thursday, March 26, 2020 I pair programmed with Jacob Arriola, Senior Web Engineer at Zeek Interactive. Zeek Interactive is a California-based software agency specializing in WordPress and Apple iOS. They recently moved their own marketing website from traditional WordPress to Headless WordPress with WPGraphQL as the API and Gatsby as the front-end. With the …

Forward and Backward Pagination with WPGraphQL

By Jason Bahl on March 26th, 2020

WPGraphQL makes use of cursor-based pagination, inspired by the Relay specification for GraphQL Connections. If you’re not familiar with cursor-based pagination it can be confusing to understand and implement in your applications. In this post, we’ll compare cursor-based pagination to page-based pagination, and will look at how to implement forward and backward pagination in a …

WPGraphQL v0.8.0

By Jason Bahl on March 23rd, 2020

Release Notes TL;DR This release focuses on adjusting how Nodes are resolved to prevent errors in cases where the nodes are determined to be considered private and non-viewable by the requesting user. (#1138) More details below: Schema Breaking Changes Internal Breaking Changes New Features Release Summary Explanation of Changes to the Abstract Connection Resolver Schema …

Registering GraphQL Fields with Arguments

By Jason Bahl on March 11th, 2020

One of the most common ways to customize the WPGraphQL Schema is to register new fields. When registering fields, argument(s) can also be defined for the field. Field arguments in GraphQL allow input to be passed to the field, and when the field is resolved, the input of the field argument can be used to …

WPGraphQL v0.7.0

By Jason Bahl on February 22nd, 2020

WPGraphQL v0.7.0 is here!https://github.com/wp-graphql/wp-graphql/releases/tag/v0.7.0 This release focused primarily on exposing Post Type and Taxonomy nodes at the root of the query. This release does include some breaking changes, so it’s highly recommended that you read the release notes and test on a staging server before updating.

Pair Programming on WPGraphQL for SEOPress

By Jason Bahl on February 21st, 2020

SEOPress is a popular SEO Plugin for WordPress. Last night I paired with @moon_meister to work on his WPGraphQL for SEOPress plugin. We registered some custom Types and Fields to the WPGraphQL Schema to expose the SEOPress settings to WPGraphQL.

WPGraphQL v0.6.0 Release

By Jason Bahl on January 21st, 2020

WPGraphQL v0.6.0 is here! This release is one of the most significant releases in the history of the WPGraphQL plugin. Breaking Changes Before getting into the hype of the release, I want to highlight some prominent breaking changes. A full list can be found in the release notes. A change to pagination of connections was …

WPGraphQL v0.4.1

By Jason Bahl on November 19th, 2019

Today we released WPGraphQL v0.4.1. This is a non-breaking change release. You can view the release here: https://github.com/wp-graphql/wp-graphql/releases/tag/v0.4.1 Release Summary Update composer dependencies Update filter on WPGraphQL::get_allowed_taxonomies() Update to Docs for WPGraphQL for ACF – Thanks @henrikwirth! Update to Install and Activate Docs – Thanks @jacobarriola! Update to Docs sidebar styles – Thanks @TylerBarnes! Add …

WPGraphQL at the Desert GraphQL Meetup

By Jason Bahl on October 30th, 2019

Last night I had the pleasure of remotely presenting for the Desert GraphQL Meetup in Phoenix, Arizona. TL;DR, Here’s the video Here’s the slides: https://slides.com/jasonbahl-1/desert-graphql-oct-2019#/ Summary of the presentation In the presentation I covered the history of WPGraphQL, why the plugin exists, and why it makes sense to continue building for the wider WordPress community. …

WPGraphQL Updates – October 23, 2019

By Jason Bahl on October 23rd, 2019

This week no attendees were able to join the Zoom call, so there is no recording. Instead, I recapped some things happening with WPGraphQL in Slack. Below are the notes shared in Slack. Prepping Release v0.4.0 This release is centered around making testing, specifically the testing of extensions, easier. The current WPGraphQL makes use of …

WPGraphQL Community Call – October 16, 2019

By Jason Bahl on October 17th, 2019

Summary yesterday’s WPGraphQL Community call: review PR #47 of the WPGraphQL for JWT Authentication Plugin Discuss WPGraphQL JWT Authentication issue #49, about the login mutation not being extendable via filters (starts at 2:13)We file the issue for it Work on the code to fix the issue Work on fixing the Codeception testing environment for the plugin Submit …

Registering Custom Connections with Daniel Olson

By Jason Bahl on October 17th, 2019

Yesterday I had the pleasure of pair-programming with Daniel Olson of Shifter and we walked through the process of registering a custom connection in the WPGraphQL Schema, and writing the resolvers for it. You can watch the recording of the pair programming session below:

Release v0.3.5

By Jason Bahl on August 16th, 2019

Today we released v0.3.5 of WPGraphQL. Full release notes here: https://github.com/wp-graphql/wp-graphql/releases/tag/v0.3.5

WPGraphiQL IDE v1.0.0 with GraphQL Explorer

By Jason Bahl on August 13th, 2019

The GraphiQL IDE is an incredibly helpful tool when using GraphQL. WPGraphiQL has been the go-to GraphiQL IDE for use with WPGraphQL, and today we’ve released v1.0.0 of the WPGraphiQL IDE, now with the AMAZING GraphQL Explorer feature, courtesy of the fine folks at OneGraph.com.

WPGraphQL and Gatsby Livestream

By Jason Bahl on August 1st, 2019

Last week I joined Jason Lengstorf on “Learn with Jason” and we built a Gatsby site using WordPress, WPGraphQL and WPGraphQL for Advanced Custom Fields. Below is a recording of the livestream.

Re-introducing WPGraphQL for ACF

By Jason Bahl on July 23rd, 2019

TL;DR Starting today, WPGraphQL for Advanced Custom Fields is FREE! Some Context In April 2019, I released the WPGraphQL for Advanced Custom Fields plugin as a paid plugin in an attempt to generate enough revenue to one day be able to work on WPGraphQL full-time. I want to thank everyone that purchased a license and …

WPGraphQL featured on Syntax.fm

By Jason Bahl on July 10th, 2019

Today, I had the pleasure of being featured on the Syntax.fm podcast with hosts Wes Bos and Scott Tolinsky. In this episode we discussed how to use GraphQL with WordPress using the WPGraphQL plugin. I also announced that I’ve joined the Gatsby team to work on WPGraphQL an its immediate ecosystem full-tiime. Below is the …

WPGraphQL for ACF is here!

By Jason Bahl on April 19th, 2019

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

By Jason Bahl on April 5th, 2019

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?

By Jason Bahl on March 27th, 2019

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

By Jason Bahl on March 27th, 2019

É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

By Jason Bahl on March 19th, 2019

Zac Gordon put together a group of engineers to work on a formal project, GatsbyWPThemes.com 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

By Jason Bahl on March 18th, 2019

Today we released a new version of WPGraphQL, v0.2.3. The release can be found here: https://github.com/wp-graphql/wp-graphql/releases/tag/v0.2.3 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 …

Preventing unauthenticated requests to your WPGraphQL API

By Jason Bahl on January 30th, 2019

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

By Jason Bahl on November 16th, 2018

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 …

Introducing playground.wpgraphql.com

By Jason Bahl on February 16th, 2018

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 …

New meeting schedule in the WPGraphQL slack

By Jason Bahl on November 18th, 2017

Over the past few weeks we have been working hard towards the stable 1.0 release of the WPGraphQL plugin. We have a plethora of issues in our backlog that we feel are necessary to resolve before the stable release. In order to try and organize our efforts a little bit better, and to make it …

WPGraphQL Featured on FreeCodeCamp

By Jason Bahl on October 5th, 2017

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, …

Tracing for WPGraphQL

By Jason Bahl on September 23rd, 2017

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 …

Using GraphQL Queries in PHP within your WordPress Theme or Plugin

By Jason Bahl on September 20th, 2017

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 …

WPGraphQL at WordCamp for Publishers

By Jason Bahl on August 18th, 2017

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 …

Optimizing WPGraphQL for WordPress VIP

By Jason Bahl on July 21st, 2017

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 …

Query Dad Jokes with WPGraphQL

By Jason Bahl on July 13th, 2017

If you’ve ever wanted to use GraphQL to query dad jokes, look no further. If you’re running a WordPress site, you can install the WPGraphQL plugin along with the WPGraphQL Dad Jokes plugin, and you can query for a random Dad Joke using GraphQL! The plugin uses icanhazdadjoke.com to retrieve a random dad joke. This …

WordCamp Orange County Recap

By Jason Bahl on June 12th, 2017

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/ …

Denver WordPress Developer Meetup Workshop Follow Up

By Jason Bahl on June 1st, 2017

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 …