hasura / hasura/graphql-engine

Add --envfile support for hasura metadata commands

Open
#9,850 0 comments 0 reactions 0 assignees View on GitHub
k/bug
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version: v2.30.1
CLI Version (for CLI related issue): v2.26.0

### Environment

MacOS

### What is the current behaviour?

staging.env
```
HASURA_GRAPHQL_ADMIN_SECRET=supersecretpassword
HASURA_GRAPHQL_ENDPOINT=https://graphql.staging.acme.com
```

zsh
```
$ hasura metadata export --envfile staging.env
ERRO connecting to graphql-engine server failed
INFO possible reasons:
INFO 1) Provided root endpoint of graphql-engine server is wrong. Verify endpoint key in config.yaml or/and value of --endpoint flag
INFO 2) Endpoint should NOT be your GraphQL API, ie endpoint is NOT https://hasura-cloud-app.io/v1/graphql it should be: https://hasura-cloud-app.io
INFO 3) Server might be unhealthy and is not running/accepting API requests
INFO 4) Admin secret is not correct/set
INFO
FATA[0000] making http request failed: Get "http://localhost:8080/hasura/v1/version": dial tcp [::1]:8080: connect: connection refused
```

### What is the expected behaviour?

It should not fail.

### How to reproduce the issue?

1. Run it

### Any possible solutions/workarounds you're aware of?

No

Contributor guide

Open the contributing guide

Research direction

Start with the Hasura CLI handling for `metadata export` and its `--envfile` option, using the provided `staging.env` reproduction. Verify that the metadata command reads the endpoint and admin secret from the env file instead of falling back to localhost; done means the command connects successfully with those values.

Written by the indexing model from the issue text.

Assessment

Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.