Skip to content

Commit

Permalink
Create mutations (#133)
Browse files Browse the repository at this point in the history
* Add Create mutations
* Update async-graphql
  • Loading branch information
karatakis authored Oct 9, 2023
1 parent eaf980b commit d9282e6
Show file tree
Hide file tree
Showing 34 changed files with 3,396 additions and 1,770 deletions.
552 changes: 272 additions & 280 deletions .github/workflows/tests.yaml

Large diffs are not rendered by default.

47 changes: 44 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,51 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 1.0.0 - Pending
## 1.0.2 - 2023-10-09

`1.0.0-rc.1`: 2023-07-28
`1.0.0-rc.2`: 2023-07-29
* 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

* 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`

* add `entity_input`

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

* start error handling

## 1.0.1 - 2023-03-25

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

* update crates

* update examples

## 1.0.0 - 2023-03-25

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.

Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ keywords = ["async", "graphql", "mysql", "postgres", "sqlite"]
categories = ["database"]

[dependencies]
async-graphql = { version = "5.0.10", features = ["decimal", "chrono", "dataloader", "dynamic-schema"] }
async-graphql = { version = "6.0.7", features = ["decimal", "chrono", "dataloader", "dynamic-schema"] }
sea-orm = { version = "0.12.0", default-features = false, features = ["seaography"] }
itertools = { version = "0.11.0" }
heck = { version = "0.4.1" }
thiserror = "1.0.44"

[features]
default = []
Expand Down
4 changes: 2 additions & 2 deletions examples/mysql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ version = "0.3.0"

[dependencies]
poem = { version = "1.3.56" }
async-graphql-poem = { version = "5.0.10" }
async-graphql = { version = "5.0.10", features = ["decimal", "chrono", "dataloader", "dynamic-schema"] }
async-graphql-poem = { version = "6.0.7" }
async-graphql = { version = "6.0.7", features = ["decimal", "chrono", "dataloader", "dynamic-schema"] }
async-trait = { version = "0.1.72" }
dotenv = "0.15.0"
sea-orm = { version = "0.12.0", features = ["sqlx-mysql", "runtime-async-std-native-tls", "seaography"] }
Expand Down
5 changes: 0 additions & 5 deletions examples/mysql/src/entities/film.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ pub struct Model {
#[sea_orm(column_type = "Decimal(Some((5, 2)))")]
pub replacement_cost: Decimal,
pub rating: Option<Rating>,
#[sea_orm(
column_type = "custom(\"SET ('Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes')\")",
nullable
)]
pub special_features: Option<String>,
pub last_update: DateTimeUtc,
}

Expand Down
Loading

0 comments on commit d9282e6

Please sign in to comment.