Expand my Community achievements bar.

localsetup setup Headless & GraphQL error

Avatar

Level 5

HI Team,

 

i am trying to setup Headless & GraphQL local setup using wknd site but getting below error

 

Error: SyntaxError: Unexpected end of JSON input

 

sonuk85184451_0-1732970315003.png

 

 

sonuk85184451_1-1732970341807.png

 

even checked CORS configuration are in place already in local AEM

 

/content/cq:graphql/wknd-shared/endpoint.json

@arunpatidar @EstebanBustamante 

 

3 Replies

Avatar

Community Advisor

Hi @sonuk85184451 ,

 

I think you end point was wrong, please try this 

 

/content/graphql/global/endpoint.json

 

Follow this page for more clarification.

https://experienceleague.adobe.com/en/docs/experience-manager-learn/getting-started-with-aem-headles... 

 

Happy Coding,

 

Thanks,

Aditya Chabuku

Avatar

Level 5

@Aditya_Chabuku -  yes , documentation says 

/content/graphql/global/endpoint.json

 but after installing the wknd package i see end point is 

/content/cq:graphql/wknd-shared/endpoint.json 

 

how global one will work to fetch wknd content fragments ?

 

thanks

Arun

Avatar

Community Advisor

Hi @sonuk85184451 ,

 

The repository path of the GraphQL for AEM global endpoint is:

/content/cq:graphql/global/endpoint

For which your app can use the following path in the request URL:

/content/_cq_graphql/global/endpoint.json

 

 

I found this Article it will be helpful to you.

Refer https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/headless/graphql... 

Also, Here are links to Video Series, which explain better 

  1. https://experienceleague.adobe.com/en/docs/experience-manager-learn/getting-started-with-aem-headles... 
  2. https://experienceleague.adobe.com/en/docs/experience-manager-learn/getting-started-with-aem-headles... 

Happy Coding,

 

Thanks,

Aditya Chabuku