Changing config values
July 20, 2023 ยท View on GitHub
While the initial Gateway config values can be provided as environment variables (see Initial configuration section in the Local testing tutorial) it is important to note that some of them can later be changed via operator mutations executed through the Orion GraphQL API.
If a config value is changed this way, it will be persisted in the database (even across upgrades, as it's part of the Offchain state) and take priority over the value provided as an environment variable. This means that the actual value of a given config variable may be different than the value you see in the .env file!
For example:
- You can change the value of
RELEVANCE_WEIGHTSconfig variable viasetVideoWeightsmutation - You can change the value of
KILL_SWITCH_ONconfig variable viasetKillSwitchmutation - You can change the value of
VIDEO_VIEW_PER_USER_TIME_LIMITconfig variable viasetVideoViewPerUserTimeLimitmutation - You can change the value of
SUPPORT_NO_CATEGORY_VIDEOSandSUPPORT_NEW_CATEGORIESconfig variables viasetSupportedCategoriesmutation - etc.
To ilustrate this, we'll authenticate as a Gateway Operator and execute a few mutations to change the values of some config variables:

We can now query the overriden values using the gatewayConfigs query:
query {
gatewayConfigs {
id
value
updatedAt
}
}
In the results, we'll only see the config values that are actually stored in the database. For all other config variables, the value provided as an environment variable will remain in effect.
