Sitecore Community GraphQL Cookbook
This website serves as a centralized resource for Sitecore developers seeking GraphQL query samples tailored for XM Cloud and Experience Edge. We gather queries from both official Sitecore documentation and community contributions, ensuring a diverse range of solutions.
Utilizing the Sitecore Blok Design system, the site offers a user-friendly interface for effortless navigation through our curated collection of GraphQL queries. Developers are encouraged to submit their own queries, fostering a collaborative environment of knowledge sharing and support.
Explore the repository to find relevant GraphQL snippets, or contribute your own to help fellow developers enhance their Sitecore projects.
This sample query combines finding the site root with the ability to traverse item children. You can use the hasLayout argument to find only items with layout (navigable pages) and the includeTemplateIds argument to filter on a (base) data template.
Source: Sitecore
GraphQL query to demonstrate how to retrieve children items with paging from Experience Edge
GraphQL query to demonstrate different ways(hasLayout and includeTemplates) to retrieve children items from Experience Edge
GraphQL query to retrieve dictionaries. This is being used the JSS SDK when fetching translations
Source: JSS SDK
GraphQL query to demonstrate different ways to retrieve Checkbox field from Experience Edge
GraphQL query to demonstrate different ways to retrieve Date/DateTime field from Experience Edge
GraphQL query to demonstrate different ways to retrieve General Link field from Experience Edge
GraphQL query to demonstrate different ways to retrieve Image field from Experience Edge
Source: Mihály Árvai
Listing all fields for an Item.
Source: Mihály Árvai
GraphQL query to demonstrate different ways to retrieve Multilist field from Experience Edge
GraphQL query to demonstrate different ways to retrieve Name Value List field from Experience Edge
GraphQL query to retrieve the App/Site root id. This is being used the JSS SDK
Source: JSS SDK
Page 1 of 3