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
|
|
|
|
|
|
|
Server flags
|
|
|
|
^^^^^^^^^^^^
|
|
|
|
|
|
|
|
For ``graphql-engine`` command these are the flags available
|
|
|
|
|
|
|
|
.. code-block:: none
|
|
|
|
|
|
|
|
--database-url Postgres database URL
|
|
|
|
<postgres/postgresql>://<user>:<password>@<host>:<port>/<db-name>
|
|
|
|
Example: postgres://admin:mypass@mydomain.com:5432/mydb
|
|
|
|
|
2018-11-29 13:30:26 +03:00
|
|
|
Or either you can specify following options
|
|
|
|
|
|
|
|
.. 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
|
|
|
|
|
|
|
|
Command flags
|
|
|
|
^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
For ``serve`` subcommand these are the flags available
|
|
|
|
|
|
|
|
.. code-block:: none
|
|
|
|
|
2018-12-03 14:19:08 +03:00
|
|
|
--server-port Port on which graphql-engine should be served (default: 8080)
|
|
|
|
|
|
|
|
--access-key Secret access key, required to access this instance.
|
|
|
|
If specified client needs to send 'X-Hasura-Access-Key'
|
|
|
|
header
|
|
|
|
|
|
|
|
--cors-domain The domain, including sheme and port, to allow CORS for
|
|
|
|
|
|
|
|
--disable-cors Disable CORS handling
|
|
|
|
|
|
|
|
--auth-hook The authentication webhook, required to authenticate
|
|
|
|
incoming request
|
|
|
|
|
|
|
|
--auth-hook-mode The authentication webhook mode. GET|POST (default: GET)
|
|
|
|
|
|
|
|
--jwt-secret The JSON containing type and the JWK used for
|
|
|
|
verifying. e.g: `{"type": "HS256", "key":
|
|
|
|
"<your-hmac-shared-secret>"}`,`{"type": "RS256",
|
|
|
|
"key": "<your-PEM-RSA-public-key>"}
|
|
|
|
|
|
|
|
--unauthorized-role Unauthorized role, used when access-key is not sent in
|
|
|
|
access-key only mode or "Authorization" header is absent
|
|
|
|
in JWT mode
|
|
|
|
|
2018-12-14 06:21:41 +03:00
|
|
|
-s, --stripes Number of stripes (default: 1)
|
2018-12-03 14:19:08 +03:00
|
|
|
|
|
|
|
-c, --connections Number of connections that need to be opened to Postgres
|
2018-12-14 06:21:41 +03:00
|
|
|
(default: 50)
|
2018-12-03 14:19:08 +03:00
|
|
|
|
|
|
|
--timeout Each connection's idle time before it is closed
|
2018-12-14 06:21:41 +03:00
|
|
|
(default: 180 sec)
|
2018-12-03 14:19:08 +03:00
|
|
|
|
|
|
|
-i, --tx-iso Transaction isolation. read-commited / repeatable-read /
|
|
|
|
serializable
|
|
|
|
|
|
|
|
--enable-console Enable API console. It is served at '/' and '/console'
|
2018-09-11 14:11:24 +03:00
|
|
|
|
|
|
|
|
|
|
|
Default environment variables
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
You can use environment variables to configure defaults instead of using flags:
|
|
|
|
|
2018-10-25 21:16:25 +03:00
|
|
|
.. note::
|
|
|
|
When the equivalent flags for environment variables are used, the flags will take precedence.
|
|
|
|
|
2018-09-11 14:11:24 +03:00
|
|
|
For example:
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
2018-10-25 21:16:25 +03:00
|
|
|
$ HASURA_GRAPHQL_DATABASE_URL=postgres://user:pass@host:5432/dbname graphql-engine serve
|
2018-09-11 14:11:24 +03:00
|
|
|
|
|
|
|
|
|
|
|
These are the environment variables which are available:
|
|
|
|
|
|
|
|
.. code-block:: none
|
|
|
|
|
2018-12-03 14:19:08 +03:00
|
|
|
HASURA_GRAPHQL_DATABASE_URL Postgres database URL
|
|
|
|
<postgres/postgresql>://<user>:<password>@<host>:
|
|
|
|
<port>/<db-name> Example:
|
|
|
|
postgres://admin:mypass@mydomain.com:5432/mydb
|
|
|
|
|
2018-12-14 06:21:41 +03:00
|
|
|
HASURA_GRAPHQL_PG_STRIPES Number of stripes (default: 1)
|
|
|
|
|
|
|
|
HASURA_GRAPHQL_PG_CONNECTIONS Number of connections that need to be opened to
|
|
|
|
Postgres (default: 50)
|
|
|
|
|
|
|
|
HASURA_GRAPHQL_PG_TIMEOUT Each connection's idle time before it is closed
|
|
|
|
(default: 180 sec)
|
|
|
|
|
|
|
|
HASURA_GRAPHQL_TX_ISOLATION transaction isolation. read-committed /
|
|
|
|
repeatable-read / serializable
|
|
|
|
(default: read-commited)
|
|
|
|
|
2018-12-03 14:19:08 +03:00
|
|
|
HASURA_GRAPHQL_SERVER_PORT Port on which graphql-engine should be served
|
2018-11-29 13:30:26 +03:00
|
|
|
|
2018-12-03 14:19:08 +03:00
|
|
|
HASURA_GRAPHQL_ACCESS_KEY Secret access key, required to access this
|
|
|
|
instance. If specified client needs to send
|
|
|
|
'X-Hasura-Access-Key' header
|
2018-11-29 13:30:26 +03:00
|
|
|
|
2018-12-03 14:19:08 +03:00
|
|
|
HASURA_GRAPHQL_AUTH_HOOK The authentication webhook, required to
|
|
|
|
authenticate incoming request
|
2018-09-11 14:11:24 +03:00
|
|
|
|
2018-12-03 14:19:08 +03:00
|
|
|
HASURA_GRAPHQL_AUTH_HOOK_MODE The authentication webhook mode, GET|POST
|
|
|
|
(default: GET)
|
2018-09-11 14:11:24 +03:00
|
|
|
|
2018-12-03 14:19:08 +03:00
|
|
|
HASURA_GRAPHQL_CORS_DOMAIN The domain, including sheme and port,
|
|
|
|
to allow CORS for
|
2018-09-11 14:11:24 +03:00
|
|
|
|
2018-12-03 14:19:08 +03:00
|
|
|
HASURA_GRAPHQL_JWT_SECRET The JSON containing type and the JWK used for
|
|
|
|
verifying. e.g: `{"type": "HS256", "key":
|
|
|
|
"<your-hmac-shared-secret>"}`,`{"type": "RS256",
|
|
|
|
"key": "<your-PEM-RSA-public-key>"}
|
|
|
|
Enable JWT mode, the value of which is a JSON
|
2018-10-04 17:35:13 +03:00
|
|
|
|
2018-12-03 14:19:08 +03:00
|
|
|
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
|
2018-10-04 17:35:13 +03:00
|
|
|
|
2018-12-03 14:19:08 +03:00
|
|
|
HASURA_GRAPHQL_ENABLE_CONSOLE Enable API console. It is served at
|
|
|
|
'/' and '/console'
|