1. Experience Edge APIs

The Preview GraphQL endpoint

The Preview GraphQL endpoint reads data from the content management (CM) back end, both published and unpublished. Previewing your unpublished content is an important part of the content development lifecycle, before finalizing content and publishing to Experience Edge.

Note

The Preview GraphQL endpoint endpoint uses a tokenized search index. As a result, search behavior depends on how fields are indexed:

  • The CONTAINS operator can return multiple results based on tokenized field values.

  • The EQ (Equals) operator may also return multiple results for tokenized text fields, even when an exact match is expected.

To ensure exact matching with EQ in the Preview endpoint, use the SearchQueryFieldMapping feature to map tokenized fields to non-tokenized computed fields. See also the related support article KB1003665.

For information about the behavior of search operators, see Search operators.

The following topics describe how to use the Preview GraphQL endpoint:

To learn about the GraphQL preview limitations and restrictions, see Limitations and restrictions for Headless Services with the Edge preview.

Important

We do not support extending the read-only GraphQL (mirrored) schema, because it breaks compatibility with Experience Edge.

There are some differences between the fields available between preview and published content. Therefore, when querying published content available in Experience Edge, use the fields described in the Experience Edge documentation, and any fields you might have added by making fields from the standard template publishable.

Disabling authentication for media items

By default, viewing media items in the preview endpoint requires authentication. However, you can disable that requirement for a specified period, by using the Media.UrlSignatureExpirationTimeout setting in the sitecore.config file, in the following format:

<!-- MEDIA URL SIGNATURE EXPIRATION TIMEOUT
            The time after which the media URL signature expires.
            The value must be in the format "hh:mm:ss".
            Default value: 00:10:00 (10 minutes)
      -->
        <setting name="Media.UrlSignatureExpirationTimeout" value="00:10:00"/>

If the value is set to 0, authentication is enforced at all times.

After you update the setting, remember to use a patch file to apply the configuration change.

If you have suggestions for improving this article, let us know!