Skip to content

0.12.0

Latest
Compare
Choose a tag to compare
@billy1624 billy1624 released this 29 Apr 14:58
· 41 commits to main since this release
57ed42c

Introduction the functional API of Seaography. Warning, this version has breaking changes, but it was a sacrifice in order to make the project easier to maintain. With this version we have support for field guards and field renames.

New Features

  • Functional API

  • Field renames

  • Field guards

  • add update_mutation

    This module enables the update mutation for entities. The update mutation takes an entity data object with a filter condition object,
    applies the update to the database and returns the modified entities.

  • add delete_mutation

    This module enables the delete mutation for entities. The delete mutation takes an entity condition filter object,
    deletes the selected entities from database and returns the number of deleted items.

  • add create_one_mutation

    This module is responsible to allow the Create One mutation. The mutation takes data for a single entity and returns the created entity

  • add create_batch_mutation

    This module is responsible to allow the Create Batch mutation. The mutation takes and array of data for multiple entities and returns the created entities

  • add entity_input

    This module is responsible to create a GraphQL input object for an SeaORM entity. Used in the create mutation

Breaking changes

  • Dropped the derive API in favor of a functional API

    SeaORM is a dynamic ORM for rust, this means that we can inspect the Tables, Columns properties on runtime. Recently async-graphql added support for dynamic creation of GraphQL nodes. Utilizing the dynamic nature of both libraries the Derive API is no longer needed and we developed a functional approach API. Moreover, the project in order to live long it needs to be maintainable (easy to maintain) and extensible (easy to extend), but the Derive API was fairly complex compared to a functional API. In order to make the migration easier we updated the seaography generator to generate using the new API

  • Decoupled sea-orm-cli from seaography-cli

    Because we don't have to extend the result produced by the sea-orm-cli we decoupled the dependency away fro, seaography in order to make future versions easier to maintain.

  • Dataloader optimizations are not introduced yet

    The Dataloader optimizations are going to be added in future versions

  • Some renames in Connection node fields, and pagination filtering

Enhancements

  • refactor entity types

    • add types_map This is responsible to allow the API user to provide custom entity field types, parsers and formatters
    • refactor entity_object to remove code responsible for type mapping
  • simplify schema builder

    • register functions
    • internal context
  • extend schema builder entity register function to include mutations

  • refactor filtering functionality

    • add FilterConfig for basic types
    • add filter_types_map That is responsible to allow the API user to provide custom entity field filter types and condition functions
    • add apply_condition that takes FilterInputConfig and condition as input and updates the condition
    • refactor active_enum_filter_input to utilize FilterConfig and provide apply_condition function
    • remove condition code from filter_input and utilize apply_condition function that uses FilterConfig
  • start error handling

  • slim down code generation for the query_root.rs file of a generated project

  • update crates

  • update examples