Search code examples
hasurahasura-docker

Hasura anonymus role permission, API not exposed


I am using Hasura for a project. When I give permission for the public (API exposed for everybody), then no API is exposed in the API section of Hasura. In this case I only X-Hasura-Role public in headers. enter image description here

But all APIs for role public are exposed when I add x-hasura-admin-secret. For the role public, x-hasura-admin-secret should not be needed. I don't understand what's wrong is doing there?

enter image description here


Solution

  • Add HASURA_GRAPHQL_UNAUTHORIZED_ROLE as public in .env environment. If you use Hasura cloud then add it Hasura Env Vars section.