GraphQL Endpoints
Learn how to enable, execute queries against, and publish and secure GraphQL endpoints.
In this video you will:
- Learn how to enable GraphQL Endpoints
- Learn how to execute GraphQL queries against endpoints
- Understand how to publish GraphQL endpoints
Transcript
Hello and welcome to the Adobe Experience Manager Headless series. In this video, we will explore GraphQL endpoints. Before getting started, let’s take a look at our learning objectives for this tutorial. GraphQL endpoints are simply HTTP API URIs for executing GraphQL queries against content fragments within AAM. Endpoint management is necessary as multiple projects can live within a single AAM instance. In a multi-project environment, there may be project-specific content fragments. Endpoint management plays a critical role in allowing queries to be scoped to content within a specific project or across projects using shared models. It also allows access controls to be applied per project for security. By the end of this video, you should have a good understanding of these core concepts. How to create project endpoints, how to execute GraphQL queries, and how to publish and secure your endpoints in your production environment. Before diving into endpoint management, let’s quickly review some project settings that are required for GraphQL endpoints. First, let’s navigate from Tools to Configuration Browser. Notice that we have several project configurations, Global and Two-brand projects. The Weekend site and Weekend shared. Throughout this tutorial, we will be using the Weekend shared sample project as our primary project since it already has some content fragment models in place. Let’s confirm that GraphQL is enabled by checking the checkbox for the Weekend shared configuration. Then selecting Properties. As you can see, the content fragment models are enabled for this project. The same validation step can be applied to the other projects. You have the ability to create your own project configuration by clicking the Create button. Now, let’s navigate to the GraphQL endpoint management tool. We will start with Tools, then General, then Manage GraphQL endpoints. To create a new endpoint, simply click the Create button and select the corresponding GraphQL schema for your project, which maps to the configuration that contains the content fragment models you want to query. Now that we have seen how to configure endpoints, let’s try executing some GraphQL queries. First, select the Weekend shared endpoint. In the left panel of the AEM GraphQL editor, you can see the persisted queries associated with the selected endpoint. Now, let’s construct a query for our Weekend shared endpoint. We will define a request for listing our adventure contact. Now, let’s execute it. As you can see, we have an expected GraphQL response. Now that we have our endpoint working against our other instance, let’s promote our endpoints to our published instances. We will simply return to the GraphQL endpoint manager in AEM, then select the endpoints that we wish to publish. We will select the Weekend shared endpoint and then click the Publish button. Note that in addition to publishing the endpoints, you will need to ensure that your other assets, such as content fragment models and content fragments, are also published. This concludes the GraphQL endpoint tutorial. Thank you for joining us and stay tuned for future videos in the Headless series.
recommendation-more-help
e25b6834-e87f-4ff3-ba56-4cd16cdfdec4