GraphQL engine server flags reference ===================================== .. contents:: Table of contents :backlinks: none :depth: 1 :local: Every GraphQL engine command is structured as: .. code-block:: bash $ graphql-engine serve The flags can be passed as ENV variables as well. Server flags ^^^^^^^^^^^^ For ``graphql-engine`` command these are the flags and ENV variables available: .. list-table:: :header-rows: 1 * - Flag - ENV variable - Description * - ``--database-url `` - ``HASURA_GRAPHQL_DATABASE_URL`` - Postgres database URL: ``postgres://:@:/`` Example: ``postgres://admin:mypass@mydomain.com:5432/mydb`` Or you can specify following options *(only via flags)* .. code-block:: none --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 Command flags ^^^^^^^^^^^^^ For ``serve`` sub-command these are the flags and ENV variables available: .. list-table:: :header-rows: 1 * - Flag - ENV variable - Description * - ``--server-port `` - ``HASURA_GRAPHQL_SERVER_PORT`` - Port on which graphql-engine should be served (default: 8080) * - ``--server-host `` - ``HASURA_GRAPHQL_SERVER_HOST`` - Host on which graphql-engine will listen (default: ``*``) * - ``--enable-console `` - ``HASURA_GRAPHQL_ENABLE_CONSOLE`` - Enable the Hasura Console (served by the server on ``/`` and ``/console``) * - ``--admin-secret `` - ``HASURA_GRAPHQL_ADMIN_SECRET`` - Admin secret key, required to access this instance. This is mandatory when you use webhook or JWT. * - ``--auth-hook `` - ``HASURA_GRAPHQL_AUTH_HOOK`` - URL of the authorization webhook required to authorize requests. See auth webhooks docs for more details. * - ``--auth-hook-mode `` - ``HASURA_GRAPHQL_AUTH_HOOK_MODE`` - HTTP method to use for the authorization webhook (default: GET) * - ``--jwt-secret `` - ``HASURA_GRAPHQL_JWT_SECRET`` - A JSON string containing type and the JWK used for verifying (and other optional details). Example: ``{"type": "HS256", "key": "3bd561c37d214b4496d09049fadc542c"}``. See the JWT docs for more details. * - ``--unauthorized-role `` - ``HASURA_GRAPHQL_UNAUTHORIZED_ROLE`` - Unauthorized role, used when access-key is not sent in access-key only mode or "Authorization" header is absent in JWT mode. Example: ``anonymous``. Now whenever "Authorization" header is absent, request's role will default to "anonymous". * - ``--cors-domain `` - ``HASURA_GRAPHQL_CORS_DOMAIN`` - CSV of list of domains, excluding scheme (http/https) and including port, to allow CORS for. Wildcard domains are allowed. * - ``--disable-cors`` - N/A - Disable CORS. Do not send any CORS headers on any request. * - ``--ws-read-cookie `` - ``HASURA_GRAPHQL_WS_READ_COOKIE`` - 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: false) * - ``--enable-telemetry `` - ``HASURA_GRAPHQL_ENABLE_TELEMETRY`` - Enable anonymous telemetry (default: true) * - N/A - ``HASURA_GRAPHQL_EVENTS_HTTP_POOL_SIZE`` - Max event threads * - N/A - ``HASURA_GRAPHQL_EVENTS_FETCH_INTERVAL`` - Postgres events polling interval * - ``-s, --stripes `` - ``HASURA_GRAPHQL_PG_STRIPES`` - Number of conns that need to be opened to Postgres (default: 1) * - ``-c, --connections `` - ``HASURA_GRAPHQL_PG_CONNECTIONS`` - Number of conns that need to be opened to Postgres (default: 50) * - ``--timeout `` - ``HASURA_GRAPHQL_PG_TIMEOUT`` - Each connection's idle time before it is closed (default: 180 sec) * - ``--use-prepared-statements `` - ``HASURA_GRAPHQL_USE_PREPARED_STATEMENTS`` - Use prepared statements for queries (default: true) * - ``-i, --tx-iso `` - ``HASURA_GRAPHQL_TX_ISOLATION`` - transaction isolation. read-committed / repeatable-read / serializable (default: read-commited) * - ``--stringify-numeric-types`` - ``HASURA_GRAPHQL_STRINGIFY_NUMERIC_TYPES`` - Stringify certain Postgres numeric types, specifically ``bigint``, ``numeric``, ``decimal`` and ``double precision`` as they don't fit into the ``IEEE-754`` spec for JSON encoding-decoding. (default: false) * - ``--enabled-apis `` - ``HASURA_GRAPHQL_ENABLED_APIS`` - Comma separated list of APIs (options: ``metadata``, ``graphql``, ``pgdump``) to be enabled. (default: ``metadata,graphql,pgdump``) .. note:: When the equivalent flags for environment variables are used, the flags will take precedence.