Skip to main content

Posts

Showing posts with the label #GraphQL

Every Sitecore Instance using GQL is prone to this scenario of template not found - Sitecore Component With GQL Queries Broke On Production

Hello Team, Today, I wanted to share a real scenario and a solution of it about what happened  suddenly to our components and how we identified it and how we resolved it, and most importantly it could happen to your installations too Scenario We have one Sitecore 10.2 headless instance and two sites, One site is non-sxa which is legacy site and another site is a new site which uses headless SXA. Now, non-sxa site is already live and working fine with all components etc. and the new headless site was in development and it has separate development team, So we have same DEV/UAT/PROD environments. One fine morning they took their code and site on environment but strangely some of the GQL components like header footer of legacy site disappeared.  Troubleshooting Steps 1) We checked the broken component's GQL query  2) We took that query and fired it in GQL IDE, and we observed that, Some of the templates references we used were not found, which was working just fine and we hav...

Sitecore XM with CD bug - _hasLayout property not working in GraphQL

Hi Team, Recently I was working on a search solution, it was simple filtration functionality and we wanted to have simple GraphQL queries so we can get items as we need. The setup up is Sitecore XM scaled with CM and CDs (No experience edge) So, I just wrote simple GQL and were trying to test its results, Query worked just fine, and we were satisfied but we also wanted to have a filter for only items which had some presentation details, because we only wanted to return search results which are created from certain templates and having a presentation set on them, So the search list page will link those pages to those items. So, I just put a standard check of _hasLayout property, using which we could target only those items which have presentation details on them, like following. By just introducing the _hasLayout property It stopped working, though this particular project was not on XM Cloud, we tried testing it on XM Cloud environment as it is a generic search GQL, and we found out th...

XM Cloud - 10 Steps Of GraphQL Mutations Using Authoring APIs and Troubleshooting

  Well, well, well Believe me it's been tough getting my understanding around all the dots which we need to connect to make the GraphQL IDE to work, and top of it execute a successful query via it. I am writing this blog to show what all troubleshooting i did, Couple of mistakes which i found, some new things that i had to learn along the way to make it work, Different types of APIs, and their meanings, like Preview API, Delivery API, Token API, Admin API, but all in summary, after this blog, i am sure no one should land into the issue like i did, that is the purpose. NOTE: When you start reading out the documentation for the first time, there will be lot of confusions around what are all these APIs, and which one to use when? Different headers for different APIs, I will have a different blog explaining all of them but specially when you are working with or if you have questions around Authoring API, It is different because it does mutation operations against Sitecore CM, for CRUD ...