Sitecore GraphQL Error - Argument Where Has Invalid Value
We are currently migrating our Azure hosted Sitecore 10.3 SXA Headless implementation to Sitecore XM Cloud.
We noticed many of our components stopped working after migration and there wasn't enough error details on Vercel, where our front end code is hosted.
When I tried to dig further, I noticed, many of our GraphQL queries were failing with the error -
Argument Where Has Invalid Value
On further investigation, I came to know that it is because of the order of conditions inside Where clause. Same query was working with Azure hosted sitecore 10.3 but not on XM Cloud.
I came to know, we should use constants first in the Where clause and the variables should be at the end of the Where Clause.
For this component- _path was a constant and $author and $language were variables.
After restructuring the queries, I was getting the desired results and components started working :)
I'll be posting more about Sitecore XM Cloud and GraphQL Queries in future posts.
Stay tuned and Keep Learning :)
ArreyNitesh
Email - arreynitesh@gmail.com
