ANONYMOUS ACCESS TO HASURA DATA

To access Hasura contents without requiring authorisation of the user. In other words presenting Hasura DB contents on public pages.

This is done via Hasura's "Authorization / Acess Control" configurations and by adding the "anonymous" user role.

See : Hasura: Access Control Examples - Anonymous (not logged in) users

  • Create a role called anonymous (this value is up to you, you could even name the role public).

  • Generally, you wouldn’t add insert, update, or delete permissions.

  • For the select permission condition, create a valid condition depending on your data model. For example, is_published: {_eq: true}.

  • If you don’t have a condition, then just set the permission to Without any checks, represented by a {}.

  • Choose the right set of columns that will get exposed in the GraphQL schema as fields. Ensure that sensitive information will not be exposed.