0

I installed hasura CLI and I want to send data on my hasura cloud project. I tried different ways to launch hasura console but I don't find the good way to launch it. Every time I have the same error and I don't know how to solve it.

You can see my Hasura CLI config file in my project and the error.

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[0002] making http request failed: Get "http://localhost:8080/healthz": dial tcp [::1]:8080: connect: connection refused

HasuraCLI error

ConfigFile Hasura

Thanks

David Leuliette
  • 1,595
  • 18
  • 26
  • Are you sure the Hasura server is running at localhost:8080? Since you mentioned you wanted to use Hasura Cloud project, can you pass the project URL as the endpoint. For example: `hasura console --endpoint https://myapp.hasura.app --admin-secret xxxx` and try it out. – praveenweb Feb 02 '22 at 08:31
  • yes i try this solution from my terminal and in the file config.yaml but still the same error. When I launch the project, I have this error : ```x-hasura-admin-secret/x-hasura-access-key required, but not found``` But my key is in my file – Matthys Ducrocq Feb 02 '22 at 10:12

2 Answers2

0

resolved :

When we use apollo client, we need to set the header in the client like this :


const client = new ApolloClient({
  uri: "https://yourapp.hasura.app/v1/graphql",
  cache: new InMemoryCache(),
  headers: {
    "content-type": "application/json",
    "x-hasura-admin-secret":
      "",
  },
});

this fix my problem

  • That does not answer the question at all. You figured out how to use apollo but you did not figure out how to start the console. – Friedrich Apr 19 '22 at 12:04
0

I Had two versions of hasura-cli, one installed with curl and one installed with npm.

I resolve the problem by removing all the version and installing the hasura-cli with npm and restarting the system

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 14 '22 at 11:36