Expand my Community achievements bar.

SOLVED

GraphQL for aem 6.5.13

Avatar

Level 7

has anyone successfully used GraphQL on a 6.5.13 on premise instance.

 

I have GraphQL 1.0.5 package onto my 6.5.13 instance. I tried to do preview on content fragments but always get error “can not generate query” 

 

Is it even supported on aem6.5.13?

 

thanks,

sri

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @sreenu539 - 

 

It is either an issue with the GraphQL query generation or the underlying GraphQL setup.

 

To rule out these please follow below documentations : 

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

 

https://experienceleague.adobe.com/docs/experience-manager-learn/sites/content-fragments/understand-... 

 

Additionally, ensure that the content fragment you are trying to preview has a valid and accessible preview URL.

  • Go to http://localhost:4502/aem/cfm/models.html/content
  • Locate the content fragment model for which you want to enable preview and click on it
  • In the content fragment model editor, click on the "Policies" tab.

  • Under the "Fragment Policies" section, ensure that the "Allow Preview" option is checked.
  • Additionally, make sure that the "Preview Mode" is set to "Standard".

 

View solution in original post

4 Replies

Avatar

Community Advisor

Hello @sreenu539 -

 

If you have installed the GraphQL 1.0.5 package on your AEM 6.5.13 instance, then you can use GraphQL.

 

can you validate couple of things ? 

  • Ensure that all the GraphQL related necessary dependencies and configurations are properly resolved.
  • Can you also check the GraphQL endpoint, schema definitions, and permissions.
  • Can you share the error logs for more information around what is causing this issue?

Avatar

Level 7

Hi @Tanika02 @aanchal-sikka 

 

use case: consume content fragments in a non-aem js application.

 

Below is the error I get when a content fragment preview:

sreenu539_0-1687529668247.png

 

Steps done:

1.  Installed below package graphql Index package 1.0.5

sreenu539_1-1687529749064.png

2. create end points

sreenu539_3-1687529865958.png

3. Added csrf filter entries

sreenu539_4-1687530026600.png

4. tried end point schema, irrespective of which endpoint, I get below output which is not a real schema of any content fragments to get queries, results.

http://localhost:4502/content/cq:graphql/site/endpoint.GQLschema

 

sreenu539_5-1687530091252.png

 

 

 

 

 

Avatar

Correct answer by
Community Advisor

Hello @sreenu539 - 

 

It is either an issue with the GraphQL query generation or the underlying GraphQL setup.

 

To rule out these please follow below documentations : 

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

 

https://experienceleague.adobe.com/docs/experience-manager-learn/sites/content-fragments/understand-... 

 

Additionally, ensure that the content fragment you are trying to preview has a valid and accessible preview URL.

  • Go to http://localhost:4502/aem/cfm/models.html/content
  • Locate the content fragment model for which you want to enable preview and click on it
  • In the content fragment model editor, click on the "Policies" tab.

  • Under the "Fragment Policies" section, ensure that the "Allow Preview" option is checked.
  • Additionally, make sure that the "Preview Mode" is set to "Standard".