How to deal with orphan content

Hello, we are using cf-graphql for our app. We have 2 content types.

Content type A has a field that references content type B.
An editor creates and links a content of B inside A.

How can we prevent someone from unlinking this content B from A?
My fear is that content B gets lost, since we can not filter content entries with 0 links with other content.

I see that cf-grahql gives us back refs on content types, but how can I retrieve only content that has 0 items in that backref?

1 Like

Hi @pablodinella,

There is not a direct way to enforce that a given referenced item cannot be deleted. However, you could achieve that simple validation by writing a small UI extension using our SDK - it’s just not currently supported out of the box.

Also, if a referencing field, or any other type, doesn’t have a value, the JSON response will not include any value on it. You could use the existence parameter in order to filter entries that correspond to this criteria.