Skip to main content

GraphQL Content Delivery API- retrieving unpublished content

Release date: 12th July 2023

This release features enhancements to the GraphQL Content Delivery API to support retrieving unpublished content using virtual staging. This allows developers to build visualizations for experiences built with GraphQL, enabling users to preview the latest version of content.

Retrieving unpublished content
Link copied!

A virtual staging environment (VSE) can now be used in place of the production GraphQL Content Delivery URL to retrieve the latest version of content, rather than only published content.

A VSE is associated with the hub from which the content is retrieved and can be copied from the visualization or preview settings in the Dynamic Content app.

For example, the endpoint to retrieve unpublished content in the Amplience Examples hub is:

http://1ur5144f984rq1ulolazdecvf8.staging.bigcontent.io/graphql

Navigating to this URL in a browser will open the GraphQL playground. Any queries run in the playground will retrieve the latest version of the content.

Example
Link copied!

In the example below, we've updated a banner in the Amplience Examples hub, but not published the latest version. A delivery preview visualization is shown on the right of the content form and and displays the latest version of the content.

Because you can retrieve the latest version of content, even if it's not yet published, you can now develop your own visualizations using GraphQL.

The tutorial banner with a new unpublished headline.

If we open the GraphQL playground using the VSE URL for the hub and run a query to retrieve all banners, then the latest version of each banner will be retrieved.

As you can see in the image below, the list of banners includes the headline from the latest version of our banner.

Running a query in the playground launched with a VSE URL

If we open the playground using the production URL for the Amplience Examples hub: https://amplience-examples.cdn.content.amplience.net/graphql then the previous, published version of the banner is retrieved.

GraphQL Content Delivery API overview

Content delivery concepts