hasura / hasura/graphql-engine

Improve CLI and .env naming of HASURA_GRAPHQL_ENDPOINT

Open
#8,031 3 comments 0 reactions 0 assignees View on GitHub
c/cli k/enhancement t/product-platform
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

Wherever the CLI takes "endpoint" arguments like `--endpoint` or the `HASURA_GRAPHQL_ENDPOINT` in `.env` it would be nice to somehow make it clear that the endpoint is the Hasura graphql engine endpoint without the `v1/graphql` piece.

Some alternative ideas:
1. perhaps we just build in an improvement where the CLI can try again by trying to strip the `v1/graphql` endpoint?
2. Improve our endpoint error messages everywhere to suggest that this should just be endpoint without the graphql piece, or point to docs on how to construct the endpoint

This would prevent errors like this:

```
$ hasura metadata export --endpoint https://localhost:8080/v1/graphql

FATA[0001] {
"path": "$",
"error": "resource does not exist",
"code": "not-found"
}

```

Just a minor thing but would go a long way in DX delight <3

Contributor guide

Open the contributing guide

Research direction

Start by tracing the CLI paths that accept --endpoint and the .env handling for HASURA_GRAPHQL_ENDPOINT. Compare how endpoint errors are produced across the affected commands, then clarify with maintainers which proposed behavior is wanted. Done should include an agreed endpoint convention and consistent guidance or handling in the relevant paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, cli, developer-experience
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.