I am getting " No saved Queries" when I am hitting the Graph QL endpoint | Community
Skip to main content
Murali_D
Level 2
October 21, 2024
Solved

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

  • October 21, 2024
  • 1 reply
  • 938 views

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 :

 




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


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


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 :

 



Anyone can please give me the solution. Thank you

 

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

Hi @murali_d ,

You may cross check your AEM version https://experienceleaguecommunities.adobe.com/t5/adobe-developer-questions/graphql-query-cannot-print-fragment-s-json-on-content-fragment/td-p/616961

 

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-headless/graphql/multi-step/explore-graphql-api

Before save

After save

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-api/sample-queries

Thanks

1 reply

MukeshYadav_
Community Advisor
MukeshYadav_Community AdvisorAccepted solution
Community Advisor
October 21, 2024

Hi @murali_d ,

You may cross check your AEM version https://experienceleaguecommunities.adobe.com/t5/adobe-developer-questions/graphql-query-cannot-print-fragment-s-json-on-content-fragment/td-p/616961

 

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-headless/graphql/multi-step/explore-graphql-api

Before save

After save

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-api/sample-queries

Thanks

Murali_D
Murali_DAuthor
Level 2
October 21, 2024

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