wp-graphql-gutenberg icon indicating copy to clipboard operation
wp-graphql-gutenberg copied to clipboard

Fix compatibility with wp-graphql-gutenberg-acf

Open jonsherrard opened this issue 2 years ago • 0 comments

Simply casting the $attributes array to an object before running it though Schema validation fails with ACF Pro's field groups. ACF outputs another nested array. Using JSON decode makes sure that nested arrays are converted to objects as well.

There is also an issue with the HTML loader failing if there's no innerHTML defined in the block. HTML-less blocks are very useful for WordPress as a headless CMS with WPGraphQL.

I've added a check for empty HTML and added an empty span with a data-attr warning about the lack of innerHTML.

jonsherrard avatar Jul 18 '21 01:07 jonsherrard