Build a GraphQL API with Synthetic GraphQL in Azure APIM!
We've already nailed PassThrough GraphQL in APIM ๐( https://tech-sakshimittal.blogspot.com/ ). Now, let's dive into Synthetic GraphQL๐ช Why Synthetic GraphQL? ๐ค It's perfect when you want to: - Aggregate data from multiple sources (REST APIs, Azure SQL, Azure CosmosDB) - Simplify complex backend interactions - Give clients flexible query power ๐ - Transform or shape existing REST APIs without changing them - Expose a more query-friendly interface to clients ๐ Data Sources In this demo, we've set up 3 data sources whose responses will be mapped to GraphQL schema fields. 1. Azure SQL 2. REST API 3. Azure CosmosDB ๐ DataSource1: Azure SQL [dbo].[bookInfo] In Azure SQL database, a table is created ' [dbo].[bookInfo]'. Here is the data: ๐ DataSource 2: BookStore REST API These are the REST API endpoints we'll connect to GraphQL via APIM . GET /books → Fetch all books ๐(list of all books) This endpoint returns...