You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first is looking for all pages that match on the legal template, for mapping over and putting in the footer (privacy policy, cookies, etc.).
The second is getting all the pages that have been marked as appearing on the main navigation, so I can build a dynamic main navbar.
I can't put both queries in the layout component, so not sure of the best course of action. I could do the filtering in the render method of the layout and build the two datasets that way, but it feels a bit weird to use GraphQL to get all the pages and then filter them at the component level, after all, isn't the main attraction of GraphQL to just query for the data you need?
Assistance greatly appreciated!
The text was updated successfully, but these errors were encountered:
I'm just after some advice or an idea of the best practice to achieve something. I have these two queries working in GraphiQL:
The first is looking for all pages that match on the
legal
template, for mapping over and putting in the footer (privacy policy, cookies, etc.).The second is getting all the pages that have been marked as appearing on the main navigation, so I can build a dynamic main navbar.
I can't put both queries in the layout component, so not sure of the best course of action. I could do the filtering in the render method of the layout and build the two datasets that way, but it feels a bit weird to use GraphQL to get all the pages and then filter them at the component level, after all, isn't the main attraction of GraphQL to just query for the data you need?
Assistance greatly appreciated!
The text was updated successfully, but these errors were encountered: