Schema Documentation
menuItem
Description
A WordPress navigation menu item
Response
Returns a MenuItem
Arguments
Name | Description |
---|---|
id - ID! | The globally unique identifier of the menu item. |
idType - MenuItemNodeIdTypeEnum | Type of unique identifier to fetch a menu item by. Default is Global ID |
Example
Query
query menuItem( $id: ID!, $idType: MenuItemNodeIdTypeEnum){ menuItem( id: $id, idType: $idType ){ childItems { ...MenuItemToMenuItemConnectionFragment }connectedNode { ...MenuItemToMenuItemLinkableConnectionEdgeFragment }connectedObject { ... on Post { ...PostFragment } ... on Page { ...PageFragment } ... on Category { ...CategoryFragment } ... on Tag { ...TagFragment } ... on ProductCategory { ...ProductCategoryFragment } ... on ProductTag { ...ProductTagFragment } }cssClassesdatabaseIddescriptionidisRestrictedlabellinkRelationshiplocationsmenu { ...MenuItemToMenuConnectionEdgeFragment }menuItemIdorderparentDatabaseIdparentIdpathtargettitleuriurl }}
Variables
{"id":"4","idType":"DATABASE_ID"}
Response
{"data":{"menuItem":{"childItems":MenuItemToMenuItemConnection,"connectedNode":MenuItemToMenuItemLinkableConnectionEdge,"connectedObject":Post,"cssClasses":["abc123"],"databaseId":123,"description":"xyz789","id":4,"isRestricted":false,"label":"xyz789","linkRelationship":"xyz789","locations":["FOOTER"],"menu":MenuItemToMenuConnectionEdge,"menuItemId":987,"order":987,"parentDatabaseId":123,"parentId":"4","path":"xyz789","target":"xyz789","title":"abc123","uri":"xyz789","url":"xyz789"}}}