GraphQL Engine server config reference
Introduction
Every GraphQL engine command is structured as:
$ graphql-engine <server-flags> serve <command-flags>
The flags can be passed as environment variables as well.
graphql-engine command flags / environment variables
For the graphql-engine
command these are the available flags and environment variables:
Flag and ENV Variable | Details |
---|---|
Flag:
ENV variable:
| Postgres database URL:
Example:
|
Flag:
ENV variable:
| Postgres database URL that will be used to store the Hasura metadata. By default the database configured using
Postgres database URL:
Example:
(Available for versions > v2.0.0) |
Or you can specify the following options (only via flags):
--host Postgres server host
-p, --port Postgres server port
-u, --user Database user name
-p, --password Password of the user
-d, --dbname Database name to connect to
-o, --pg-connection-options PostgreSQL connection options
The default configuration of PostgreSQL 11 and older may result in loss of precision when retrieving IEEE 754 style
data, such as float4
, real
or double precision
values, from the database. To avoid this, set the
extra_float_digits
PostgreSQL connection parameter to 3. This can be done by passing
'--pg-connection-options=-c extra_float_digits=3'
to graphql-engine
, or by passing this option as part of the
database url:
postgres://admin:mypass@mydomain.com:5432/mydb?options=-c%20extra_float_digits%3D3
serve sub-command flags / environment variables
For the serve
sub-command the table below contains the available flags and environment variables. For those available
only on Hasura EE, reference this table at the bottom of the page.
Flag and ENV Variable | Details |
---|---|
Flag:
ENV variable:
| Enables including 'internal' information in an error response for requests made by an 'admin' (default: (Available for versions > v1.2.0) |
Flag:
ENV variable:
| Admin secret key, required to access this instance. This is mandatory when you use webhook or JWT. |
Flag:
ENV variable:
| Interval in milliseconds to sleep before trying to fetch async actions again after a fetch returned no async actions
from metadata storage. Value (Available for versions > v2.0.0) |
Flag:
ENV variable:
| URL of the authorization webhook required to authorize requests. See auth webhooks docs for more details. |
Flag:
ENV variable:
| HTTP method to use for the authorization webhook. (default: |
Flag:
ENV variable:
| Maximum number of Postgres connections that can be opened per stripe (default: (Deprecated in versions > v2.0.0. See details) |
Flag:
ENV variable:
| Time from connection creation after which the connection should be destroyed and a new one created. A value of (Deprecated in versions > v2.0.0. See details) |
Flag:
ENV variable:
| Set the value to |
Flag:
ENV variable:
| CSV of list of domains, including scheme (http/https) and port, to allow for CORS. Wildcard domains are allowed. (See Configure CORS) |
Flag:
ENV variable:
| The schema in which Hasura can install extensions in the metadata database. Default: |
Flag:
ENV variable:
| Set dev mode for GraphQL requests; include the (Available for versions > v1.2.0) |
Flag:
ENV variable:
| Disable CORS. Do not send any CORS headers on any request. |
Flag:
ENV variable:
| Restrict queries allowed to be executed by the GraphQL engine to those that are part of the configured allow-list.
Default: |
Flag:
ENV variable:
| Enable the Hasura Console (served by the server on |
Flag:
ENV variable:
| Enable sending compressed logs to metrics server. |
Flag:
ENV variable:
| Disable updating of metadata on the server. (default: (Available for versions > v2.0.0) |
Flag:
ENV variable:
| Enables the query field in http-logs for metadata queries. (default: |
Flag:
ENV variable:
| Enable remote schema permissions. (default: (Available for versions > v2.0.0) |
Flag:
ENV variable:
| Enable anonymous telemetry. (default: |
Flag:
ENV variable:
| Comma separated list of APIs (options: |
Flag:
ENV variable:
| Set the enabled log types. This is a comma-separated list of log-types to enable. Default:
|
Flag:
ENV variable:
| Max event processing threads. (default: |
Flag:
ENV variable:
| Maximum number of events to be fetched from the DB in a single batch. (default: (Available for versions > v2.0.0) |
Flag:
ENV variable:
| Interval in milliseconds to sleep before trying to fetch events again after a fetch returned no events from postgres. |
Flag:
ENV variable:
| List of experimental features to be enabled. A comma separated value is expected. Options: (Available for versions > v2.0.0) |
Flag:
ENV variable:
| Timeout (in seconds) to wait for the in-flight events (event triggers and scheduled triggers) and async actions to
complete before the server shuts down completely (default: (Available for versions > v2.0.0) |
Flag:
ENV variable:
| Transaction isolation. read-committed / repeatable-read / serializable (default: read-committed) (Deprecated in versions > v2.0.0. See details) |
Flag:
ENV variable:
| When the (Available for versions > v2.0.0) |
Flag:
ENV variable:
| A JSON string containing type and the JWK used for verifying (and other optional details). Example:
|
Flag:
ENV variable:
| Multiplexed live queries are split into batches of the specified size. Default: |
Flag:
ENV variable:
| Updated results (if any) will be sent at most once in this interval (in milliseconds) for live queries which can be
multiplexed. Default: |
Flag:
ENV variable:
| Set the logging level. Default: |
Flag:
ENV variable:
| How long to wait when acquiring a Postgres connection, in seconds. (default: forever) |
Flag:
ENV variable:
| The maximum number of query plans that can be cached, allowed values: 0-65535, 0 disables the cache. (Default: 4000) (Deprecated in versions > v2.0.0. See details) |
Flag:
ENV variable:
| Number of retries if Postgres connection error occurs. (default: (Deprecated in versions > v2.0.0. See details) |
Flag:
ENV variable:
| Number of stripes (distinct sub-pools) to maintain with Postgres (default: (Deprecated in versions > v2.0.0. See details) |
Flag:
ENV variable:
| Interval to poll metadata storage for updates in milliseconds. Default: (Available for versions > v2.0.0) |
Flag:
ENV variable:
| Host on which graphql-engine will listen (default: |
Flag:
ENV variable:
| Port on which graphql-engine should be served (default: |
Flag:
ENV variable:
| Multiplexed streaming queries are split into batches of the specified size. (Default: |
Flag:
ENV variable:
| Updated results (if any) will be sent at most once in this interval (in milliseconds) for streaming queries which can be
multiplexed. (Default: |
Flag:
ENV variable:
| Stringify certain Postgres numeric types, specifically |
Flag:
ENV variable:
| Each connection's idle time before it is closed (default: (Deprecated in versions > v2.0.0. See details) |
Flag:
ENV variable:
| Unauthorized role, used when access-key is not sent in access-key only mode or the |
Flag:
ENV variable:
| Use prepared statements for queries. (default: (Deprecated in versions > v2.0.0. See details) |
Flag:
ENV variable:
| Enable WebSocket permessage-deflate compression. (default: (Available for versions > v2.0.0) |
Flag:
ENV variable:
| Used to set the connection initialisation timeout for |
Flag:
ENV variable:
| Used to set the (Available for versions > v2.0.0) |
Flag:
ENV variable:
| Read cookie on WebSocket initial handshake even when CORS is disabled. This can be a potential security flaw! Please
make sure you know what you're doing. This configuration is only applicable when CORS is disabled. (default: |
Flag:
ENV variable:
| Maximum number of concurrent http workers delivering events at any time. (default: |
Flag:
ENV variable:
| Interval in milliseconds to sleep before trying to fetch events again after a fetch returned no events from postgres. (default: |
Flag:
ENV variable:
| Evaluate |
Flag:
ENV variable:
| Used to set the default naming convention for all sources. See naming convention for more information. (default: |
When the equivalent flags for environment variables are used, the flags will take precedence.
Hasura EE sub-command flags / environment variables
The following serve
sub-commands are available only on Hasura EE.
Flag and ENV Variable | Details |
---|---|
Flag:
ENV variable:
| A list of valid admin secret keys. |
Flag:
ENV variable:
| Maximum number of Postgres connections per read-replica that can be opened per stripe (default: |
Flag:
ENV variable:
| A JSON array of objects containing type and the JWK used for verifying. e.g:
|
Flag:
ENV variable:
| Maximum cache size in MB. (Default: 1 MB) |
Flag:
ENV variable:
| Path for storage of postgres SSL certificates when set via environment variable reference. |
Flag:
ENV variable:
| The pro endpoint for authorization and collect metrics. |
Flag:
ENV variable:
| The pro key that you have received. |
Flag:
ENV variable:
| Hostname to use for SNI when connecting to rate-limiting Redis instance over TLS. |
Flag:
ENV variable:
| Redis URL in the form |
Flag:
ENV variable:
| Whether or not to use TLS to connect to caching Redis instance. |
Flag:
ENV variable:
| URL for a read replica of the database. |
Flag:
ENV variable:
| Hostname to use for SNI when connecting to caching Redis instance over TLS. |
Flag:
ENV variable:
| Path to shared CA store to use to connect to both (caching and rate-limiting) Redis URLs over TLS. |
Flag:
ENV variable:
| Redis URL in the form |
Flag:
ENV variable:
| Number of stripes (connection pools) to maintain per read replica. (Deprecated in versions > v2.0.0. See details) |