Skip to content

Releases: Zendro-dev/graphql-server-model-codegen

0.6.1

22 Jun 14:43
d30ace7
Compare
Choose a tag to compare

Summary

Workaround for cassandra storageType field-resolvers. See related issue / PR

Issues

PRs

0.6.0

17 Jun 15:08
c52fdb2
Compare
Choose a tag to compare

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_one
    • many_to_one
    • one_to_many
    • many_to_many
  • Additionally two additional fields were added.

    • implementation. Can be one of foreignkeys, generic, sql_cross_table. Describes the implementation on the model level
    • reverseAssociation. Name of the reverse association. Can be omitted for codgen of the server. Needed in the SPA.
  • The field reverseAssocitionType for many_to_many via foreign key arrays was removed. If an association is of type many_to_many and the implementation is foreignkeys it will be done via foreignkey arrays.

  • The fields keyIn in and keysIn were unified to field keysIn

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

#172 #181 #182 #183 #184 #185 #187

Version 0.5.0

08 Oct 12:09
Compare
Choose a tag to compare

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-env to manage the integration-tests environment
  • added -m flag to codegen for optional generation of the migrations

refactor readMany API to not use counts and have mandatory pagination

  • pagination is mandatory!.

    • limit-offset: paginationInput and limit are required by the schema.
    • cbp: paginationCursorInput required by schema. Either first or last has to be given. This is checked in the resolver. Error if invalid.
  • resolver checks record limit, model-layer does not care

    • checkAndAdjustRecordLimit resolver function removed, pagination arguments used instead. If exceeded error is thrown. This is now also the case in DDMs
  • views/includes/record-limit-helpers.ejs removed as deprecated

  • in case of to_one end of an association pagination with LIMIT 1 (either limit or first) is given to the root-resolver call.

  • in case of one_to_one end of assoc without the foreignKey pagination with LIMIT 2 is used in the root resolver, to check if a record is associated to more than 1 record. Appropriate benignError is added.

  • readAll and readAllCursor refactored:

    • neither does need to count.
    • neither will use a limit, if no limit is given. (e.g. when requiring a model manually inside node)
    • readAllCursor validity check of pagination args moved to resolver.
    • To avoid calculating the OFFSET needed 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 uses pagination:{first: -1}), to get information about possible succeeding records.
    • Additionally a second query with reversed Operators (<,<=,>,>=) with no ORDER and LIMIT 1 will 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

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 checkCountAndReduceRecordLimitHelper to checkCountAndReduceRecordsLimit

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 logRequest helper for displaying of the request
  • add checkResponse helper to check request response for Errors
  • refactor getSearchArgument to 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

11 Sep 11:42
Compare
Choose a tag to compare

graphql-server-model-codegen

  • Fix unit tests to use the internal sequelize model instance introduced in release 0.3.0.

  • Refactor search input value from a composite object to two separate fields withing the search arguments: value and valueType.

    input search<Model>Input {
      field: AccessionField
      value: String
      valueType: InputType
      operator: Operator
      search: [search<Model>Input]
    }
  • Refactor valueType to a new enum InputType that accepts all GraphQL primitives supported at Zendro, and a new Array type used only by the search resolver.

    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-server and graphql-server-model-codegen.
  • Fix integration tests to use the new configuration changes introduced in release 0.3.0

0.3.0

28 Aug 08:25
0f155a0
Compare
Choose a tag to compare

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.