Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
152 lines (136 sloc) 2.73 KB
title description
Learn about how to interact with Pages using WPGraphQL

import GraphiQL from '../../components/GraphiQL'

There are various points of entry for menus and their items.


The menus query is the only query that will return all of the menus on your site. If you would like to query a specific menu or that menu's data, you will need the menu or menuItem's ID.


After running the menus query grab one of the IDs in the response and use it in the other queries below.


<GraphiQL withDocs={true} query=' query GET_MENU( $id: ID! ){ menu(id: $id) { count id menuId name slug menuItems { nodes { id menuItemId title url cssClasses description label linkRelationship target } } } }' variables={ { id: 'TWVudTo5' } } />

Menu Item

<GraphiQL withDocs={true} query=' query GET_MENU_ITEM( $id: ID! ){ menuItem( id: $id ) { id menuItemId title url connectedObject { __typename } cssClasses description label linkRelationship target }}' variables={{ id: 'bmF2X21lbnVfaXRlbToxMDQ2' }} />

Menu Items

You can’t perform that action at this time.