Skip to content

Instantly share code, notes, and snippets.

@mrclay
Created August 18, 2023 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrclay/eba5735fec04961b37123a71bf04c46e to your computer and use it in GitHub Desktop.
Save mrclay/eba5735fec04961b37123a71bf04c46e to your computer and use it in GitHub Desktop.
GraphQL query for WP menu items
query MenuQuery {
menus {
nodes {
id
primaryMenuFields {
demoField
}
menuItems {
nodes {
url
title
connectedNode {
node {
... on EducationPost {
title(format: RAW)
uri
}
... on Page {
title(format: RAW)
uri
}
... on Post {
title(format: RAW)
uri
}
... on Product {
title(format: RAW)
uri
}
}
}
target
}
}
slug
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment