-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for CoreNavigation blocks (#334)
* feat: Add support for CoreNavigation blocks * Chore: phpstan fix * Chore: phpcs fix * Refactor: move logic into ContentBlocksResolver * chore: phpcs fix * chore: wp coding standards fix * Update thirty-ducks-check.md * Update includes/Data/ContentBlocksResolver.php Co-authored-by: Alex K. <33621842+whoami-pwd@users.noreply.github.com> * chore: phpcs fix * chore: update version to minor * refactor: cast ref value to int * chore: revert coercion check --------- Co-authored-by: Alex K. <33621842+whoami-pwd@users.noreply.github.com>
- Loading branch information
1 parent
b133a1b
commit b813352
Showing
2 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
"@wpengine/wp-graphql-content-blocks": minor | ||
--- | ||
|
||
Adds support for resolving and returning navigation items within the CoreNavigation innerBlocks for WPGraphQL Content Blocks. | ||
|
||
```graphql | ||
{ | ||
posts { | ||
nodes { | ||
editorBlocks { | ||
... on CoreNavigation { | ||
type | ||
name | ||
innerBlocks { | ||
type | ||
name | ||
} | ||
attributes { | ||
ref | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
```json | ||
{ | ||
"data": { | ||
"posts": { | ||
"nodes": [ | ||
{ | ||
"editorBlocks": [ | ||
{ | ||
"type": "CoreNavigation", | ||
"name": "core/navigation", | ||
"innerBlocks": [ | ||
{ | ||
"type": "CorePageList", | ||
"name": "core/page-list" | ||
}, | ||
{ | ||
"type": "CoreNavigationLink", | ||
"name": "core/navigation-link" | ||
} | ||
], | ||
"attributes": { | ||
"ref": 31 | ||
} | ||
}, | ||
] | ||
}, | ||
{ | ||
"editorBlocks": [ | ||
{} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters