How to fetch the content of all variations of content fragment in single graphql query? | Community
Skip to main content
June 7, 2024
Solved

How to fetch the content of all variations of content fragment in single graphql query?

  • June 7, 2024
  • 1 reply
  • 1009 views

I am trying to fetch all the variations of a content fragment in single graphql query but unable to see all the variation in the response. Instead , i can see only the master variation response in a list. This is the issue in the older version of AEM.

However, in the newer version of AEM , if i try using "includeVariations:true" , i can see the desired output and its working as expected. 

Request your help to provide me the sample graphQL request to include multiple variations of a content fragment - Appreciate your support!

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

Hi @gunjande1 

 

Not sure, the version, where it is not working.

 

I have my local running on AEM 6.5.18, and the following query works fine:

 

query {
blogList(
includeVariations:true
){
items{
_variation
_path
title
}
}
}

 

 

Add as many fields under items., I just added bare minimum

1 reply

krati_garg
Adobe Employee
krati_gargAdobe EmployeeAccepted solution
Adobe Employee
June 9, 2024

Hi @gunjande1 

 

Not sure, the version, where it is not working.

 

I have my local running on AEM 6.5.18, and the following query works fine:

 

query {
blogList(
includeVariations:true
){
items{
_variation
_path
title
}
}
}

 

 

Add as many fields under items., I just added bare minimum