feat: useMenuItems
This commit is contained in:
19
wp-content/themes/headless/app/composables/useMenuItems.gql
Normal file
19
wp-content/themes/headless/app/composables/useMenuItems.gql
Normal file
@@ -0,0 +1,19 @@
|
||||
fragment MenuItem on MenuItem {
|
||||
id
|
||||
label @nullToUndefined
|
||||
to: path @nullToUndefined
|
||||
target
|
||||
}
|
||||
|
||||
query MenuItems($location: MenuLocationEnum) {
|
||||
menuItems(where: { location: $location, parentDatabaseId: 0 }) {
|
||||
nodes {
|
||||
...MenuItem
|
||||
childItems {
|
||||
nodes {
|
||||
...MenuItem
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user