Skip to main content
New Participant
December 14, 2022

AEM6.5 SP13 | Graphql Not working

  • December 14, 2022
  • 3 replies
  • 3310 views

Hi All,

 

I am using AEM6.5 SP13. I need to export content fragment headless content using graphql to external systems.

Every time I am running query on 

http://localhost:4502/content/graphiql.html

 

Getting below error.

 

{
"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"
}
]
}

 

Could anyone suggest what am I missing here?

In tools --> general I could not see graphql query editor option.

 

Any help is highly appreciated.

 

Thanks,

Pradeep

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

3 replies

krati_garg
Employee
December 14, 2022

@pradeepdubey82 

Can you please share the screen shot of the query you are trying and resultant error.

 

Also, have you also installed following essential packages :

  1. Graph QL OAK Index (cfm-graphql-index-def-1.0.0.zip)
  2. GraphiQL Developer tool (graphiql-0.0.6.zip)

 

Also, please follow step by step process below, this should resolve any installation issues:

https://kiransg.com/2021/12/04/aem-content-fragments-with-graphql-getting-started-with-graphql/#:~:text=preview%20JSON%20output.-,Install%3A,-AEM%206.5.11%20(aem

New Participant
December 15, 2022

Hello Krati,

 

CF preview

 

 

Query editor

 

I have installed graphiql-0.0.6.zip but not cfm-graphql-index-def-1.0.0.zip, is this needed to run the graphql query?

 

krati_garg
Employee
December 18, 2022

@pradeepdubey82 

cfm-graphql-index-def.1.0.0.zip may not resolve the above issue, but it is an essential package from Query Performance perspective. 

 

Coming back to the issue, 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-fragments-in-aem.html#.Y58FqnZBw2w:~:text=You%20may%20receive%20the%20below%20error%20while%20executing%20the%20API%27s%20in%20the%20AEM%20Author

 

Also, validate that the Global Endpoint that you have defined is being correctly set in CSRF config.
If you think, all the values you have entered into CSRF config is correct, then please restart the bundle, or restart the local aem set up you are using:

Bundle:

 

milind_bachani
Employee
December 14, 2022

Hi @pradeepdubey82 ,

 

Please exclude the endpoints in Adobe Granite CSRF Filter configuration.

 

 

Thanks,

Milind

New Participant
December 14, 2022

Excluded paths in CSRF, still same issue.

Saravanan_Dharmaraj
New Participant
December 14, 2022