AEM6.5 SP13 | Graphql Not working | Adobe Higher Education
Skip to main content
Level 5
December 14, 2022

AEM6.5 SP13 | Graphql Not working

  • December 14, 2022
  • 3 Antworten
  • 3317 Ansichten

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

Dieses Thema wurde für Antworten geschlossen.

3 Antworten

Saravanan_Dharmaraj
Community Advisor
Community Advisor
December 14, 2022
milind_bachani
Adobe Employee
Adobe Employee
December 14, 2022

Hi @pradeepdubey82 ,

 

Please exclude the endpoints in Adobe Granite CSRF Filter configuration.

 

 

Thanks,

Milind

Level 5
December 14, 2022

Excluded paths in CSRF, still same issue.

krati_garg
Adobe Employee
Adobe 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

Level 5
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
Adobe Employee
Adobe 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: