The Experience Edge schema

Abstract

Learn more about entrypoints, endpoints, and template definitions.

Experience Edge for Experience Manager (XM) comes with a read-only GraphQL schema that is designed to accommodate common front-end use cases for headless Sitecore development. It exposes limited information about Sitecore items. For example, there are no Standard Fields available.

The following queries are available as entrypoints:

  • item - allows querying an item by path or ID.

  • layout - allows querying an item by site and route path, typically for the purpose of accessing its Layout Service JSON (rendered).

  • search - allows constructing a Boolean field search query for finding items by field value or common properties.

For more information, see the example query topic or use the Docs tab in the GraphQL testing UI of the Preview endpoint IDE.

The types available in the Experience Edge schema reflect the template definitions of the Sitecore instance that published to it. You can enable strongly-typed template fields by using inline fragments that select fields from specific types.

In Sitecore, multiple templates can have the same name and templates with field names that conflict with core fields on the item graph type. In GraphQL, names of types and fields must be unique. When a naming collision occurs, the item or field item with the newest creation date has _{guid} appended to the name. The creation date is used because the ordering must be stable and a graph type name must not ever change after it has been referenced.

Paginated queries and fields in the Experience Edge schema, such as the search query, utilize a cursor-based system to request result pages.

For paginated queries:

  • Query arguments include first (number of results to return) and after (the beginning cursor). first has a default value of 10.

  • Query results include pageInfo with hasNext (whether there are more results) and endCursor (used in the after argument to obtain the next page).

  • Query results also include total (provides the total number of available results).

    Note

    The first argument has a special meaning to query the complexity calculation used by the underlying GraphQL library of the Preview schema. Using the nested children field on the Item graph type in particular can quickly lead to Query is too complex to execute errors. To work around this, you can increase the maxComplexity value of the complexityConfiguration setting. See Sitecore GraphQL documentation and GraphQL .NET documentation for more information.

Edge for XM includes standard fields for the GraphQL search query. You can also use all fields of included templates (by their original template field name) for content search queries.

The following table describes the standard fields available for the search query on the Edge schema:

Field

Description

_templates

All template GUIDs, including base (multi-valued).

_path

All parents by GUID (multi-valued).

_parent

The id of the item’s immediate parent.

_name

The item name.

_language

The item language.

_hasLayout

Reflects whether the item has presentation/layout.