pristas-peter / wp-graphql-gutenberg

Query gutenberg blocks with wp-graphql
https://wp-graphql-gutenberg.netlify.app
GNU General Public License v3.0
301 stars 62 forks source link

attributesJSON doesn't respect attributes filter #192

Open valignatev opened 1 year ago

valignatev commented 1 year ago

Hey, thanks for this project! Gutenberg is awful, but your plugin makes working with it bearable :)

I've noticed that attributesJSON don't seem to encode correct set of attributes if I modify one of them through graphql_gutenberg_block_attributes_fields filter. After I do this, attributes contain filtered value for the attributed that I'm interested in, but attributesJSON contain the old one, pre-filtered.

graphql_gutenberg_block_attributes somewhat does half of the job, but it would be very nice if it were after getting source blocks, not before. Because my particular case is filling up an attribute if the block doesn't have it

valignatev commented 1 year ago

124 would have allowed to fix this issue indirectly