GraphQL Content Delivery API
Release date: 16th November 2022Link copied!
In this release we're introducing a new Content Delivery API that enables you to retrieve content from the Amplience CMS using GraphQL.
The GraphQL Content Delivery API enables you to optimize the performance of content delivery by reducing the number of API calls needed to retrieve information and only returning what is needed. This means that you can fetch all content needed using fewer requests, less data and bandwidth.
You can find more information in the GraphQL Content Delivery overview.
What this API can doLink copied!
The GraphQL Content Delivery API has been designed to support complex experience management efficiently. It gives developers the tools to eliminate under-fetching and over-fetching, allowing them to find the exact content they want and only return the content they need. Some of the main use cases for the API include, but are not limited to:
- Querying for specific content items
- Querying all content items for a given content type
- Organising query results using pagination and predefined sort criteria
Please note that additional filter functionality, field level localization and support for unpublished content to enable visualization will be included in future releases.
Using the GraphQL Content Delivery APILink copied!
With GraphQL, you can request the data you want in a single structured query, reducing HTTP requests and improving performance. With this functionality, there's no risk of under fetching or over fetching data.
We support automatic schema generation and publishing. Dynamic Content automatically creates and publishes a GraphQL schema, known as a graph, for each Content Delivery 2 enabled hub.
To get started, you should have Content Delivery 2 enabled. Dynamic Content will automatically create and publish your hub’s graph each time you synchronize a content type in that hub.
You can query a graph at any time using the graph’s GraphQL API Endpoint.
In the short video below, we demonstrate how to query for the text, image url and alt text of a blogpost content item: