Releases: Zendro-dev/graphql-server-model-codegen
0.6.1
0.6.0
0.6.0
Changelog
storage types
Added support for the following storage types
- cassandra
- mongodb
- amazonS3
- presto / trino
- neo4j
Domain specific language
This Version implements a change in the zendro domain specific language to define data models, specifically their associations between each other.
-
With this version there are 4 types of possible association types:
one_to_onemany_to_oneone_to_manymany_to_many
-
Additionally two additional fields were added.
implementation. Can be one offoreignkeys,generic,sql_cross_table. Describes the implementation on the model levelreverseAssociation. Name of the reverse association. Can be omitted for codgen of the server. Needed in the SPA.
-
The field
reverseAssocitionTypeformany_to_manyvia foreign key arrays was removed. If an association is of typemany_to_manyand the implementation isforeignkeysit will be done via foreignkey arrays. -
The fields
keyInin andkeysInwere unified to fieldkeysIn
Connection Helper
For Connection type resolvers implments direct access to the record without going through edges { node }
Merged Pull requests
The following Pull requests are merged
Version 0.5.0
Version 0.5.0
PRs
gql-codegen#157
gql-codegen#158
gql-server#49
gql-spa#18
gql-spa-codgen#64
graphiql-auth#7
starterPack#11
Changelog
graphql-server-model-codegen
- use
zendro-envto manage the integration-tests environment - added
-mflag to codegen for optional generation of the migrations
refactor readMany API to not use counts and have mandatory pagination
-
pagination is mandatory!.
- limit-offset:
paginationInputandlimitare required by the schema. - cbp:
paginationCursorInputrequired by schema. Eitherfirstorlasthas to be given. This is checked in the resolver. Error if invalid.
- limit-offset:
-
resolver checks record limit, model-layer does not care
checkAndAdjustRecordLimitresolver function removed, pagination arguments used instead. If exceeded error is thrown. This is now also the case in DDMs
-
views/includes/record-limit-helpers.ejsremoved as deprecated -
in case of
to_oneend of an association pagination withLIMIT 1(eitherlimitorfirst) is given to the root-resolver call. -
in case of
one_to_oneend of assoc without the foreignKey pagination withLIMIT 2is used in the root resolver, to check if a record is associated to more than 1 record. AppropriatebenignErroris added. -
readAllandreadAllCursorrefactored:- neither does need to count.
- neither will use a limit, if no limit is given. (e.g. when requiring a model manually inside
node) readAllCursorvalidity check of pagination args moved to resolver.- To avoid calculating the
OFFSETneeded for backward-pagination, instead the resulting records will be reversed post-fetching to get the desired order. - To calculate the pageInfo (
hasNextPage | hasPreviousPage) the query limit (if needed) will be increased by 1 (Extra check needed for the special case someone usespagination:{first: -1}), to get information about possible succeeding records. - Additionally a second query with reversed Operators (<,<=,>,>=) with no
ORDERandLIMIT 1will be run to get possible preceding records. - Functionalities outsourced to helper functions.
-
changed error message for invalid response from remote zendro-server.
-
Tests
- Integration Test "
21. Limit check" refactored - added Tests for DDM and Zendro-webservice
- added integration test for generic
readAllCursor
- Integration Test "
graphql skeleton
-
clean up server.js
-
add Helpers for
readAll&readAllCursor:
// SQL
searchConditionsToSequelize(search)
orderConditionsToSequelize(order, idAttribute)
orderConditionsToSequelizeBefore(order, idAttribute)
cursorPaginationArgumentsToSequelize(pagination, sequelizeOptions, idAttribute)
buildLimitOffsetSequelizeOptions(search, order, pagination, idAttribute)
buildCursorBasedSequelizeOption(search, order, pagination, idAttribute)
buildOppositeSearchSequelize(search, order, pagination, idAttribute)
buildPageInfo(edges, oppRecords, pagination)
buildEdgeObject(records)
reverseOrderConditions(order)
// Generic
cursorPaginationArgumentsToGeneric(search, pagination, orderOptions, idAttribute)
buildCursorBasedGenericOptions(search, order, pagination, idAttribute)
buildOppositeSearchGeneric(search, order, pagination, idAttribute)- rename
checkCountAndReduceRecordLimitHelpertocheckCountAndReduceRecordsLimit
single-page-app-codegen
- added non-blocking counter for table view and association lists
- refactor non-associated lists for mandatory pagination
- refactor plotly request module.
- refactor to-one display of the currently associated records
- refactor: simplify request module
single-page-app skeleton
- add global environment variable config file
- add
logRequesthelper for displaying of the request - add
checkResponsehelper to check request response for Errors - refactor
getSearchArgumentto be generic helper function
documentation
- added documentation on cursor-based-pagination argument
- added mandatory pagination argument to all places in the docu where needed
0.4.1
graphql-server-model-codegen
-
Fix unit tests to use the internal
sequelizemodel instance introduced in release 0.3.0. -
Refactor search input
valuefrom a composite object to two separate fields withing the search arguments:valueandvalueType.input search<Model>Input { field: AccessionField value: String valueType: InputType operator: Operator search: [search<Model>Input] }
-
Refactor
valueTypeto a newenum InputTypethat accepts all GraphQL primitives supported at Zendro, and a newArraytype used only by thesearchresolver.enum InputType{ Array String Int Float Boolean Date Time DateTime }
graphql-server
- Refactor the search input value spec in static files to match the changes in `graphql-server-model-codegen.
single-page-application-codegen
- Refactor model requests to use the new value spec in
graphql-serverandgraphql-server-model-codegen. - Fix integration tests to use the new configuration changes introduced in release 0.3.0
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.