Skip to content

Version 0.5.0

Latest
Compare
Choose a tag to compare
@coeit coeit released this 08 Oct 12:25
· 18 commits to master since this release

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