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 that over there _hasLayout property is working just fine and returning results.
That means, we found that there is something wrong with Sitecore XM with CDs, I tried following.
1) In the QUERY VARIABLES section, I tried passing values like "true", "false", "" but nothing worked
2) Just to check I passed " " (Empty space) and it return everything without applying filter of _hasLayout
So, behavior was wired, and we easily could figure out that there is some issue with the _hasLayout property being set by the Graph QL code somewhere in the DLL
Solution
I opened up the Sitecore Support Ticket and provided the information, after initial troubleshooting, Sitecore registered this as a bug in their tracking system with bug reference number 551736
They provided us the package of two DLLs
1) Sitecore.Service.GraphQL.dll
2) Sitecore.Services.GraphQL.EdgeSchema.dll
After putting this hot fix, Things are working, and it returned us the results just fine as we wanted.
Just for my learnings, I will be dissembling those DLLs just to see what changed and what was missing in the standard Sitecore 10.3 XM DLLs which ships OOTB, if I find something will share it for you all too.
Comments
Post a Comment