From c34afd32faaf512f79d0d001d0b55ce4ce59fb12 Mon Sep 17 00:00:00 2001 From: Pete Doherty Date: Mon, 11 Dec 2023 01:54:22 -0500 Subject: [PATCH] Fix small issues in juniper-advanced example (#673) Co-authored-by: Rob Ede --- graphql/juniper-advanced/mysql-schema.sql | 4 ++-- graphql/juniper-advanced/src/schemas/root.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/graphql/juniper-advanced/mysql-schema.sql b/graphql/juniper-advanced/mysql-schema.sql index 2fde582d..2e49e306 100644 --- a/graphql/juniper-advanced/mysql-schema.sql +++ b/graphql/juniper-advanced/mysql-schema.sql @@ -30,7 +30,7 @@ CREATE TABLE `product` ( PRIMARY KEY (`id`), KEY `product_fk0` (`user_id`), CONSTRAINT `product_fk0` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) -) ENGINE=InnoDB CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +) ENGINE=InnoDB CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -55,7 +55,7 @@ CREATE TABLE `user` ( `email` varchar(255) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `email` (`email`) -) ENGINE=InnoDB CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +) ENGINE=InnoDB CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- diff --git a/graphql/juniper-advanced/src/schemas/root.rs b/graphql/juniper-advanced/src/schemas/root.rs index 179cb4af..478a2342 100644 --- a/graphql/juniper-advanced/src/schemas/root.rs +++ b/graphql/juniper-advanced/src/schemas/root.rs @@ -51,7 +51,7 @@ impl QueryRoot { Ok(User { id, name, email }) } - #[graphql(description = "List of all users")] + #[graphql(description = "List of all products")] fn products(context: &Context) -> FieldResult> { let mut conn = context.db_pool.get().unwrap(); @@ -65,7 +65,7 @@ impl QueryRoot { Ok(products) } - #[graphql(description = "Get Single user reference by user ID")] + #[graphql(description = "Get Single product reference by product ID")] fn product(context: &Context, id: String) -> FieldResult { let mut conn = context.db_pool.get().unwrap(); let product: Result, DBError> =