The Preview and Delivery GraphQL APIs
The framework-agnostic documentation is under development. If you have suggestions for improving the content, let us know by sharing your Feedback at the bottom of this page.
SitecoreAI content authors use the Page builder to create, manage, and publish content. To retrieve that content, developers use one of two GraphQL APIs, depending on how much content they want to retrieve:
- Preview GraphQL API - retrieve all content, including draft (unpublished) and published content. Ideal for local development and your app's non-production (testing and staging) environment. In these environments, content authors can preview their drafts, and developers can build and test the front end that includes the draft content before publishing. Behind the scenes, all Sitecore content is stored in your content management instance. The content management instance exposes this API.
- Delivery GraphQL API - retrieve published content only. Ideal for your app's production environment where draft content should not be available. Behind the scenes, published content is served from Experience Edge. Experience Edge exposes this API. Experience Edge is a globally distributed, high-performance content delivery layer. It serves static, cached content, making it highly efficient.
Although the Preview GraphQL API and the Delivery GraphQL API return different content, they use the same authorization methods and share the same query and response shape. Note that some differences exist.
During development, you typically make GraphQL queries in two places: in the GraphQL IDE to explore queries and inspect responses, and in your front-end app to render Sitecore content.
To set up the GraphQL IDEs and understand how to authorize your front-end app to use the Preview GraphQL API and the Delivery GraphQL API, see Authorization and API access. Then, review the other recommended content before you complete the Render SitecoreAI content in your app walkthrough.