Open web86 opened 3 years ago
Per the README:
Shortcode/embed blocks are returned untransformed: the parsing of shortcodes is the responsibility of the front-end consuming the GraphQL endpoint. Only the name of the shortcode, its attributes and any nested content of the shortcode are returned in the GraphQL response.
This is mostly because its assumed your consuming application will want to render markup differently than your WordPress backend. So you are free to reimplement the shortcode in your consuming application, or you can filter graphql_blocks_output
to transform the shortcode blocks and inject your desired HTML.
Hello! My posts are made with WpBakery (Visual Composer), so when I get them in WpGraphQL via wp-graphql-content-blocks I get a lot of not rendered shortcodes in output.
I solved this for content field, I registered a new field called "vsCodeShortcodesToHTML" and get there all decoded content. Then in my React component I just use this field instead of "content". To do so I added this code in my function,js:
It works for me untill I want to brake the content into blocks with your plugin. Shortcodes are still remaining. Any thoughts?