The GraphQL API of AEM provide a powerful query language to expose data of Content Fragments to downstream applications. Content Fragment models define the data schema that is used by Content Fragments. Whenever a Content Fragment Model is created or updated, the schema is translated and added to the “graph” that makes up the GraphQL API.
In this chapter, we will explore some common GraphQL queries to gather content using an IDE called GraphiQL. The GraphiQL IDE allows you to quickly test and refine the queries and data returned. GraphiQL also provides easy access to the documentation, making it easy to learn and understand what methods are available.
This is a multi-part tutorial and it is assumed that the steps outlined in the Authoring Content Fragments have been completed.
Learn to use the GraphiQL tool to construct a query using GraphQL syntax.
Learn how to query a list of Content Fragments and a single Content Fragment.
Learn how to filter and request specific data attributes.
Learn how to query a variation of a Content Fragment.
Learn how to join a query of multiple Content Fragment models