Skip to content

Commit

Permalink
Provides changeset file.
Browse files Browse the repository at this point in the history
  • Loading branch information
whoami-pwd committed Jan 27, 2025
1 parent 169bf85 commit 39293c9
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .changeset/brave-dragons-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
"@wpengine/wp-graphql-content-blocks": minor
---

Adds support for specifying typed and queryable properties for object attributes in block.json.

Example: Defining a Typed Object in `block.json`:

```json
"attributes": {
"film": {
"type": "object",
"default": {
"id": 0,
"title": "Film Title",
"director": "Director Name",
"__typed": {
"id": "integer",
"title": "string",
"director": "string",
"year": "string"
}
}
}
}
```

In this example, the `film` attribute is an object with defined types for each property (`id`, `title`, `director`, and optionally `year`).

Querying Object Properties in GraphQL:


```graphql
fragment Film on MyPluginFilmBlock {
attributes {
film {
id,
title,
director,
year
}
},
}

query GetAllPostsWhichSupportBlockEditor {
posts {
edges {
node {
editorBlocks {
__typename
name
...Film
}
}
}
}
}
```

0 comments on commit 39293c9

Please sign in to comment.