0

I am not able to send a POST request to my Hasura endpoint from my Flutter client and even from POSTMAN.

Here is my current error:

{"errors":[{"extensions":{"path":"$","code":"invalid-json"},"message":"Error in $: not enough input"}]}

I added endpoint my_endpoint/v1/graphql and HASURA_GRAPHQL_ADMIN_SECRET which I set in Heroku dashboard. ( This value now shows up on my deployed herokuapp console)

My client is using ferry-graphql like this

Client initClient(String url, String secret) {
  final link = HttpLink(
    url,
    defaultHeaders: {
      'x-hasura-admin-secret': secret,
    },
  );
  final cache = Cache();

  final client = Client(
    link: link,
    cache: cache,
  );
  return client;
}

I am not sure what else I should add for my client request header to access hasura.

husky
  • 831
  • 3
  • 10
  • 24

1 Answers1

0

Something like this might help you: https://github.com/gql-dart/ferry/issues/95#issuecomment-848735562

Wikki
  • 590
  • 3
  • 7
  • 26