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

Vote:
 

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? 

#321329
Edited, May 01, 2024 10:42
Vote:
 

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:

#321373
May 02, 2024 3:21
James Wilkinson - May 02, 2024 11:07
Wonderful! Thank you :D
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.