Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create mutations #133

Merged
merged 38 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d771d0e
WIP create_one mutation
karatakis Apr 24, 2023
3787e42
Add type utilities
karatakis May 1, 2023
0d6d934
Fix clippy
karatakis May 1, 2023
65aeddc
Fix types map
karatakis May 22, 2023
0970699
fix fmt
karatakis Jul 22, 2023
ce93e90
Improve error reporting
karatakis Jul 22, 2023
af7f0af
Add auto register mutations
karatakis Jul 22, 2023
9f8d7fb
Add tests
karatakis Jul 22, 2023
972ea44
Fix fmt
karatakis Jul 22, 2023
ce7a67f
Fix tests
karatakis Jul 22, 2023
3f2c6b3
Fix tests
karatakis Jul 22, 2023
8cb30b7
Fix fmt
karatakis Jul 22, 2023
d7660dd
Fix tests
karatakis Jul 22, 2023
850f77a
Fix tests
karatakis Jul 22, 2023
5a9d455
Fix tests
karatakis Jul 22, 2023
727474e
Fix test
karatakis Jul 22, 2023
954c0e6
Add filter_types_map
karatakis Jul 23, 2023
318d51c
Use output_conversions configuration
karatakis Jul 23, 2023
fd241ef
Fix fmt
karatakis Jul 24, 2023
ddc2d96
Fix clippy
karatakis Jul 24, 2023
d3dc65c
Fix temp test edge case
karatakis Jul 24, 2023
812d0c4
Fix tests
karatakis Jul 24, 2023
59c40d6
Add create_batch mutation
karatakis Jul 24, 2023
dce4275
Remove duplicate code and add tests
karatakis Jul 26, 2023
47ce1d5
Fix fmt & clippy
karatakis Jul 26, 2023
88f2832
Update tests and changelog
karatakis Jul 26, 2023
4863437
Fix tests
karatakis Jul 27, 2023
5aaea69
Fix tests
karatakis Jul 27, 2023
df9a215
Fix tests
karatakis Jul 27, 2023
e2ccc8d
Merge branch 'main' into mutations-create
karatakis Oct 9, 2023
7d1bf1b
Fix fmt
karatakis Oct 9, 2023
8df80d0
Fix workflows
karatakis Oct 9, 2023
94b7dbe
Fix github workflows
karatakis Oct 9, 2023
c05fc7b
Fix github workflows
karatakis Oct 9, 2023
bdb03cd
Fix clippy
karatakis Oct 9, 2023
e8703af
Update async-graphql
karatakis Oct 9, 2023
da40b8d
Fix unused import
karatakis Oct 9, 2023
bb6f57e
fix fmt
karatakis Oct 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading