Thursday 9 November 2023

XM Cloud :: GraphQL Playground :: Query is too nested to execute error!

while working recently on an XM Cloud project, I ran into issue with GraphQL we were preparing to pull the header component data source, basically when we execute the query in the GraphQL playground we get ""Query is too nested to execute. Depth is 17 levels, maximum allowed on this endpoint is 15." Error, if you want to know how to resolve this, keep reading! 



While working on a header component, we were preparing a GraphQL query to pull the header datasource information from Sitecore and be used for the header component, following is our GraphQL query: 



Now, when I try to run this query in the GraphQL playground, we're getting the following error: 



So how to resolve? the fix for this is basically to increase the max depth attribute in the complexity configuration under the public service for the GraphQL, see the following patch:



Hopefully this will help someone and save you some time. while going through my first XM Cloud I will continue to share my experiences. stay around! 

No comments:

Post a Comment