Skip to content

Commit

Permalink
feat: Block object attributes may have custom types with subfields
Browse files Browse the repository at this point in the history
  • Loading branch information
mrclay committed Mar 29, 2024
1 parent ad03a21 commit cb7bbe9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/eight-steaks-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wpengine/wp-graphql-content-blocks": major
---

feat: Block object attributes may have custom types with subfields
6 changes: 5 additions & 1 deletion includes/Blocks/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ private function get_attribute_type( $name, $attribute, $prefix ) {
}
break;
case 'object':
$type = Scalar::get_block_attributes_object_type_name();
if ( isset( $attribute['properties'] ) ) {
$type = $this->get_query_type( $name, $attribute['properties'], $prefix );
} else {
$type = Scalar::get_block_attributes_object_type_name();
}
break;
}
} elseif ( isset( $attribute['source'] ) ) {
Expand Down

0 comments on commit cb7bbe9

Please sign in to comment.