Named reference content constraint in ServerEntityDecorator
In GraphQL API we're not able to express following part of the query:
fragment groupDetailFields on Group {
motive: media(filterBy: {attributeGalleryEquals: "main-motive"}) {
...imageFieldsGroup
}
gallery: media(filterBy: {attributeGalleryEquals: "gallery"}) {
...imageFieldsGroup
}
model3d: media(filterBy: {attributeGalleryEquals: "model3d"}) {
...imageFieldsGroup
}
attachments: media(filterBy: {attributeGalleryEquals: "attachments"}) {
...fileFieldsGroup
}
}
The problem is that now it's possible to define only a single referenceContent per entityFetch container. Since this feature is naturally possible only in GraphQL API, it makes no sense trying to support this kind of feature in standard API in all other protocols. It would only complicate comprehensibility of the APIs and would confuse developers.
The idea is to add "undocumented" variant of referenceContent constraint, that would accept extra String parameter to name the reference set and pass its own nested filter / order / require constraints different to other named reference contents. These sets would then be accessible on internal ServerEntityDecorator.java interface, that is available only on the server side behind explicit cast.