With this connector, Hasura allows you to instantly create a real-time GraphQL API on top of your data models in Azure Cosmos DB for NoSQL Database containers. This connector supports Azure Cosmos DB for NoSQL's functionalities listed in the table below, allowing for efficient and scalable data operations.
This connector is built using the TypeScript Data Connector SDK and implements the Data Connector Spec.
Below, you'll find a matrix of all supported features for the Azure Cosmos DB for NoSQL connector:
Feature | Supported | Notes |
---|---|---|
Native Queries + Logical Models | ✅ | |
Simple Object Query | ✅ | |
Filter / Search | ✅ | |
Simple Aggregation | ✅ | |
Sort | ✅ | |
Paginate | ✅ | |
Nested Objects | ✅ | |
Nested Arrays | ✅ | |
Nested Filtering | ❌ | |
Nested Sorting | ❌ | |
Nested Relationships | ❌ |
- Create a Hasura Cloud account
- Please ensure you have the DDN CLI and Docker installed
- Create a supergraph
- Create a subgraph
The steps below explain how to Initialize and configure a connector for local development. You can learn how to deploy a connector — after it's been configured — here.
ddn auth login
Once you have an initialized supergraph and subgraph, run the initialization command in interactive mode while providing a name for the connector in the prompt:
ddn connector init <connector-name> -i
The CLI will ask for a specific port to run the connector on. Choose a port that is not already in use or use the default suggested port.
Name | Description | Required | Default |
---|---|---|---|
AZURE_COSMOS_KEY | Primary/Secondary key asssociated with the Azure Cosmos DB for NoSQL | No | N/A |
AZURE_COSMOS_ENDPOINT | Endpoint of the Azure Cosmos DB for NoSQL | Yes | N/A |
AZURE_COSMOS_DB_NAME | Name of the Database | Yes | N/A |
AZURE_COSMOS_NO_OF_ROWS_TO_FETCH | Maximum number of rows to fetch per container to infer the schema. (Optional) | No | 100 |
AZURE_COSMOS_SYSTEM_ASSIGNED_MANAGED_IDENTITY | Boolean value to indicate that the connector should use system assigned managed identity | No | N/A |
AZURE_COSMOS_MANAGED_CLIENT_ID | Value of the user-assigned managed client id. | No | N/A |
ddn connector introspect <connector-name>
This will generate a config.json
file that will have the schema of your Azure Cosmos DB for NoSQL.
ddn connector-link add-resources <connector-name>
This command will track all the containers in your Azure Cosmos DB for NoSQL as Models.
We're happy to receive any contributions from the community. Please refer to our development guide.
The Hasura Azure Cosmos DB for NoSQL connector is available under the Apache License 2.0.