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

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 の返信
  • 1058 ビュー

 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
} 

 

このトピックへの返信は締め切られました。
ベストアンサー 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 の返信

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