Skip to main content
Participant
July 26, 2022
Answered

Content Fragment reference missing from the Graphql response when called recursively

  • July 26, 2022
  • 1 reply
  • 332 views

In the headless approach that we are following for our website, we are working only with Content Fragments.
That said, Content Fragments are behaving like the actual pages.
We are facing a scenario in which our Page level Content Fragment(A) contains a header(H). Header(H) consists of navigation links to our primary pages (A,B,C ---all of which are Fragment references).
As we can see, one of the navigation links in the Header(H) consists of the same Page level Content Fragment(A) from which it is being called.

In such a scenario, when we query the Page level Content Fragment(A) for the underlying navigation links in the header(H), we see that the response consisting of the navigation links doesn't contain the calling Page level fragment reference(A).

 

query GetPageByPath($path: String!){
  pageByPath(_path: $path){
    item{
      header{

        navigationLinks{
          ... on PageModel{
            _path
          }
        }
      }
    }
  }
}

where $path --->is the Page level Content Frgment(A)
      header---> H

 Response:

 {
  "data": {
    "pageByPath": {
      "item": {
        "header": {
          "navigationLinks": [
            {
              "_path": "Path of B content Frgament",
              "_path": "Path of C Content Fragment",
            }
          ]
        }
      }
    }
  }
}

Is there any reason why the Content Fragment A is missing from the navigation links. Is it being cached, or is there any logic that discards the calling fragment from the result?
Is this feature OOTB from AEM, if so, is there a way to resolve this.

This topic has been closed for replies.
Correct answer LinSims

AEM isn't supported here. Try this site instead:

https://experienceleaguecommunities.adobe.com/

1 reply

Ged_Traynor
Community Expert
Community Expert
July 26, 2022

Hi

Can you tell use which Adobe application you're using so we can move the thread to the correct forum

Participant
July 26, 2022

Adobe Experince Manager, AEM as Cloud service

LinSims
Community Expert
LinSimsCommunity ExpertCorrect answer
Community Expert
July 26, 2022

AEM isn't supported here. Try this site instead:

https://experienceleaguecommunities.adobe.com/