To query the Bricks components, use field bricksComponents, which returns the JSON of all the components (as stored under the bricks_components option in the DB).
{ bricksComponents}
The response will look like this:
{ "data": { "bricksComponents": [ { "id": "flgizw", "category": "", "desc": "", "elements": [ { "id": "flgizw", "name": "container", "settings": { "_padding": { "right": 50 }, "_padding:mobile_landscape": { "right": "0" }, "_alignItems:mobile_portrait": "center", "_width:tablet_portrait": "100%", "_padding:tablet_portrait": { "right": "0" }, "_margin:tablet_portrait": { "bottom": "60" }, "_margin:mobile_portrait": { "bottom": "30" } }, "children": [ "9029cb", "9a5e42" ], "parent": 0, "label": "Text Component" }, { "id": "9029cb", "name": "heading", "settings": { "text": "Exceptional Furniture for Every Residence", "tag": "h2", "_typography:mobile_portrait": { "text-align": "center" } }, "children": [], "parent": "flgizw" }, { "id": "9a5e42", "name": "text", "settings": { "text": "Explore our vast selection of high-quality furniture crafted to elevate the ambiance of every room in your residence. From cozy sofas and sophisticated dining tables to practical storage options, our offerings blend style, durability, and value. Each piece is thoughtfully chosen to uphold the highest quality standards while accommodating diverse budgets and design tastes.", "_margin": { "top": "25" }, "_typography:mobile_portrait": { "text-align": "center" } }, "children": [], "parent": "flgizw" } ], "properties": [], "_created": 1750821473, "_user_id": 1, "_version": "2.0-beta" } ] }}
You can also filter Bricks components by their IDs: bricksComponents(filter: {ids: ["flgizw"]}).
Iterate the elements in the JSON produced by bricksData, modify them as needed, and store the modified JSON back into post meta, via any of these mutations:
After modifying the elements, export the whole modified JSON under a dynamic variable (to inject into the mutation).
For instance, this query will transform all the heading elements in the JSON to uppercase, and export the modified JSON (under dynamic variable $modifiedBricksData):
Alternatively, you can export only the modified elements.
In this query, we filter the elements by name, and export the modified headings (under dynamic variable $modifiedBricksHeadings) and also their IDs (under dynamic variable $modifiedBricksHeadingIDs):