wp-graphql-content-blocks
wp-graphql-content-blocks copied to clipboard
Reusable block isn't resolved inside columns
When I try to make a query to resolve innerBlocks of Core/Block (reusable block), I only got renderedHtml
, but it doesn't resolve innerBlocks or attributes, but when I use it inside root of Gutenberg, GraphQL resolve innerBlocks block to display them as root
too.
Step to reproduce:
- Create a block (on my case : heading + paragraph and group them)
- Save it has reusable
- Add a columns block
- Insert reusable block inside one column
This is what it looks like used on the same page:
GraphQL result
{
"data": {
"testPage": {
"editorBlocks": [
{
"name": "core/group",
"innerBlocks": [
{
"name": "core/heading",
"innerBlocks": []
},
{
"name": "core/paragraph",
"innerBlocks": []
},
{
"name": "core/buttons",
"innerBlocks": [
{
"name": "core/button",
"innerBlocks": []
},
{
"name": "core/button",
"innerBlocks": []
},
{
"name": "core/button",
"innerBlocks": []
},
{
"name": "core/button",
"innerBlocks": []
}
]
}
]
},
{
"name": "core/columns",
"innerBlocks": [
{
"name": "core/column",
"innerBlocks": [
{
"name": "core/paragraph",
"innerBlocks": []
}
]
},
{
"name": "core/column",
"innerBlocks": [
{
"name": "core/block",
"innerBlocks": []
}
]
}
]
},
]
}
},
}
Version:
- wp-graphql-content-blocks: 2.0.0
- Faust.js: 1.2.1
- WPGraphQL: 1.20.0
Hey @MKlblangenois I think reusable blocks only resolve when using the editorBlocks
field instead of the editorBlocks(flat: false)
which you are using.
See: https://github.com/wpengine/wp-graphql-content-blocks/blob/main/includes/Data/ContentBlocksResolver.php#L57-L68
@MKlblangenois were you able to fix your issues?
Hey @MKlblangenois I think reusable blocks only resolve when using the
editorBlocks
field instead of theeditorBlocks(flat: false)
which you are using.See: https://github.com/wpengine/wp-graphql-content-blocks/blob/main/includes/Data/ContentBlocksResolver.php#L57-L68
@theodesp is that a bug, known limitation, or intended behavior?
If it's one of the latter two, can this be documented somewhere? (If it is already, I can't find it)
Hey @MKlblangenois Thanks for the report. I will provide a fix for this.