Expand my Community achievements bar.

SOLVED

I am getting " No saved Queries" when I am hitting the Graph QL endpoint

Avatar

Level 2

I am using AEM 6.5. I have created a content fragment model via XML source code, which contains only a number field. Using this model, I created a content fragment and set up the endpoint via XML. I also enabled "GraphQL Persistent Queries" in the project configuration properties. However, when I hit the GraphQL query, I get no response, and it still shows "Loading available models..." and "Loading models from endpoints..."

I will attach the screenshot below. Please, can anyone help me resolve this issue?

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

Murali_D_0-1729510418122.png

Murali_D_0-1729578022528.png

 




http://localhost:4502/libs/granite/configurations/content/edit.html/conf/testProject

Murali_D_1-1729510492516.png


http://localhost:4502/libs/cq/graphql/sites/admin/content/console.html

Murali_D_3-1729510560622.png


Content fragment Model XML code under ui.content/src/main/content/jcr_root/conf/testproject/settings/dam/cfm/models/test-data-model.

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root
xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
xmlns:cq="http://www.day.com/jcr/cq/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0"
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
xmlns:granite="http://www.adobe.com/jcr/granite/1.0"
jcr:primaryType="cq:Template"
allowedPaths="[/content/entities(/.*)?]"
ranking="{Long}100">
<jcr:content
cq:scaffolding="/conf/testproject/settings/dam/cfm/models/price-rise-model/jcr:content/model"
cq:templateType="/libs/settings/dam/cfm/model-types/fragment"
jcr:primaryType="cq:PageContent"
jcr:title="test Data Model"
sling:resourceSuperType="dam/cfm/models/console/components/data/entity"
sling:resourceType="dam/cfm/models/console/components/data/entity/default">
<model
cq:targetPath="/content/entities"
jcr:primaryType="cq:PageContent"
sling:resourceType="wcm/scaffolding/components/scaffolding"
dataTypesConfig="/mnt/overlay/settings/dam/cfm/models/formbuilderconfig/datatypes"
maxGeneratedOrder="20">
<cq:dialog
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog">
<content
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns">
<items
jcr:primaryType="nt:unstructured"
maxGeneratedOrder="21">
<priceIncreaseValue
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/numberfield"
fieldLabel="Price Increase Value"
listOrder="21"
metaType="number"
name="priceIncreaseValue"
renderReadOnly="false"
showEmptyInReadOnly="true"
step="any"
valueType="double">
<granite:data
jcr:primaryType="nt:unstructured"/>
</priceIncreaseValue>
</items>
</content>
</cq:dialog>
</model>
</jcr:content>
</jcr:root>

Endpoint XML code under ui.content/src/main/content/jcr_root/content/_cq_graphql/testproject:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0"
xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
jcr:primaryType="sling:Folder">
<endpoint
jcr:primaryType="nt:unstructured"
jcr:title="test endpoint"
sling:resourceType="graphql/sites/components/endpoint"/>
</jcr:root>

Preview Content Fragment Json data :

Murali_D_4-1729510898615.png

 



Anyone can please give me the solution. Thank you

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Murali_D ,

You may cross check your AEM version https://experienceleaguecommunities.adobe.com/t5/adobe-developer-questions/graphql-query-cannot-prin...

 

Else you can now write graphql query and execute the same.

If it is successful you can save from save button.

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

Before save

MukeshYadav__0-1729515938432.png

After save

MukeshYadav__1-1729516035058.png

where office is the name of model.

you can press ctrl+spacebar to get hint of the query

You can take reference of sample queries from https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/headless/graphql...

Thanks

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @Murali_D ,

You may cross check your AEM version https://experienceleaguecommunities.adobe.com/t5/adobe-developer-questions/graphql-query-cannot-prin...

 

Else you can now write graphql query and execute the same.

If it is successful you can save from save button.

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

Before save

MukeshYadav__0-1729515938432.png

After save

MukeshYadav__1-1729516035058.png

where office is the name of model.

you can press ctrl+spacebar to get hint of the query

You can take reference of sample queries from https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/headless/graphql...

Thanks

Avatar

Level 2

Hello @MukeshYadav_ , Thank you for your responding . For writing the query it does not shows the edit option it still loading stage . .  Can you please check once. 

Thank you