AEM 6.5 | Content Fragments RTE inline references returning extra references | Community
Skip to main content
Level 3
January 10, 2023

AEM 6.5 | Content Fragments RTE inline references returning extra references

  • January 10, 2023
  • 1 reply
  • 731 views

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 } } } }

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

krati_garg
Adobe Employee
Adobe Employee
January 11, 2023

@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
}

}
}

}
}

MukeshAEMAuthor
Level 3
January 11, 2023

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" } ] } } }