I wrote GraphQL Query and executed. Igot error like mentioned below. can any one help me to resolve this ? | Community
Skip to main content
Level 2
Dec 23, 2022 7:01 AM UTC
Solved

I wrote GraphQL Query and executed. Igot error like mentioned below. can any one help me to resolve this ?

QUERY

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

 

Response i got

{
"errors": [
{
"message": "Failed to execute 'text' on 'Response': body stream already read",
"stack": "TypeError: Failed to execute 'text' on 'Response': body stream already read\n at http://localhost:4502/content/graphiql.html:81:33\n at async https://unpkg.com/graphiql/graphiql.min.js:29:224769"
}
]
}

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
krati_garg
krati_gargAccepted solution
Employee
Dec 26, 2022 5:16 PM UTC

@anilkumar0208 

 

This is essentially a CSRF issue, as pointed by others. Please check below link :

https://www.albinsblog.com/2021/10/how-to-deliver-headless-content-through-graphql-api-and-content-f...

 

Please follow similar thread here:

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem6-5-sp13-graphql-not-working/m-p/563874#M140504

 

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

6 replies

krati_garg
krati_gargAccepted solution
Employee
Dec 26, 2022 5:16 PM UTC

@anilkumar0208 

 

This is essentially a CSRF issue, as pointed by others. Please check below link :

https://www.albinsblog.com/2021/10/how-to-deliver-headless-content-through-graphql-api-and-content-f...

 

Please follow similar thread here:

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem6-5-sp13-graphql-not-working/m-p/563874#M140504

 

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

Translate
New Participant
Dec 26, 2022 7:15 AM UTC

Hi @anilkumar0208 

Please check your field names and paths .

Please ref this URL

https://issues.apache.org/jira/browse/SLING-9847

This may help you 

 

Thanks

Translate
Mani_kumar_
New Participant
Dec 23, 2022 2:06 PM UTC

Hi @anilkumar0208 

This can be an issue with CSRF filter

Please follow the below thread to get more info on the similar issue.

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/graphiql-editor-error-on-aem-6-5-10/td-p/427510

Hope this is helpful

Translate
Level 2
Dec 24, 2022 5:39 AM UTC

Hii @mani_kumar_ 

I tried the way as you mentioned, but its not working. I thought it might not be issue with CSRF filter.

Thank you.

Translate
TarunKumar
New Participant
Dec 23, 2022 7:23 AM UTC
Level 2
Dec 24, 2022 5:40 AM UTC

Hii @tarunkumar 

I tried the way as you mentioned, but its not working. I thought it might not be issue with CSRF filter.

Thank you.

Translate