2018-09-11 14:11:24 +03:00
|
|
|
GraphQL engine server flags reference
|
|
|
|
=====================================
|
|
|
|
|
2018-12-03 15:12:24 +03:00
|
|
|
.. contents:: Table of contents
|
|
|
|
:backlinks: none
|
|
|
|
:depth: 1
|
|
|
|
:local:
|
|
|
|
|
2018-09-11 14:11:24 +03:00
|
|
|
Every GraphQL engine command is structured as:
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
2018-10-26 05:59:36 +03:00
|
|
|
$ graphql-engine <server-flags> serve <command-flags>
|
2018-09-11 14:11:24 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
The flags can be passed as ENV variables as well.
|
|
|
|
|
2018-09-11 14:11:24 +03:00
|
|
|
Server flags
|
|
|
|
^^^^^^^^^^^^
|
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
For ``graphql-engine`` command these are the flags and ENV variables available:
|
2018-09-11 14:11:24 +03:00
|
|
|
|
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
.. list-table::
|
|
|
|
:header-rows: 1
|
|
|
|
|
|
|
|
* - Flag
|
|
|
|
- ENV variable
|
|
|
|
- Description
|
|
|
|
|
|
|
|
* - ``--database-url <DB_URL>``
|
|
|
|
- ``HASURA_GRAPHQL_DATABASE_URL``
|
|
|
|
- Postgres database URL:
|
2018-09-11 14:11:24 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
``postgres://<user>:<password>@<host>:<port>/<db-name>``
|
|
|
|
|
|
|
|
Example: ``postgres://admin:mypass@mydomain.com:5432/mydb``
|
|
|
|
|
|
|
|
Or you can specify following options *(only via flags)*
|
2018-11-29 13:30:26 +03:00
|
|
|
|
|
|
|
.. code-block:: none
|
2018-09-11 14:11:24 +03:00
|
|
|
|
|
|
|
--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
|
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
|
2018-09-11 14:11:24 +03:00
|
|
|
Command flags
|
|
|
|
^^^^^^^^^^^^^
|
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
For ``serve`` sub-command these are the flags and ENV variables available:
|
2018-12-03 14:19:08 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
.. list-table::
|
|
|
|
:header-rows: 1
|
2018-12-03 14:19:08 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
* - Flag
|
|
|
|
- ENV variable
|
|
|
|
- Description
|
2018-12-03 14:19:08 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
* - ``--server-port <PORT>``
|
|
|
|
- ``HASURA_GRAPHQL_SERVER_PORT``
|
|
|
|
- Port on which graphql-engine should be served (default: 8080)
|
2018-12-03 14:19:08 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
* - ``--server-host <HOST>``
|
|
|
|
- ``HASURA_GRAPHQL_SERVER_HOST``
|
|
|
|
- Host on which graphql-engine will listen (default: ``*``)
|
2018-12-03 14:19:08 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
* - ``--enable-console <true|false>``
|
|
|
|
- ``HASURA_GRAPHQL_ENABLE_CONSOLE``
|
|
|
|
- Enable the Hasura Console (served by the server on ``/`` and ``/console``)
|
2018-12-03 14:19:08 +03:00
|
|
|
|
2019-02-14 14:14:25 +03:00
|
|
|
* - ``--admin-secret <ADMIN_SECRET_KEY>``
|
|
|
|
- ``HASURA_GRAPHQL_ADMIN_SECRET``
|
|
|
|
- Admin secret key, required to access this instance. This is mandatory
|
2019-02-14 08:58:38 +03:00
|
|
|
when you use webhook or JWT.
|
2019-01-11 14:07:13 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
* - ``--auth-hook <WEBHOOK_URL>``
|
|
|
|
- ``HASURA_GRAPHQL_AUTH_HOOK``
|
|
|
|
- URL of the authorization webhook required to authorize requests.
|
|
|
|
See auth webhooks docs for more details.
|
2019-01-18 17:20:41 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
* - ``--auth-hook-mode <GET|POST>``
|
|
|
|
- ``HASURA_GRAPHQL_AUTH_HOOK_MODE``
|
|
|
|
- HTTP method to use for the authorization webhook (default: GET)
|
2018-09-11 14:11:24 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
* - ``--jwt-secret <JSON_CONFIG>``
|
|
|
|
- ``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.
|
2019-01-28 16:55:28 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
* - ``--unauthorized-role <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".
|
2018-09-11 14:11:24 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
* - ``--cors-domain <DOMAINS>``
|
|
|
|
- ``HASURA_GRAPHQL_CORS_DOMAIN``
|
|
|
|
- CSV of list of domains, excluding scheme (http/https) and including port,
|
|
|
|
to allow CORS for. Wildcard domains are allowed.
|
2018-09-11 14:11:24 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
* - ``--disable-cors``
|
|
|
|
- N/A
|
|
|
|
- Disable CORS. Do not send any CORS headers on any request.
|
2018-09-11 14:11:24 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
* - ``--enable-telemetry <true|false>``
|
|
|
|
- ``HASURA_GRAPHQL_ENABLE_TELEMETRY``
|
|
|
|
- Enable anonymous telemetry (default: true)
|
2018-12-14 06:21:41 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
* - N/A
|
|
|
|
- ``HASURA_GRAPHQL_EVENTS_HTTP_POOL_SIZE``
|
|
|
|
- Max event threads
|
2019-01-18 17:20:41 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
* - N/A
|
|
|
|
- ``HASURA_GRAPHQL_EVENTS_FETCH_INTERVAL``
|
|
|
|
- Postgres events polling interval
|
2018-12-14 06:21:41 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
* - ``-s, --stripes <NO_OF_STRIPES>``
|
|
|
|
- ``HASURA_GRAPHQL_PG_STRIPES``
|
|
|
|
- Number of conns that need to be opened to Postgres (default: 1)
|
2018-12-14 06:21:41 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
* - ``-c, --connections <NO_OF_CONNS>``
|
|
|
|
- ``HASURA_GRAPHQL_PG_CONNECTIONS``
|
|
|
|
- Number of conns that need to be opened to Postgres (default: 50)
|
2018-11-29 13:30:26 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
* - ``--timeout <SECONDS>``
|
|
|
|
- ``HASURA_GRAPHQL_PG_TIMEOUT``
|
|
|
|
- Each connection's idle time before it is closed (default: 180 sec)
|
2018-11-29 13:30:26 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
* - ``--use-prepared-statements <true|false>``
|
|
|
|
- ``HASURA_GRAPHQL_USE_PREPARED_STATEMENTS``
|
|
|
|
- Use prepared statements for queries (default: true)
|
2018-09-11 14:11:24 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
* - ``-i, --tx-iso <TXISO>``
|
|
|
|
- ``HASURA_GRAPHQL_TX_ISOLATION``
|
|
|
|
- transaction isolation. read-committed / repeatable-read / serializable (default: read-commited)
|
2018-09-11 14:11:24 +03:00
|
|
|
|
2019-02-28 16:53:03 +03:00
|
|
|
* - ``--enabled-apis <APIS>``
|
|
|
|
- ``HASURA_GRAPHQL_ENABLED_APIS``
|
|
|
|
- Comma separated list of APIs (metadata & graphql) to be enabled. (default: ``metadata,graphql``)
|
2018-09-11 14:11:24 +03:00
|
|
|
|
2019-02-14 08:58:38 +03:00
|
|
|
.. note::
|
2019-02-14 12:37:47 +03:00
|
|
|
When the equivalent flags for environment variables are used, the flags will take precedence.
|