diff --git a/Cargo.lock b/Cargo.lock index 86c7647..b5c9275 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3225,7 +3225,7 @@ dependencies = [ "r2d2_mysql", "serde", "serde_json", - "uuid 0.8.2", + "uuid 1.1.2", ] [[package]] @@ -6795,6 +6795,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd6469f4314d5f1ffec476e05f17cc9a78bc7a27a6a857842170bdf8d6f98d2f" dependencies = [ "getrandom 0.2.7", + "serde", ] [[package]] diff --git a/graphql/juniper-advanced/Cargo.toml b/graphql/juniper-advanced/Cargo.toml index ea4ed47..9974067 100644 --- a/graphql/juniper-advanced/Cargo.toml +++ b/graphql/juniper-advanced/Cargo.toml @@ -19,4 +19,4 @@ env_logger = "0.9" log = "0.4" serde = { version = "1", features = ["derive"] } serde_json = "1" -uuid = { version = "0.8", features = ["serde", "v4"] } +uuid = { version = "1", features = ["v4", "serde"] } diff --git a/graphql/juniper-advanced/src/schemas/root.rs b/graphql/juniper-advanced/src/schemas/root.rs index 09be8e6..179cb4a 100644 --- a/graphql/juniper-advanced/src/schemas/root.rs +++ b/graphql/juniper-advanced/src/schemas/root.rs @@ -93,7 +93,7 @@ pub struct MutationRoot; impl MutationRoot { fn create_user(context: &Context, user: UserInput) -> FieldResult { let mut conn = context.db_pool.get().unwrap(); - let new_id = uuid::Uuid::new_v4().to_simple().to_string(); + let new_id = uuid::Uuid::new_v4().simple().to_string(); let insert: Result, DBError> = conn.exec_first( "INSERT INTO user(id, name, email) VALUES(:id, :name, :email)", @@ -125,7 +125,7 @@ impl MutationRoot { fn create_product(context: &Context, product: ProductInput) -> FieldResult { let mut conn = context.db_pool.get().unwrap(); - let new_id = uuid::Uuid::new_v4().to_simple().to_string(); + let new_id = uuid::Uuid::new_v4().simple().to_string(); let insert: Result, DBError> = conn.exec_first( "INSERT INTO product(id, user_id, name, price) VALUES(:id, :user_id, :name, :price)",