A couple of patterns to fetch content using GraphQL in headless application
In this blog post, I picked up a couple of headless component code blocks I worked-on and have discussed the pros and cons of each approach. This post is more of an hindsight by presenting the facts with the idea of continuous improvement thus opening doors for betterment. One of the main differences when it comes to headless applications compared with Sitecore MVC world is, the limit in fetching content from back-end. In other words, headless world is dependent on GraphQL queries while the earlier Sitecore MVC versions were LINQ-based. As a result, the records fetched by GraphQL have a default limit of 10. This could be a pain-point or surprise for developers coming from the back-end world since they are used to a select * mindset. In other words, they had better control over the no. of records to fetch while GraphQL or headless world doesn't entertain such an approach. Needless to say, this limit by headless applications is meant to improve performance or drive better headless de...