Can't set types of properties within an object attribute #222
Labels
help wanted
Issue with a clear description that the community can help with
type: feature
New functionality being added
Because WP doesn't define what an attribute with type
object
means, these attributes end up with the generic BlockAttributesObject type in this plugin, and can't be extended withregister_graphql_field('MyBlock', 'film', ...
. If you need decent types from blocks in GraphQL, then, you just can't use nested attributes. Nested attributes would improve the authoring experience of Save/Edit components, allowing us to build up structures from subcomponents.One solution would be for the plugin to read object properties inside attributes like:
A workaround would be to allow the field's GraphQL type to be overridden using
register_graphql_field
or some other function.The text was updated successfully, but these errors were encountered: