Hi! I am using Gatsby and Prismic, and I do want to make my menu customizable within Prismic. The menu looks like this:
The first menu item is acting like a button which will open op the menu.
Right now I did build two custom types: one for the main navigation and the second one for each mega menu. I am curious if the way I am querying the navigation is the correct way of doing this?
query MyQuery {
prismicMainNavigation(uid: {eq: "main-navigation"}) {
data {
body {
... on PrismicMainNavigationDataBodyTab {
id
primary {
level_1_link_label
slug {
url
}
mega_menu {
document {
... on PrismicMegamenu {
id
data {
body {
... on PrismicMegamenuDataBodyGroupOfLinks {
id
items {
category_link_label
category_link {
raw
}
}
primary {
group_label
}
}
}
}
}
}
}
}
}
}
}
}
}
I am a total Prismic noob and I couldnt found clear enough(for me) docs about how to make a mega menu, so I hope someone could have some tips how to optimise this.
CodePile | Easily Share Piles of Code Mega Menu JSON
CodePile | Easily Share Piles of Code Main Navigation JSON