Why Use GraphQL?
We are seeing a trend away from REST APIs towards GraphQL because of its inherent technological benefits:
Optimizes efficiency by allowing developers to build queries that eliminate under and over-fetching
Insulates frontend developers from API changes in the backend, allowing rapid product iterations on the frontend without needing backend adjustments
Self-documenting Type system help describe what is possible, enabling faster development
For more information about GraphQL, see GraphQL.org.
GraphQL For Complex Experience Management
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.
Specifically, it is useful when optimizing for mobile experiences due to the elimination of over and under-fetching. An experience can retrieve all the content it needs using less requests, less data and less bandwidth.
The API allows users to:
Query for specific Content Items i.e. return a specific blog post using delivery key
Query for all Content Items for a given Content Type i.e. return a list of blog post authors
Organize query results using pagination and predefined sort criteria i.e. define how multiple blog posts will be sorted and how many will be included per page
Build requests querying multiple different Types i.e. return a list of blog post authors and a list of blog posts, in a single request
Beyond the advantages already described, when you use the Amplience GraphQL Content Delivery API you can also enjoy these benefits:
Digital experiences that are optimized for speed and scalability due to the underlying NoSQL architecture of our CMS, Dynamic Content
Spend less time managing your GraphQL Schema with our automatic schema generation and publishing
Graphs are only published if they are valid, preventing breaking changes from causing system downtime
Manual overrides are provided to give developers the freedom to define their own typenames and to exclude unwanted content item types from their Graphs
Use the GraphQLContent Delivery API Today
To use the API, all you need is to have Content Delivery V2 enabled for your hub(s). See our documentation for further information or contact your Customer Success Manager for more support.
This release is only the beginning of the GraphQL Content Delivery API and we are already working on extending the functionality of this API. You can expect to see new functionality being delivered in early 2023. If you have feedback about using the API, please contact us.