Hi AEM Community, Facing issue while accessing content fragment through graphQL . what would be the reason and how to resolve it? | Community
Skip to main content
Level 2
December 26, 2022
Solved

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

  • December 26, 2022
  • 3 replies
  • 1058 views

 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
} 

 

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 Monendra_Singh

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

3 replies

Monendra_Singh
Monendra_SinghAccepted solution
Level 3
December 26, 2022

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

HeenaMadan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
December 26, 2022

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

krati_garg
Adobe Employee
Adobe Employee
December 26, 2022

@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-api/sample-queries.html?lang=en

 

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

item {
_path
name
country
population
categories
}
}
}