0

I am using Sitecore 9.3 with JSS, I faced issue that when i add new field on template and try to retrieve it using GraphQl Query , it is coming on CM, but gives me error on CD

"message": "Cannot query field "Fieldname" on type "DestinationPage"

, i maked sure from publishing and field in web database, the issue that the qraphql schema not updated on CD after publishing, BTW I have separate CD and CM.

I want to reset or regenerate schema on CD after publishing. Is there way i can do this ???

1 Answer 1

1

GraphQL schema auto-updates on CD after publishing. Can you check the schema provider configuration for your GraphQL host is pointing to the correct database as below.

<configuration>
   <sitecore>
      <api>
         <GraphQL>
           <endpoints>
              <edge url="/sitecore/api/graph/edge" type="Sitecore.Services.GraphQL.Hosting.GraphQLEndpoint, Sitecore.Services.GraphQL.NetFxHost" resolve="true">
                <schema hint="list:AddSchemaProvider">
                  <content ref="/sitecore/api/GraphQL/defaults/content/schemaProviders/edgeContent" param1="web" role:require="ContentDelivery"/>
                </schema>
              </edge>
           </endpoints>
         </GrapQL>
       </api>
    </sitecore>
</configuration>

Moreover you can also check the GraphQL schema for the CD server by navigating to the schema url as below:

https://{host_url}/sitecore/api/graph/edge/schema

Above url enlist the details of the schema, including templates and its fields in GraphQL.

Hope this helps!!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.