We are super excited to announce the public preview of Data API builder. A new feature that allows customers to instantly and securely build a GraphQL API for Azure Cosmos DB for NoSQL and Azure Cosmos DB for PostgreSQL.
A quick look at Data API Builder
With Data API Builder, database objects can be exposed via REST or GraphQL endpoints so your data can be accessed on any platform, any language, and any device. Support for Azure SQL, SQL Server, PostgreSQL, MySQL and Azure Cosmos DB provides API developers with an efficiency boost never seen before. Developers can quickly build GraphQL and REST APIS by self-hosting or integrating Data API builder in their Static Web App, eliminating the effort needed to build custom code. Developers only need to provide basic information for database connection, entities, and permissions in a simple configuration file. Data API Builder can use the configuration file and GraphQL type schema file to generate the GraphQL endpoint to perform CRUD operations on your data. Data API Builder does not support REST endpoint when used with Azure Cosmos DB for NoSQL; instead, you can use the Azure Cosmos DB REST API.
Figure: Data API Builder architecture
Features of Data API Builder for Azure Cosmos DB
Build with existing or new databases
Data API Builder gives you the flexibility to build APIs on the data you already have in any of the supported databases and does not require you to store your data in any specific format. It also provides a rich end-to-end developer experience including a CLI which enables rapid development, all you need to do is provide Data API Builder with a connection string and basic schema and permissions information in a simple configuration file. No code is required! Your application will then have the ability to perform CRUD operations securely.
Make powerful queries
Data API Builder for Azure Cosmos DB supports querying a single item. Or, using the filter engine you can perform paginated queries for multiple items. Mutations are provided to insert, update, and delete data from your database.
Fine-grained access control
Data API Builder for Azure Cosmos DB allows several levels of data access and authorization depending on the needs of an application. Data API Builder for Azure Databases supports AAD Managed Identity and when integrated with Static Web App, it provides enterprise security and fine-grained access control. To secure data access, you can use the built-in role-based access control with Static Web Apps authentication integration to limit access to your database to certain users or roles.
Out of the box integration with Azure Static Web Apps
Data API builder has been tightly integrated into Azure Static Web Apps enabling you to quickly build dynamic web apps that scale via the new SWA Database connections feature. It powers you to deploy the entire application with backend connectivity using Azure Cosmos DB with a simple git push.
Database connections with Azure Static Web Apps
This is made available in your development environment via the Static Web Apps CLI emulator (SWA CLI) for consistency across development, enable you to get stated building your apps without the need to wait on or invest in separate backend development effort needed to create APIs for data access.
Benefits:
- Data API Builder provides a superior developer experience with a great toolset including CLI. It simplifies the client-side code and enables rapid product development.
- Declarative data fetching – The consumer defines the data structure it wants to receive, which enables separation of concerns.
- No more over-fetching and under– fetching – Consumers ask for exactly what they need and nothing more, which helps avoid multiple round trips to fetch data.
- Strongly typed shema and introspection – Self documentation of API is based on schema and less error prone as the queries can be validated.
- Language agnostic – Customers can build applications using Data API Builder with any platform, any language, or any device of their choice.
Get started
If you’re excited about what Data API Builder can do for you, try it out today!
- Check out documentation for Data API builder to get started.
- For integration with Azure Static Web Apps see Azure Static Web Apps Database Connections.
- End-to-end samples using the most common frontend frameworks, are available in the Data API Builder Azure Samples .
Let’s build amazing applications with Data API Builder together!
Hi,
Do you support Cosmosdb for mongo ?
Hi, Currently Data API Builder for Azure CosmosDB supports only NOSQL API and PostgreSQL API. The project is open-sourced, contributions are welcome https://github.com/Azure/data-api-builder
Great . Definitely give a shot this feature with azure static web apps one
Please try it out and provide feedback! Thanks
Great to see this finally released. Sajeetharan Sinnathurai – FYI – link to samples at the end is broken.
Thanks Sergiy, link to the samples is fixed.