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
~ 2 months 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.