Skip to content

Commit

Permalink
Merge branch 'main' into pranshi/docs/add-sqlserver-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pranshi06 authored Feb 7, 2025
2 parents 1ebdd4b + 9e34bd5 commit 3ff6ba7
Show file tree
Hide file tree
Showing 45 changed files with 786 additions and 400 deletions.
624 changes: 376 additions & 248 deletions docs/auth/jwt/jwt-configuration.mdx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/collaboration/service-accounts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ collaborator.
### Step 1. Login via CLI

```bash
ddn auth login --pat <service-account-token>
ddn auth login --access-token <service-account-token>
```

### Step 2. Create and apply supergraph build
Expand Down
4 changes: 2 additions & 2 deletions docs/deployment/self-hosted/docker-compose-simple.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ browser, you will need to use a personal access token.
On your local machine, once you are logged in with `ddn auth login` run:

```bash
ddn auth print-pat
ddn auth print-access-token
```

This will print out your personal access token. Copy it and on the cloud server run:

```bash
ddn auth login --pat <your-pat>
ddn auth login --access-token <access-token>
```

This will authenticate the DDN CLI with your Hasura account.
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/allowlist/how-to.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ OTEL_EXPORTER_PAT = "<PAT>"
```

Replace `<PAT>` with the Personal Access Token (PAT) for the Hasura Cloud account. You can generate this using the
`ddn auth print-pat` command.
`ddn auth print-access-token` command.

## Step 7. Deploy the plugin

Expand Down
4 changes: 4 additions & 0 deletions docs/plugins/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ Pre-response plugins are triggered at the final stage of the execution pipeline,
before the response is sent to the client**. These plugins allow you to execute logic based on the response such as
calling third-party services before the client receives the response.

### Pre-Route plugins

Pre-route plugins are executed at the very beginning of request handling, **before predefined endpoints are processed**. They allow you to insert custom HTTP handlers into your API, enabling features like REST-style GraphQL endpoints, internal tools, or documentation interfaces such as a GraphQL schema visualizer or Swagger UI for a JSON API.

## Find out more

- [Learn more about how plugins work](/plugins/introduction.mdx)
Expand Down
20 changes: 17 additions & 3 deletions docs/plugins/restified-endpoints/how-to.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@ definition:
url:
valueFromEnv: RESTIFIED_ENDPOINTS_URL
config:
match: "/v1/api/rest/*"
matchPath: "/v1/api/rest/*"
matchMethods: ["GET", "POST"]
request:
method: GET
headers:
forward:
- Authorization
- x-hasura-role
- x-hasura-ddn-token
additional:
hasura-m-auth:
valueFromEnv: M_AUTH_KEY
Expand All @@ -87,6 +88,11 @@ definition:
query: {}
method: {}
body: {}
response:
headers:
additional:
content-type:
value: application/json
```
:::tip URL Match
Expand Down Expand Up @@ -167,7 +173,6 @@ Update the `src/config.ts` file with the RESTified GraphQL endpoints that you wa
```typescript
export const Config = {
graphqlServer: {
url: "http://localhost:3000/graphql",
headers: {
additional: {
"Content-Type": "application/json",
Expand Down Expand Up @@ -218,10 +223,14 @@ In `restified-endpoints-plugin` directory, update the `wrangler.toml` file with
[vars]
OTEL_EXPORTER_OTLP_ENDPOINT = "https://gateway.otlp.hasura.io:443/v1/traces"
OTEL_EXPORTER_PAT = "<PAT>"
GRAPHQL_SERVER_URL = "<DDN_GRAPHQL_SERVER_URL>"
```

Replace `<PAT>` with the Personal Access Token (PAT) for the Hasura Cloud account. You can display this using the
`ddn auth print-pat` command.
`ddn auth print-access-token` command.

Replace `<DDN_GRAPHQL_SERVER_URL>` with the URL of your DDN GraphQL server. You can find this in the DDN console under
the `Settings > Project Summary` section.

## Step 7. Deploy the plugin

Expand Down Expand Up @@ -250,4 +259,9 @@ Create a new supergraph build on Hasura DDN to check your work in the cloud.
ddn supergraph build create
```

## Step 9. Apply the build

Apply the build to make it the default one served by your Hasura DDN project endpoint. You can do this from the DDN
console by choosing the build from the `Builds` tab and clicking `Apply Build`.

The engine will execute the plugin for each requests to the RESTified GraphQL endpoints you defined.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ definition:
localEnvFile: ../.env
scripts:
docker-start:
bash: HASURA_DDN_PAT=$(ddn auth print-pat) docker compose --env-file .env up --build --pull always -d
powershell: $Env:HASURA_DDN_PAT = (ddn auth print-pat); docker compose --env-file .env up --build --pull always -d
bash: HASURA_DDN_PAT=$(ddn auth print-access-token) docker compose --env-file .env up --build --pull always -d
powershell: $Env:HASURA_DDN_PAT = (ddn auth print-access-token); docker compose --env-file .env up --build --pull always -d
```
#### Running Scripts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ definition:
default: ...
scripts:
docker-start:
bash: HASURA_DDN_PAT=$(ddn auth print-pat) docker compose --env-file .env up --build --pull always -d
powershell: $Env:HASURA_DDN_PAT = (ddn auth print-pat); docker compose --env-file .env up --build --pull always -d
bash: HASURA_DDN_PAT=$(ddn auth print-access-token) docker compose --env-file .env up --build --pull always -d
powershell: $Env:HASURA_DDN_PAT = (ddn auth print-access-token); docker compose --env-file .env up --build --pull always -d
#highlight-start
build-supergraph:
bash:
Expand Down
5 changes: 3 additions & 2 deletions docs/reference/cli/commands/ddn.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ DDN Command Line Interface.

```
DDDDDDD\ DDDDDDD\ NN\ NN\
DDDDDDD\ DDDDDDD\ NN\ NN\
DD __DD\ DD __DD\ NNN\ NN |
DD | DD | DD | DD | NNNN\ NN |
DD | DD | DD | DD | NN NN\NN |
Expand Down Expand Up @@ -63,3 +63,4 @@ ddn [flags]
--out string Output format. Can be table, json or yaml. (default "table")
--timeout int Request timeout in seconds [env: HASURA_DDN_TIMEOUT] (default 100)
```

8 changes: 3 additions & 5 deletions docs/reference/cli/commands/ddn_auth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ Manage Hasura DDN CLI Auth

## Available operations

- [ddn auth generate-promptql-secret-key](/reference/cli/commands/ddn_auth_generate-promptql-secret-key) - Generates the
project's PromptQL secret key and saves to global config
- [ddn auth generate-promptql-secret-key](/reference/cli/commands/ddn_auth_generate-promptql-secret-key) - Generates the project's PromptQL secret key and saves to global config
- [ddn auth login](/reference/cli/commands/ddn_auth_login) - Login to DDN
- [ddn auth logout](/reference/cli/commands/ddn_auth_logout) - Logout from DDN
- [ddn auth print-pat](/reference/cli/commands/ddn_auth_print-pat) - Prints the PAT to STDOUT
- [ddn auth print-promptql-secret-key](/reference/cli/commands/ddn_auth_print-promptql-secret-key) - Prints the
project's PromptQL secret key to STDOUT
- [ddn auth print-access-token](/reference/cli/commands/ddn_auth_print-access-token) - Prints the access token to STDOUT
- [ddn auth print-promptql-secret-key](/reference/cli/commands/ddn_auth_print-promptql-secret-key) - Prints the project's PromptQL secret key to STDOUT

## Options

Expand Down
7 changes: 4 additions & 3 deletions docs/reference/cli/commands/ddn_auth_login.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ ddn auth login [flags]
ddn auth login

# Login with Personal Access Token
ddn auth login --pat <your-personal-access-token>
ddn auth login --access-token <your-access-token>
```

## Options

```sass
-h, --help help for login
--pat string Personal Access token [env: HASURA_DDN_PAT]
--access-token string The Personal Access Token or Service Account Token [env: HASURA_DDN_ACCESS_TOKEN]
-h, --help help for login
--pat string Personal Access token [env: HASURA_DDN_PAT] (DEPRECATED: use --access-token instead)
```

## Options inherited from parent operations
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
---
sidebar_label: ddn auth print-pat
sidebar_label: ddn auth print-access-token
sidebar_position: 6
description: Prints the PAT to STDOUT using the DDN CLI
description: Prints the access token to STDOUT using the DDN CLI
keywords:
- hasura
- DDN
- docs
- CLI
- ddn auth print-pat
- ddn auth print-access-token
---

# DDN CLI: ddn auth print-pat
# DDN CLI: ddn auth print-access-token

Prints the PAT to STDOUT.
Prints the access token to STDOUT.

## Synopsis

Prints the PAT to STDOUT
Prints the access token to STDOUT

```bash
ddn auth print-pat [flags]
ddn auth print-access-token [flags]
```

**Alias:** pp
**Alias:** pp, print-pat

## Examples

```bash
# Print the PAT as a string to STDOUT
ddn auth print-pat
# Print the access token as a string to STDOUT
ddn auth print-access-token

# Print PAT as a JSON to STDOUT
ddn auth print-pat --out json
# Print access token as a JSON to STDOUT
ddn auth print-access-token --out json
```

## Options

```sass
-h, --help help for print-pat
-h, --help help for print-access-token
```

## Options inherited from parent operations
Expand Down
30 changes: 10 additions & 20 deletions docs/reference/cli/commands/ddn_codemod.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,16 @@ Perform transformations on your Hasura project directory

## Available operations

- [ddn codemod configure-header-forwarding](/reference/cli/commands/ddn_codemod_configure-header-forwarding) - Configure
headers to be forwarded to your connector
- [ddn codemod fix-traces-env-var](/reference/cli/commands/ddn_codemod_fix-traces-env-var) - Fix env var used for
configuring traces for connectors
- [ddn codemod rename-graphql-prefixes](/reference/cli/commands/ddn_codemod_rename-graphql-prefixes) - Rename GraphQL
root field and type name prefixes in metadata
- [ddn codemod upgrade-context-v2-to-v3](/reference/cli/commands/ddn_codemod_upgrade-context-v2-to-v3) - Upgrade
project's context config from v2 to v3
- [ddn codemod upgrade-graphqlconfig-aggregate](/reference/cli/commands/ddn_codemod_upgrade-graphqlconfig-aggregate) -
Upgrade GraphqlConfig to support aggregates
- [ddn codemod upgrade-graphqlconfig-subscriptions](/reference/cli/commands/ddn_codemod_upgrade-graphqlconfig-subscriptions) -
Upgrade GraphqlConfig to support subscriptions
- [ddn codemod upgrade-model-v1-to-v2](/reference/cli/commands/ddn_codemod_upgrade-model-v1-to-v2) - Upgrade model from
"version" "v1" to "v2" in metadata
- [ddn codemod upgrade-object-boolean-expression-types](/reference/cli/commands/ddn_codemod_upgrade-object-boolean-expression-types) -
Upgrade object boolean expression types metadata
- [ddn codemod upgrade-project-config-v2-to-v3](/reference/cli/commands/ddn_codemod_upgrade-project-config-v2-to-v3) -
Upgrade project directory from version v2 to v3
- [ddn codemod upgrade-supergraph-config-v1-to-v2](/reference/cli/commands/ddn_codemod_upgrade-supergraph-config-v1-to-v2) -
Upgrade all Supergraph config files at the root of the project directory from v1 to v2
- [ddn codemod configure-header-forwarding](/reference/cli/commands/ddn_codemod_configure-header-forwarding) - Configure headers to be forwarded to your connector
- [ddn codemod fix-traces-env-var](/reference/cli/commands/ddn_codemod_fix-traces-env-var) - Fix env var used for configuring traces for connectors
- [ddn codemod rename-graphql-prefixes](/reference/cli/commands/ddn_codemod_rename-graphql-prefixes) - Rename GraphQL root field and type name prefixes in metadata
- [ddn codemod upgrade-context-v2-to-v3](/reference/cli/commands/ddn_codemod_upgrade-context-v2-to-v3) - Upgrade project's context config from v2 to v3
- [ddn codemod upgrade-graphqlconfig-aggregate](/reference/cli/commands/ddn_codemod_upgrade-graphqlconfig-aggregate) - Upgrade GraphqlConfig to support aggregates
- [ddn codemod upgrade-graphqlconfig-subscriptions](/reference/cli/commands/ddn_codemod_upgrade-graphqlconfig-subscriptions) - Upgrade GraphqlConfig to support subscriptions
- [ddn codemod upgrade-model-v1-to-v2](/reference/cli/commands/ddn_codemod_upgrade-model-v1-to-v2) - Upgrade model from "version" "v1" to "v2" in metadata
- [ddn codemod upgrade-object-boolean-expression-types](/reference/cli/commands/ddn_codemod_upgrade-object-boolean-expression-types) - Upgrade object boolean expression types metadata
- [ddn codemod upgrade-project-config-v2-to-v3](/reference/cli/commands/ddn_codemod_upgrade-project-config-v2-to-v3) - Upgrade project directory from version v2 to v3
- [ddn codemod upgrade-supergraph-config-v1-to-v2](/reference/cli/commands/ddn_codemod_upgrade-supergraph-config-v1-to-v2) - Upgrade all Supergraph config files at the root of the project directory from v1 to v2

## Options

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ Rename GraphQL root field and type name prefixes in metadata.

## Synopsis

Rename GraphQL root field and type name prefixes in metadata. The from prefix will be stripped if provided, and the new
prefix will be added. If the new prefix is already present, it will not be reapplied.
Rename GraphQL root field and type name prefixes in metadata. The from prefix will be stripped if provided, and the new prefix will be added. If the new prefix is already present, it will not be reapplied.

By default, subgraph.yaml is updated with the new prefixes.

Expand Down
9 changes: 3 additions & 6 deletions docs/reference/cli/commands/ddn_command.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ Perform Command related operations
## Available operations

- [ddn command add](/reference/cli/commands/ddn_command_add) - Add new Commands to the local metadata
- [ddn command list](/reference/cli/commands/ddn_command_list) - Lists details about the functions/procedures of
DataConnectorLink, and their corresponding Commands
- [ddn command remove](/reference/cli/commands/ddn_command_remove) - Removes Commands (and related metadata) in the
local metadata
- [ddn command show](/reference/cli/commands/ddn_command_show) - Show diff between the command and its corresponding ndc
function/procedure
- [ddn command list](/reference/cli/commands/ddn_command_list) - Lists details about the functions/procedures of DataConnectorLink, and their corresponding Commands
- [ddn command remove](/reference/cli/commands/ddn_command_remove) - Removes Commands (and related metadata) in the local metadata
- [ddn command show](/reference/cli/commands/ddn_command_show) - Show diff between the command and its corresponding ndc function/procedure
- [ddn command update](/reference/cli/commands/ddn_command_update) - Update Commands in the local metadata

## Options
Expand Down
3 changes: 1 addition & 2 deletions docs/reference/cli/commands/ddn_command_list.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
sidebar_label: ddn command list
sidebar_position: 22
description:
Lists details about the functions/procedures of DataConnectorLink, and their corresponding Commands using the DDN CLI
description: Lists details about the functions/procedures of DataConnectorLink, and their corresponding Commands using the DDN CLI
keywords:
- hasura
- DDN
Expand Down
9 changes: 3 additions & 6 deletions docs/reference/cli/commands/ddn_connector-link.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@ Perform DataConnectorLink related operations
## Available operations

- [ddn connector-link add](/reference/cli/commands/ddn_connector-link_add) - Add a new DataConnectorLink to a Subgraph
- [ddn connector-link add-resources](/reference/cli/commands/ddn_connector-link_add-resources) - Add all models,
commands and relationships from a DataConnectorLink's schema
- [ddn connector-link remove](/reference/cli/commands/ddn_connector-link_remove) - Remove a DataConnectorLink from a
Subgraph
- [ddn connector-link add-resources](/reference/cli/commands/ddn_connector-link_add-resources) - Add all models, commands and relationships from a DataConnectorLink's schema
- [ddn connector-link remove](/reference/cli/commands/ddn_connector-link_remove) - Remove a DataConnectorLink from a Subgraph
- [ddn connector-link show](/reference/cli/commands/ddn_connector-link_show) - Show DataConnectorLink details
- [ddn connector-link update](/reference/cli/commands/ddn_connector-link_update) - Fetch NDC details from the Connector
and update the DataConnectorLink
- [ddn connector-link update](/reference/cli/commands/ddn_connector-link_update) - Fetch NDC details from the Connector and update the DataConnectorLink

## Options

Expand Down
9 changes: 3 additions & 6 deletions docs/reference/cli/commands/ddn_connector.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ Perform Connector related operations
- [ddn connector build](/reference/cli/commands/ddn_connector_build) - Perform ConnectorBuild related operations
- [ddn connector env](/reference/cli/commands/ddn_connector_env) - Manage environment variables for Connectors
- [ddn connector init](/reference/cli/commands/ddn_connector_init) - Add a new Connector
- [ddn connector introspect](/reference/cli/commands/ddn_connector_introspect) - Introspect the Connector data source to
update the Connector configuration
- [ddn connector introspect](/reference/cli/commands/ddn_connector_introspect) - Introspect the Connector data source to update the Connector configuration
- [ddn connector plugin](/reference/cli/commands/ddn_connector_plugin) - Run a subcommand from a Connector plugin
- [ddn connector remove](/reference/cli/commands/ddn_connector_remove) - Remove a Connector, its corresponding
DataConnectorLink and all its associated metadata objects
- [ddn connector setenv](/reference/cli/commands/ddn_connector_setenv) - Run specified command with environment
variables set
- [ddn connector remove](/reference/cli/commands/ddn_connector_remove) - Remove a Connector, its corresponding DataConnectorLink and all its associated metadata objects
- [ddn connector setenv](/reference/cli/commands/ddn_connector_setenv) - Run specified command with environment variables set
- [ddn connector show-resources](/reference/cli/commands/ddn_connector_show-resources) - Show resources of a Connector

## Options
Expand Down
12 changes: 4 additions & 8 deletions docs/reference/cli/commands/ddn_connector_build.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,10 @@ Perform ConnectorBuild related operations

## Available operations

- [ddn connector build create](/reference/cli/commands/ddn_connector_build_create) - Create a ConnectorBuild on Hasura
DDN
- [ddn connector build delete](/reference/cli/commands/ddn_connector_build_delete) - Delete a ConnectorBuild from a
Project
- [ddn connector build get](/reference/cli/commands/ddn_connector_build_get) - List ConnectorBuilds or get details of a
specific one from Hasura DDN
- [ddn connector build logs](/reference/cli/commands/ddn_connector_build_logs) - Get logs of a ConnectorBuild from
Hasura DDN
- [ddn connector build create](/reference/cli/commands/ddn_connector_build_create) - Create a ConnectorBuild on Hasura DDN
- [ddn connector build delete](/reference/cli/commands/ddn_connector_build_delete) - Delete a ConnectorBuild from a Project
- [ddn connector build get](/reference/cli/commands/ddn_connector_build_get) - List ConnectorBuilds or get details of a specific one from Hasura DDN
- [ddn connector build logs](/reference/cli/commands/ddn_connector_build_logs) - Get logs of a ConnectorBuild from Hasura DDN

## Options

Expand Down
3 changes: 1 addition & 2 deletions docs/reference/cli/commands/ddn_connector_env.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ Manage environment variables for Connectors

## Available operations

- [ddn connector env add](/reference/cli/commands/ddn_connector_env_add) - Add environment variables and its
corresponding mapping to a Connector
- [ddn connector env add](/reference/cli/commands/ddn_connector_env_add) - Add environment variables and its corresponding mapping to a Connector

## Options

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/cli/commands/ddn_connector_init.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ddn connector init [connector-name] --hub-connector <connector-type> [flags]
ddn connector init mydb --dir ./connector --hub-connector hasura/postgres

# Initialize a NodeJS Connector "mylambda" in the Subgraph "app" on port 8765
ddn connector init mylambda --subgraph ./app/subgraph.yaml --hub-connector hasura/nodejs --configure-port 8765
ddn connector init mylambda --subgraph ./app/subgraph.yaml --hub-connector hasura/nodejs --configure-port 8765
```

## Options
Expand Down
3 changes: 1 addition & 2 deletions docs/reference/cli/commands/ddn_connector_remove.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
sidebar_label: ddn connector remove
sidebar_position: 37
description:
Remove a Connector, its corresponding DataConnectorLink and all its associated metadata objects using the DDN CLI
description: Remove a Connector, its corresponding DataConnectorLink and all its associated metadata objects using the DDN CLI
keywords:
- hasura
- DDN
Expand Down
Loading

0 comments on commit 3ff6ba7

Please sign in to comment.