1. 14
    Expose Gutenberg Blocks to the Headless WordPress GraphQL Endpoint
    1m 53s

Expose Gutenberg Blocks to the Headless WordPress GraphQL Endpoint

Share this video with your friends

Send Tweet

The same problem occurs as the previous lesson with the blocks that Gutenberg exposes in our API with the GraphQL endpoint.

In this lesson, we will show how to expose the Gutenberg Block data to the GraphQL layer by adding the wp-graphql-gutenberg plugin. There are a couple of things to note about the plugin. Whenever you use a new block type in your editor, you will have to update the blocks registry in the plugin so that it properly exposes the data in GraphQL. Also, when you query for block data you will need to be explicit in the attributes that you request. This behavior is different from REST where REST will serve you all the data available.

Matthew
Matthew
~ 4 years ago

Note: following along from the previous lessons, I needed to disable the Markdown plugin, WP Githuber MD (1.15.2), before using WP GraphQL Gutenberg (0.3.5) and WP GraphQL (1.0.5) without errors.

Andrew HIlls
Andrew HIlls
~ 3 years ago

Been jumping around your course as I only want the block editor and WP GraphQL Gutenberg. Looks like the github project has to be built, not entirely sure. In the readme, I came across this link https://github.com/pristas-peter/wp-graphql-gutenberg/releases all built.

Kevin Cunningham
Kevin Cunninghaminstructor
~ 2 years ago

A bit late to the party here, Andrew, sorry! As this plugin is still not available in the plugin store, you need to download the zip file and then upload it to the WordPress instance like I've done in the video.

I did this earlier in the course for wp-rest-blocks which is why I rushed through it a bit here.