Sitecore Community GraphQL Cookbook

Welcome to Sitecore Community GraphQL Query Cookbook

Created by the community to the community

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.

Find GraphQL Query snippets

Build site navigation

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

    Sitecore DocumentationSample ComponentDelivery API
Read more...

Children items - Paging

GraphQL query to demonstrate how to retrieve children items with paging from Experience Edge

    CommunityChildrenDelivery API
Read more...

Children items - Samples

GraphQL query to demonstrate different ways(hasLayout and includeTemplates) to retrieve children items from Experience Edge

    Delivery APIChildrenCommunity
Read more...

Dictionary Search

GraphQL query to retrieve dictionaries. This is being used the JSS SDK when fetching translations

Source: JSS SDK

    JSS SDKDelivery APISearch
Read more...

Fields - Checkbox

GraphQL query to demonstrate different ways to retrieve Checkbox field from Experience Edge

    Delivery APICommunityFields
Read more...

Fields - Date

GraphQL query to demonstrate different ways to retrieve Date/DateTime field from Experience Edge

    Delivery APICommunityFields
Read more...

Fields - General Link

GraphQL query to demonstrate different ways to retrieve General Link field from Experience Edge

    CommunityDelivery APIFields
Read more...

Fields - Image

GraphQL query to demonstrate different ways to retrieve Image field from Experience Edge

Source: Mihály Árvai

    Delivery APICommunityFields
Read more...

Fields - List all fields for an Item

Listing all fields for an Item.

Source: Mihály Árvai

    Delivery APIFieldsCommunity
Read more...

Fields - Multilist

GraphQL query to demonstrate different ways to retrieve Multilist field from Experience Edge

    FieldsCommunityDelivery API
Read more...

Fields - NameValueList

GraphQL query to demonstrate different ways to retrieve Name Value List field from Experience Edge

    Delivery APICommunityFields
Read more...

Get App/Site Root Id

GraphQL query to retrieve the App/Site root id. This is being used the JSS SDK

Source: JSS SDK

    Sitecore DocumentationDelivery API
Read more...

Page 1 of 3