This PR implements the code generator changes necessary to query arbitrary local database connections defined at the data models layer. It also synchronizes graphql-server-model-codegen with changes in branch graphql-server#143-multiple-databases.
Because there is now a static models/adapters/index.js file in the graphql-server, the previous method of mounting generated code folders into the Docker image is no longer possible.
This has led to a different strategy for setting server instances dynamically, in addition to some improvements and optimizations to the integration tests CLI. The API remains mostly the same, with the flags we know and have been using until now having the same functionality.
To run integration tests using a specific graphql-server branch, the Dockerfile.graphql_server image file no longer needs to be modified. In fact, the server repository is no longer cloned in the image, which now only provides environment and tooling. An additional -b <branch> flag has been added to that effect.
# To execute a default run using the relevant branch for this PR
npm run test-integration -b "issue#143-multiple-databases"
# To execute a "keep containers alive" run
npm run test-integration -b "issue#143-multiple-databases" -k
# To execute a "generate code and run tests" and "keep containers alive"
npm run test-integration -b "issue#143-multiple-databases" -T -k
Other flags have also been added for a more modular functionality:
# To generate code only (this no longer ups the containers, as it was redundant with the other compatible flags)
npm run test-integration -g
# To clean up the generated code only
npm run test-integration -C
# To perform an initial setup: clones the server and re-creates instances
npm run test-integration -s
# Alternatively, an initial setup is compatible with the -b flag
npm run test-integration -b "issue#143-multiple-databases" -s
There is an API change in the graphql-server. Depending on whether there is a version sync between the two repos, this package might have to be bumped to the next minor version.
Issue
This PR addresses issue #143.
Description
GMSC Issue 143
This PR implements the code generator changes necessary to query arbitrary local database connections defined at the data models layer. It also synchronizes
graphql-server-model-codegen
with changes in branchgraphql-server#143-multiple-databases
.Integration Tests Changes
Because there is now a static
models/adapters/index.js
file in thegraphql-server
, the previous method of mounting generated code folders into the Docker image is no longer possible.This has led to a different strategy for setting server instances dynamically, in addition to some improvements and optimizations to the integration tests CLI. The API remains mostly the same, with the flags we know and have been using until now having the same functionality.
To run integration tests using a specific
graphql-server
branch, theDockerfile.graphql_server
image file no longer needs to be modified. In fact, the server repository is no longer cloned in the image, which now only provides environment and tooling. An additional-b <branch>
flag has been added to that effect.Other flags have also been added for a more modular functionality:
See the attached diagram for a visual explanation of how the API works. fzj-zendro-integration-tests-cli.pdf
Blocks
graphql-server#42
.Notes
graphql-server
. Depending on whether there is a version sync between the two repos, this package might have to be bumped to the nextminor
version.