How to access hasura graphql interface?

103 Views Asked by At

I'd like to access the graphql interface of hasura directly (without going through the hasura admin dashboard). In the admin dashboard I see the following

enter image description here

When I try to navigate to that url I get the following error message

{"errors":[{"message":"PersistedQueryNotSupported","extensions":{"path":"$","code":"not-supported"}}]}

enter image description here

I've tried clearing my browser cache and doing a hard reload but that doesn't seem to help.

I'm running hasura/graphql-engine:v2.36.0 in docker with the following env vars

      HASURA_GRAPHQL_DATABASE_URL: <postgres uri>
      HASURA_GRAPHQL_ENABLE_CONSOLE: "true"
      HASURA_GRAPHQL_DEV_MODE: "true"
      HASURA_GRAPHQL_PG_CONNECTIONS: 2

How can I properly configure hasura so that the graphql interface is accessible on it's own without having to go through the admin dashboard?

1

There are 1 best solutions below

0
vitaliytv On

Enable persisted queries using the environment variable HASURA_GRAPHQL_ENABLE_PERSISTED_QUERIES (--enable-persisted-queries) to true (default: false), and the query TTL in the cache store can be set using the environment variable HASURA_GRAPHQL_PERSISTED_QUERIES_TTL (--persisted-queries-ttl).

This feature is available in EE version of Hasura only.

https://github.com/hasura/graphql-engine/issues/273#issuecomment-1870091054