diff --git a/registry/hasura/sendgrid/README.md b/registry/hasura/sendgrid/README.md index 97d22e0e..fd120b7f 100644 --- a/registry/hasura/sendgrid/README.md +++ b/registry/hasura/sendgrid/README.md @@ -5,62 +5,46 @@ This connector uses the SendGrid v3 API to: * List email templates * Send emails -https://github.com/hasura/ndc-sendgrid/tree/main#sendgrid-connector +## Prerequisites -* [Create a SendGrid API account](https://signup.sendgrid.com/) -* [Create an API key](https://app.sendgrid.com/settings/api_keys) -* Create a share service token +1. [Create a SendGrid API account](https://signup.sendgrid.com/) +2. [Create a SendGrid API key](https://app.sendgrid.com/settings/api_keys) +2. Create a [Hasura Cloud account](https://console.hasura.io) +3. Please ensure you have the [DDN CLI](https://hasura.io/docs/3.0/cli/installation) and + [Docker](https://docs.docker.com/engine/install/) installed +4. [Create a supergraph](https://hasura.io/docs/3.0/getting-started/init-supergraph) +5. [Create a subgraph](https://hasura.io/docs/3.0/getting-started/init-subgraph) -You will need the Hasura -[V3 CLI](https://github.com/hasura/v3-cli) -and -[Connector Plugin](https://hasura.io/docs/latest/hasura-cli/connector-plugin/) -installed to use this connector. +The steps below explain how to initialize and configure a connector on your local machine (typically for development +purposes).You can learn how to deploy a connector to Hasura DDN — after it's been configured — +[here](https://hasura.io/docs/3.0/getting-started/deployment/deploy-a-connector). +## Using the SendGrid Connector -## Deployment - -You will need to have a configuration file available with your sendgrid credentials in the following format: +Add the SendGrid connector to your DDN project by running ``` -> cat sendgrid.connector.configuration.json -{"version": 1, "sendgrid_api_key": "YOUR-API-KEY-HERE" } +> ddn connector init -i ``` -Deploy and name the connector with the following command referencing your config: - -> hasura3 connector create sendgrid:v1 --github-repo-url https://github.com/hasura/ndc-sendgrid/tree/main --volume ./sendgrid.connector.configuration.json:/config.json --env SERVICE_TOKEN_SECRET=MY-SERVICE-TOKEN - -Monitor the deployment status by name: - -> hasura connector status sendgrid:v1 - -List your connector with its deployed URL: +Select the SendGrid connector from the list and provide a name for the connector and your SendGrid API key. -> hasura connector list +Then you need to introspect the connector to get its schema: ``` -sendgrid:v1 https://connector-9XXX7-hyc5v23h6a-ue.a.run.app active +> ddn connector introspect ``` +And then you can add all the SendGrid commands to your supergraph: -## Usage - -Include the connector URL in your Hasura V3 project metadata: - -```json -[ - { - "kind": "dataSource", - "name": "sendgrid", - "dataConnectorUrl": "https://connector-9XXX7-hyc5v23h6a-ue.a.run.app", - "schema": {} - } - ... -] +``` +> ddn command add "*" ``` -## Troubleshooting +You can now build your supergraph, run it locally, and open the Hasura Console to try it out: -Please [https://github.com/hasura/ndc-sendgrid/issues/new](submit a Github issue) -if you encounter any problems! +``` +> ddn supergraph build local +> ddn run docker-start +> ddn console --local +``` diff --git a/registry/hasura/sendgrid/metadata.json b/registry/hasura/sendgrid/metadata.json index c9d089c6..da67679d 100644 --- a/registry/hasura/sendgrid/metadata.json +++ b/registry/hasura/sendgrid/metadata.json @@ -1,43 +1,60 @@ { - "overview":{ - "namespace":"hasura", - "description":"Connect to SendGrid v3 API and expose it to Hasura Cloud v3 project", - "title":"SendGrid Native Data Connector", - "logo":"logo.png", - "tags":["email"], - "latest_version":"v0.3" - }, - "author":{ - "support_email":"support@hasura.io", - "homepage":"https://hasura.io", - "name":"Hasura" - }, - "is_verified":true, - "is_hosted_by_hasura":false, - "source_code":{ - "is_open_source":true, - "repository":"https://github.com/hasura/ndc-sendgrid/", - "version":[ - { - "tag": "v0.3", - "hash": "4d129449d3faa295fb145bc99b1f69db73314cce", - "is_verified": true - }, - { - "tag": "v0.2.1", - "hash": "e06860bb3ceedf7ec76e5b8559238bca527422b4", - "is_verified": true - }, - { - "tag": "v0.2", - "hash": "c0b3f13893e24a41df084985908af7ced0265498", - "is_verified": true - }, - { - "tag":"v0.1", - "hash":"8dc16c427e4e0136ebf0cfba1de3831c7939befb", - "is_verified": true - } - ] - } -} + "overview": { + "namespace": "hasura", + "description": "Connect to SendGrid v3 API and expose it to Hasura DDN project", + "title": "SendGrid Connector", + "logo": "logo.png", + "tags": [ + "email" + ], + "latest_version": "v0.6.0" + }, + "author": { + "support_email": "support@hasura.io", + "homepage": "https://hasura.io", + "name": "Hasura" + }, + "is_verified": true, + "is_hosted_by_hasura": false, + "source_code": { + "is_open_source": true, + "repository": "https://github.com/hasura/ndc-sendgrid/", + "version": [ + { + "tag": "v0.6.0", + "hash": "dcd4ca3025783ca732077fd71b094db3902785dd", + "is_verified": true + }, + { + "tag": "v0.5.0", + "hash": "b373cbc42968e9619d2ecfda8ef08f1d0f970619", + "is_verified": true + }, + { + "tag": "v0.4", + "hash": "4eba05262ceb31e2af885717b93d7d487b27275c", + "is_verified": true + }, + { + "tag": "v0.3", + "hash": "4d129449d3faa295fb145bc99b1f69db73314cce", + "is_verified": true + }, + { + "tag": "v0.2.1", + "hash": "e06860bb3ceedf7ec76e5b8559238bca527422b4", + "is_verified": true + }, + { + "tag": "v0.2", + "hash": "c0b3f13893e24a41df084985908af7ced0265498", + "is_verified": true + }, + { + "tag": "v0.1", + "hash": "8dc16c427e4e0136ebf0cfba1de3831c7939befb", + "is_verified": true + } + ] + } +} \ No newline at end of file diff --git a/registry/hasura/sendgrid/releases/v0.5.0/connector-packaging.json b/registry/hasura/sendgrid/releases/v0.5.0/connector-packaging.json new file mode 100644 index 00000000..d8124845 --- /dev/null +++ b/registry/hasura/sendgrid/releases/v0.5.0/connector-packaging.json @@ -0,0 +1,11 @@ +{ + "version": "v0.5.0", + "uri": "https://github.com/hasura/ndc-sendgrid/releases/download/v0.5.0/connector-definition.tgz", + "checksum": { + "type": "sha256", + "value": "ef9b4beb8c3db01856e04524c8debab3b8495421416d20c40faa63cdac73f07e" + }, + "source": { + "hash": "b373cbc42968e9619d2ecfda8ef08f1d0f970619" + } +} \ No newline at end of file diff --git a/registry/hasura/sendgrid/releases/v0.6.0/connector-packaging.json b/registry/hasura/sendgrid/releases/v0.6.0/connector-packaging.json new file mode 100644 index 00000000..5ff03c5a --- /dev/null +++ b/registry/hasura/sendgrid/releases/v0.6.0/connector-packaging.json @@ -0,0 +1,11 @@ +{ + "version": "v0.6.0", + "uri": "https://github.com/hasura/ndc-sendgrid/releases/download/v0.6.0/connector-definition.tgz", + "checksum": { + "type": "sha256", + "value": "e4277682dd5b1705d863966177af3c597693494d7bc109fb1b9fbdf978637d8e" + }, + "source": { + "hash": "dcd4ca3025783ca732077fd71b094db3902785dd" + } +} \ No newline at end of file