Skip to content

0.3.0

Compare
Choose a tag to compare
@davelsan davelsan released this 28 Aug 08:25
· 191 commits to master since this release
0f155a0

graphql-server:

  • Added support for arbitrary local database connections in the data-model definitions (only sql support at the moment).

    • A new optional database property in the data-model definition specifies the connection it should use.
    • If this property is not defined, the mandatory storageType property value will be used to get the default configuration.
    • Each connection creates a shared sequelize instance. Separate database migrations and seeding will be performed on each connection.
    • The seeders folder 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>).
  • The default sequelize configuration file config.json has been removed in this release. A new data_models_storage_config.json file 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 the storageType property in the data-model (e.g. default-sql).
    • A new property storageType is also required in each connection (e.g. { storageType: "sql" }).
    • See the included data_models_storage_config.json for an example of the default connection.

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 sequelize instance to perform operations.
  • Minor changes to the integration tests command-line interface.

    • Added -b <branch> flag to dynamically checkout and fetch remote branches in the test graphql-server instances. This flag can be used during a default run, or in combination with -k, -s, and -T flags.
    • Added -C flag to only remove containers and generated code.
    • Added a -s flag to only setup or reset the testing environment server instances.
    • These changes allow running multiple branch tests without having to rebuild the Dockerfile.graphql_server image, and provide a more fine-grained control over the testing step process (e.g. for debugging).
  • 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-server installation. This allows manipulation of the server instances without having to rebuild images.
    • Deferred jq binary compilation to the server image build, which is used by node-jq.
    • Standardized debug logs and made optimizations where possible.