You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,17 @@
1
1
# Node.js Lambda Connector Changelog
2
2
This changelog documents the changes between release versions.
3
3
4
-
> [!IMPORTANT]
5
-
> Hasura DDN Alpha users should use 0.x versions of the `ndc-lambda-sdk`. v1.x versions of the `ndc-lambda-sdk` support the Hasura DDN Beta.
6
-
7
4
## [Unreleased]
8
5
Changes to be included in the next upcoming release
9
6
7
+
## [1.5.0] - 2024-07-30
8
+
- Updated the NDC TypeScript SDK to v5.2.0 ([#38](https://github.com/hasura/ndc-nodejs-lambda/pull/38))
9
+
- The connector now listens on both ipv4 and ipv6 interfaces
10
+
10
11
## [1.4.1] - 2024-06-06
11
12
12
13
- Added a default .gitignore that ignores node_modules in the connector template ([#34](https://github.com/hasura/ndc-nodejs-lambda/pull/34))
13
-
- Updated to NDC TypeScript SDK to v5.0.0 ([#35](https://github.com/hasura/ndc-nodejs-lambda/pull/35))
14
+
- Updated the NDC TypeScript SDK to v5.0.0 ([#35](https://github.com/hasura/ndc-nodejs-lambda/pull/35))
14
15
- The BigInt scalar type now uses the biginteger type representation
15
16
- Added `dotenv-cli` to the dev dependencies of the connector's default package.json to help with using .env files ([#36](https://github.com/hasura/ndc-nodejs-lambda/pull/36))
Copy file name to clipboardExpand all lines: README.md
+20-25Lines changed: 20 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -6,65 +6,60 @@ The Node.js Lambda connector allows you to expose TypeScript functions as NDC fu
6
6
> [!TIP]
7
7
> The following instructions are just a quick summary of how to use the Node.js Lambda connector.
8
8
> To see it in use in a wider Hasura DDN project, and to understand the underlying DDN concepts, please check out the [Hasura DDN Getting Started Guide](https://hasura.io/docs/3.0/getting-started/overview/).
9
-
> The Node.js Lambda connector is used in the business logic part of that tutorial.
9
+
> The Node.js Lambda connector is used in the [business logic](https://hasura.io/docs/3.0/getting-started/build/add-business-logic?db=TypeScript) part of that tutorial.
10
10
11
-
First, ensure you have Node.js v20+ installed and an existing Hasura DDN project created (see the [Hasura DDN Getting Started Guide](https://hasura.io/docs/3.0/getting-started/overview/)). Then, initialize the connector into that project:
11
+
First, ensure you have Node.js v20+ installed and an existing Hasura DDN project created (see the [Hasura DDN Getting Started Guide](https://hasura.io/docs/3.0/getting-started/overview/)). Then, initialize the connector into that project on an unused port of your choosing:
This will generate the necessary files into the `my_subgraph/connector/my_ts` directory. This creates a `functions.ts` file in which you will write your functions, and a `package.json` with the `ndc-lambda-sdk` installed into it.
18
18
19
-
Restore all the npm packages required to run the connector by running inside the connector's directory:
19
+
To add a `DataConnectorLink`to link the connector into the wider Hasura DDN project, run:
You may wish to change the port the connector runs on to one that is unused (the default is 8080). You can do so by changing the `.env.local` file and adding:
28
+
Restore all the npm packages required to run the connector by running inside the connector's directory:
26
29
27
-
```
28
-
HASURA_CONNECTOR_PORT=<port>
30
+
```bash
31
+
npm install
29
32
```
30
33
31
-
To run the connector with these environment environment variables applied, you can run the following command:
34
+
To run the connector with the required environment variables applied, you can run the following command:
32
35
33
36
```bash
34
37
npx dotenv -e .env.local -- npm run watch
35
38
```
36
39
37
40
This starts the connector in watch mode, which watches for code changes and restarts the connector when they are detected. `npm run start` can be used instead to just start the connector without watching for changes. Both `start` and `watch` are defined in the `package.json`'s scripts section and use the `ndc-lambda-sdk` to host your `functions.ts` file.
38
41
39
-
To add a `DataConnectorLink` to link the connector into the wider Hasura DDN project, run:
40
-
41
-
```bash
42
-
ddn connector-link add my_ts
43
-
```
44
-
45
-
Then, update the values in your subgraph's `.env.my_subgraph` file to include this connector.
Once you have written your functions, and while the connector is running, you can update that `DataConnectorLink` and add all the new functions to your subgraph by running:
HASURA_DDN_PAT=$(ddn auth print-pat) docker compose up --build --watch
68
63
```
69
64
70
65
You can view and query that local instance using the Hasura Graphiql Explorer by navigating to `https://console.hasura.io/local/graphql?url=http://localhost:3000`.
0 commit comments