VirtusLab-Open-Source / strapi-plugin-navigation

A plugin for Strapi Headless CMS that provides navigation / menu builder feature with their possibility to control the audience and different output structure renderers like (flat, tree and RFR - ready for handling by Redux First Router)
MIT License
314 stars 58 forks source link

Strapi v5: A way of fetching all navigations with GraphQL #460

Open michsko544 opened 3 days ago

michsko544 commented 3 days ago

I would like to ask if it is currently possible to fetch all navigations at once using GraphQL?

If not, I would like to request this feature, as it would be very useful in my use case.

Use Case: In my page layout, I need to fetch multiple menus, such as the main navigation menu and the footer menus. Instead of fetching each menu individually, I would prefer to fetch all menus in a single GraphQL query and then utilize them in the appropriate sections by using their slugs.

This would simplify the data-fetching process and improve efficiency.

Thank you for considering this request!

cyp3rius commented 3 days ago

GQL does not support it yet.

Would you like to fetch all with nested items ? Or just flat structure to preprocess on the FE?

michsko544 commented 3 days ago

It would be great to handle both cases, e.g. via the type parameter. In my case, I use a flat structure for the mobile version and a tree structure for the desktop version

If I had to choose one, I would prefer to receive an API response with nested elements.