0.3.0
graphql-server:
-
Added support for arbitrary local database connections in the data-model definitions (only
sqlsupport at the moment).- A new optional
databaseproperty in the data-model definition specifies the connection it should use. - If this property is not defined, the mandatory
storageTypeproperty value will be used to get the default configuration. - Each connection creates a shared
sequelizeinstance. Separate database migrations and seeding will be performed on each connection. - The
seedersfolder must now have a sub-folder structure that matches the database name that needs to be seeded (e.g.seeders/default-sql/<seeders-file.js>).
- A new optional
-
The default
sequelizeconfiguration fileconfig.jsonhas been removed in this release. A newdata_models_storage_config.jsonfile is included.- This file should include all connections required by the
graphql-server. - The default connection for any data-model is specified as
default-<storageType>. This<storageType>suffix should match thestorageTypeproperty in the data-model (e.g.default-sql). - A new property
storageTypeis also required in each connection (e.g.{ storageType: "sql" }). - See the included data_models_storage_config.json for an example of the default connection.
- This file should include all connections required by the
graphql-server-model-codegen
-
Code-generator changes to support the new arbitrary database configurations.
- Migrations create a sub-folder structure matching the keys in
data_models_storage_config.json. - Adapted generated models to use the new shared connection pool.
- Each generated model now uses its internal
sequelizeinstance to perform operations.
- Migrations create a sub-folder structure matching the keys in
-
Minor changes to the integration tests command-line interface.
- Added
-b <branch>flag to dynamically checkout and fetch remote branches in the testgraphql-serverinstances. This flag can be used during adefault run, or in combination with-k,-s, and-Tflags. - Added
-Cflag to only remove containers and generated code. - Added a
-sflag to only setup or reset the testing environment server instances. - These changes allow running multiple branch tests without having to rebuild the
Dockerfile.graphql_serverimage, and provide a more fine-grained control over the testing step process (e.g. for debugging).
- Added
-
Extensive refactoring of the integration tests API:
- Adapted tests to work with the new configuration changes.
- Refactored functions to be more modular and provide a more composable API.
- Detached docker image builds from
graphql-serverinstallation. This allows manipulation of the server instances without having to rebuild images. - Deferred
jqbinary compilation to the server image build, which is used bynode-jq. - Standardized debug logs and made optimizations where possible.