Create an API Request - Headless Setup accessing-delivering-content-fragments

Learn how to use the GraphQL API for headless delivery of Content Fragment content and AEM’s Assets REST API to manage Content Fragments.

What are GraphQL and Assets REST APIs? what-are-the-apis

Now that you have created some content fragments, you can use AEM’s APIs to deliver them headlessly.

The remainder of this guide focuses on GraphQL access and Content Fragment delivery.

Enable GraphQL Endpoint enable-graphql-endpoint

Before the GraphQL APIs can be used, a GraphQL endpoint must be created.

For details see Manage GraphQL endpoints in AEM.

Query content using GraphQL with GraphiQL

Information architects design queries for their channel endpoints to deliver content. Consider these queries only once per endpoint, per model. For the purposes of this getting started guide, you only must create one.

GraphiQL is an IDE, included in your AEM environment; it is accessible/visible after you configure your endpoints.

For details see Using the GraphiQL IDE.

GraphQL enables structured queries that can target not only specific data sets or individual data objects, but can also deliver specific elements of the objects, nested results, offers support for query variables, and much more.

GraphQL can avoid iterative API requests and over-delivery, and instead allows for bulk delivery of exactly what is needed for rendering as a response to a single API query. The resulting JSON can be used to deliver data to other sites or apps.

Next Steps next-steps

That’s it! You now have a basic understanding of headless content management in AEM. There are many more resources where you can dive deeper for a comprehensive understanding of the features available.

recommendation-more-help
fbcff2a9-b6fe-4574-b04a-21e75df764ab