Try our conversational search powered by Generative AI!

Filtering pages based on "Visible in menu" in Optimizely Graph


Hi Guys,

As we know, every page in CMS has a "Display in Navigation" option built into the CMS.

I'm creating a very simply GraphQL query for a headless implementation, and naturally I don't want to return pages that are hidden from navigation.

Correct me if I'm wrong - but it doesn't appear that this property is exposed in the GraphQL schema.

I've just ran an introspection query to fetch all available properties from a random page type and the "VisiblleInMenu" prop from the PageData class isn't exposed in the schema. Not sure if this is a bug or done intentionally for some reason. 

Any idea how I would filter based on this setting? 

Edited, May 01, 2024 10:42

Found this -- just tested, seems to work:

services.ConfigureContentApiOptions(o =>
    o.IncludeMetadataPropertiesPreview = true;

After making that change + reindexing to Graph, I now have the VisibleInMenu property available on my pages:

May 02, 2024 3:21
James Wilkinson - May 02, 2024 11:07
Wonderful! Thank you :D
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.