Convert a static YML-file-based DB to GraphQL compatible DB like dgraph.
-
Create your YML-file-based DB by creating
- A schema definition file
schema.graphql
- A directory containing a sub-directory for each type in your schema and YML files defining instances of those types.
Example: https://github.com/stackdb-info/db
- A schema definition file
-
Define ENV variables and run the converter
SCHEMA_PATH
: Path to your schema fileYML_DB_PATH
: Path to the root of directory containing type directoriesGRAPHQL_SERVER
: DGraph entrypoint
See package.json for start command example.
-
Run
node populate.js
. You're done !