Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Hi AEM Community, Facing issue while accessing content fragment through graphQL . what would be the reason and how to resolve it?

Avatar

Level 2

 query {
seaBrightByPath(_path: "/conf/bright/settings/dam/cfm/models/seabright") {
item {
firstName
lastName
email
}
}
}

Result

{
"errors": [
{
"message": "Exception while fetching data (/seaBrightByPath) : Path: '/conf/bright/settings/dam/cfm/models/seabright' does yield a Resource but it is not a Content Fragment",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"seaBrightByPath"
],
"extensions": {
"classification": "DataFetchingException"
}
}
],
"data": null
} 

 

1 Accepted Solution

Avatar

Correct answer by
Level 4

Hi Anil,

 

Can you please check if below items are validated:

  1. Verify that the path you are using in the query is correct and corresponds to the location of the content fragment in the AEM content repository.

  2. Check that the resource at the specified path is actually a content fragment and not some other type of resource.

  3. Make sure that you have the necessary permissions to access the content fragment resource.

Let me know if still the issue persists.

 

Thanks,

Monendra

View solution in original post

3 Replies

Avatar

Correct answer by
Level 4

Hi Anil,

 

Can you please check if below items are validated:

  1. Verify that the path you are using in the query is correct and corresponds to the location of the content fragment in the AEM content repository.

  2. Check that the resource at the specified path is actually a content fragment and not some other type of resource.

  3. Make sure that you have the necessary permissions to access the content fragment resource.

Let me know if still the issue persists.

 

Thanks,

Monendra

Avatar

Community Advisor

seems like resource at the specified path "/conf/bright/settings/dam/cfm/models/seabright" is actually NOT a content fragment and has some other type of resource. Verify

Avatar

Employee Advisor

@Anilkumar0208 
The path you are referring is Content Fragment Model Path, and not the Content Fragment itself. The query you are referring in above code, is looking for a CF Path, please check sample query below and link to the basic queries:
https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-ap...

 

{
cityByPath (_path: "/content/dam/sample-content-fragments/cities/berlin") {

item {
_path
name
country
population
categories
}
}
}