wundergraph.server.ts Reference
Configure WunderGraph Server options
This section describes how to set configurations options of WunderGraph Server.
List of available options:
During development all options are optional and will be set via EnvironmentVariables with default values
listen.host
The host on which the WunderGraph Server should listen.
listen.port
The port on which the WunderGraph Server should listen.
serverUrl
This option allows you to configure the URL where your WunderGraph Server will be deployed. This is important for the WunderNode to be able to comminucate with WunderGraph Server.
logger.level
This option allows you to configure the logger level of WunderGraph Server.
Options default values
Each option when unset will get a value from the Default Environment Variables
or from the default value of that variable.
Option | Default Value | Default Environment Variable |
---|---|---|
listen.host | localhost | WG_SERVER_HOST |
listen.port | 9992 | WG_SERVER_PORT |
serverUrl | http://localhost:9992 | WG_SERVER_URL |
logger.level | info | WG_LOG_LEVEL |
Running in production
In production, it is mandatory to provide serverUrl
, because WunderNode needs to know where the WunderGraphServer is deployed.
You could provide it either by setting the Default Environment Variable WG_SERVER_URL
or as a static value.
When no options were provided you still could override default values by setting WG environment variables
When using custom environment variables, you need to make sure that the environment variables are set before:
wunderctl generate
command is executedWunderGraph Server
starts
Configuration examples
Configure options with static values
Configure options with custom environment variables
Configure options with default environment variables
This configuration illustrates what options you will get when options are not provided via the config.
By using default environment variables names you could stick with Wundergraph Default behaviour but supply different default values.