A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
While debugging why certain IList<Items> properties weren't appearing in the ContentGraph schema, I traced the issue to the ListPropertyConverterProvider class.
In the Resolve method of ListPropertyConverterProvider, there's a type check that determines whether a property should be converted:
public IPropertyConverter Resolve(PropertyData propertyData)
{
return !(propertyData is PropertyCollection) ? null : ...
}
The issue: When propertyData represents an IList<T> property, it's not recognized as a PropertyCollection. The type check fails, the method returns null, and consequently no converter is assigned to handle this property type.
Without a valid IPropertyConverter, these properties are excluded from the ContentGraph schema entirely. They don't appear in the GraphQL API and cannot be queried.
Is this a bug or a missing implementation?
It seems counterintuitive that list-based properties would be explicitly filtered out. The ListPropertyConverter exists and appears designed to handle collection types, but the resolver prevents it from ever being used for IList<T> properties.
Should IList<T> properties be supported, or is this intentional behavior that requires a workaround (e.g., using PropertyCollection or implementing a custom IPropertyConverterProvider)?
Hi Alexander,
Would it be an option to switch from using IList<T> with POCOs to IList<BlockType>? From my experience using Graph with Paas CMS, block-based lists work well with Optimizely Graph and also give you a nicer editing experience in the CMS.
Hi,
I could solve by adding a
public class CustomListPropertyConverterProvider : IPropertyConverterProvider
and I handle there in resolve the IList<T> with this I got all IList<T> (PropertyList<T>) in the Graph schema
Thank you for the finding. I will forward this to the CG development team, if you haven't already?
I talked with our lead engineer in Content Graph/CMS team, and he said that is pretty much as designed - it's never been supported. So you need to either add a converter, or just use a list of blocks.
Hi Quan,
but that means that PropertyList are not part of the ContentGraph schema/concept?
I think that would be a very big restrictation and should be visible in the documentation with a sample how to get them to the graph.
We did this allready but figured out that when in such list properties like LinkItem it make it not so easy to get them also back to get converted in the schema.
For example a List property like this, would good to have a sample in the documentation for everybody
public class Item {
public LinkItem {get;set;}
public string Name {get;set;}
}
public class Test{
[BackingType(typeof(ItemProperty)]
public virtual IList<Item> Items {get;set;}
}
[PropertyDefinitionTypePlugIn]
public class ItemProperty: PropertyList<Item>
{
}
Without a custom converter it will be very difficult, and usually - problematic for us to serialize/deserialize the data. The document can be found here
Hi,
so this means for the LinkItem in this case I have to make a LinkItemDto and create my own converter logic with resolving url etc., because at this point I can't use the LinkItem which allready is in the schema.
I mean the LinkItem has also not a resolved URL property in the current schema. So either way we need to make a own Model to get the resolved Url.
Is this right?
Kind regards
Hi all,
we are using Optimizely CMS 12 with Optimizely Graph and have a content type that contains a list property based on
PropertyList<T>:In the CMS editor this works fine, but in Optimizely Graph the
Itemsproperty does not appear in the schema after a full sync, so we cannot query it via GraphQL.My questions:
Is
PropertyList<T>/IList<T>with a POCO (orT : IContent) officially supported for Optimizely Graph schema generation?If not, is there any recommended pattern (e.g. Conventions API, block-based model, custom data sync) to make these list items available in Graph?
Is there any plan on the roadmap to support
IList<T>/PropertyList<T>directly in Optimizely Graph, or should we avoid this pattern for headless use cases?We tried adding it over
Thanks in advance for any guidance or best practices!