Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

AEM 6.5 | Content Fragments RTE inline references returning extra references

Avatar

Level 4

In my Content Fragment model, I'm using a few Rich Text Fields with Fragment Reference of a particular Content Fragment model type allowed. While fetching the inline references used inside the RTE content, it returns all the fragment references used in any of the Content Fragments and not only used inside the queried Content Fragment. Wondering if this is the desired behavior? If yes, Is there any way to fetch only references used inside the RTE of the queried Content model? The query is similar to:

 

query productList($productID:String,$locale:String)
{productList(filter:{
  productID : {_expressions: [{value:$productID}]}},
  _locale : $locale
)
{items{
  _path,
  tagLine{html}, 
}
_references {
      
      ...on FootnoteModel {
        _path
        title
        description
        {
            html
        }
        __typename
      }

    } 
}
}

 

2 Replies

Avatar

Employee Advisor

@MukeshAEM Can you share the response to above query for troubleshooting.

 

By the looks of the query, you might have to put references inside items{}

 

query productList($productID:String,$locale:String)
{productList(filter:{
productID : {_expressions: [{value:$productID}]}},
_locale : $locale
)
{items{
_path,
tagLine{html}
_references {

...on FootnoteModel {
_path
title
description
{
html
}
__typename
}

}
}

}
}

Avatar

Level 4

Hi @krati_garg I tried putting _references inside items as per suggestion but it's showing an error message as "Validation error of type FieldUndefined: Field '_references' in type 'ProductModel' is undefined @ 'productList/items/_references'". The result of the query is expected and returns a single product as a result of the filter but with all the references without filtering. In below result you can see extra reference returning in the result.

 

 

{
    "data": {
        "productList": {
            "items": [
                {
                    "_path": "/content/dam/client/en/shared/products/offer/learn-and-conserve",
                    "tagLine": {
                        "html": "<p><a href=\"/content/dam/client/en/shared/products/footnotes/test-footnotes\">Test Footnotes</a>&nbsp;</p>\n"
                    }
                }
            ],
            "_references": [
                {
                    "_path": "/content/dam/client/en/shared/products/footnotes/free-energy",
                    "title": "Free energy",
                    "description": {
                        "html": "<p>100% free energy are available for high use customer.</p>\n"
                    },
                    "__typename": "FootnoteModel"
                },
                {
                    "_path": "/content/dam/client/en/shared/products/footnotes/test-footnotes",
                    "title": "sdfsdf",
                    "description": {
                        "html": "<p>sdfsdfsdfsdfsdf</p>\n"
                    },
                    "__typename": "FootnoteModel"
                }
            ]
        }
    }
}