How to configure multiple data sources on startup? #9665
-
I'm currently running the community edition of hasura in my infrastructure and I'm using I found these docs but I can't quite figure out how to wire up a config file like that. I notice that the title of the section mentions using the cli and api. I've also searched for how to "point" to a config file at startup with the docker image but haven't been successful. Is there a way to configure hasura at startup with more than 1 data source? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Data sources are configured at runtime by adding them using the metadata API. There's no way of pointing Hasura GraphQL Engine to a configuration file at startup because the configuration is stored in the metadata database. However, you can use the CLI to apply a configuration to a running HGE instance. As you've been using In order to add a new data source to an existing HGE instance, you can use the Once you've done this, you can set up the Hasura CLI and run |
Beta Was this translation helpful? Give feedback.
Data sources are configured at runtime by adding them using the metadata API. There's no way of pointing Hasura GraphQL Engine to a configuration file at startup because the configuration is stored in the metadata database. However, you can use the CLI to apply a configuration to a running HGE instance.
As you've been using
HASURA_GRAPHQL_DATABASE_URL
, Hasura is configured the first time it starts up with that database as both the metadata DB and the source DB named "default". When you start it again later, the URL will be used for the metadata database only. HGE will then read the metadata, which already contains the same URL for the "default" source DB.In order to add a new data source…