The OpenAPI Lambda Connector allows you to import APIs that are documented in the OpenAPI/Swagger format into the Hasura Supergraph. The connector exposes REST API endpoints as Typescript functions, which can be exposed as GraphQL queries or mutations via the NodeJS Lambda Connector.
Functions that wrap GET requests are marked with a @readonly
annotation, and are exposed as GraphQL Queries by the NodeJS Lambda Connector. All other request types are exposed as GraphQL Mutations.
This Connector implements the Data Connector Spec
- See the listing in the Hasura Hub
- Hasura DDN Documentation
- Hasura DDN Quickstart
- NodeJS Lambda Connector
Docs for the OpenAPI data connector:
- Convert Open API/swagger documentation into Typescript functions compatible with NodeJS Lambda Connector
- Supported request types
Request Type | Query | Path | Body | Headers |
---|---|---|---|---|
GET | ✅ | ✅ | NA | ✅ |
POST | ✅ | ✅ | ✅ | ✅ |
DELETE | ✅ | ✅ | ✅ | ✅ |
PUT | ✅ | ✅ | ✅ | ✅ |
PATCH | ✅ | ✅ | ✅ | ✅ |
- Create a Hasura Cloud account
- Please ensure you have the DDN CLI and Docker installed
- Create a supergraph
- Create a subgraph
- If you want to make changes to the generated Typescript files, please ensure you have Node.js v20+ installed
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.
Environment variables that can be used to configure the connector are listed under Supported Environment Variables.
ddn connector introspect <connector-name>
This will generate the required metadata and TypeScript files.
ddn connector-link add-resources <connector-name>
This command will track all the API endpoints in your OpenAPI Document as Commands.
- Support for Relaxed Types is a WiP.
- Types not supported by the NodeJS Lambda Connector are not supported.
Check out our contributing guide for more details.
Please refer to the changelog
The Open API Lambda Connector is available under the Apache License 2.0.