Skip to content

Commit

Permalink
Fix broken NodeJS Lambda URLs (#739)
Browse files Browse the repository at this point in the history
Co-authored-by: Sean Park-Ross <[email protected]>
  • Loading branch information
daniel-chambers and seanparkross authored Oct 25, 2024
1 parent a6d48f6 commit 6c25a1b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions docs/business-logic/typescript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import Thumbnail from "@site/src/components/Thumbnail";

## Introduction

The [Node.js Lambda Connector](https://hasura.io/connectors/nodejs-lambda) can be added to any project to incorporate
custom business logic directly into your supergraph.
The [Node.js Lambda Connector](https://hasura.io/connectors/nodejs) can be added to any project to incorporate custom
business logic directly into your supergraph.

This can be used to enrich data returned to clients, or to write custom mutations in TypeScript with Node.js.

Expand All @@ -32,8 +32,8 @@ If you've never used Hasura DDN, we recommend that you first go through the

## Functions or Procedures

TypeScript functions defined in a file in the [Node.js Lambda Connector](https://hasura.io/connectors/nodejs-lambda)
directory and then tracked, will be available from your Hasura DDN GraphQL API in the form of either **functions** or
TypeScript functions defined in a file in the [Node.js Lambda Connector](https://hasura.io/connectors/nodejs) directory
and then tracked, will be available from your Hasura DDN GraphQL API in the form of either **functions** or
**procedures**.

In Hasura metadata, **functions** are used for read operations. They will not modify the data in the database and can
Expand All @@ -60,7 +60,6 @@ ddn connector init my_ts -i
- Choose a port (press enter to accept the default recommended by the CLI).
- In this example, we've called the connector `my_ts`. You can name it something descriptive.


#### What did this do?

This command created the following file structure in a `app/connector/my_ts` directory, with the `functions.ts` file
Expand Down Expand Up @@ -225,11 +224,14 @@ However, if you prefer to run Node.js directly on your local machine, you can do

1. Ensure you have [Node.js](https://nodejs.org/en) version `>=20.0.0` installed on your machine.
2. Install the necessary dependencies:

```bash title="Change to the connector directory and install dependencies:"
cd my_subgraph/connector/my_ts && npm i
```

3. From the `my_ts` directory, run this command to load environment variables from your project's `.env` file, start the
connector, and watch for any changes:
connector, and watch for any changes:

```bash title="Run the connector with env vars loaded from config"
ddn connector setenv --connector connector.yaml -- npm run start
```
Expand Down

0 comments on commit 6c25a1b

Please sign in to comment.