Skip to content

Commit

Permalink
Fix small issues in juniper-advanced example (#673)
Browse files Browse the repository at this point in the history
Co-authored-by: Rob Ede <[email protected]>
  • Loading branch information
ethagnawl and robjtede authored Dec 11, 2023
1 parent c648953 commit c34afd3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions graphql/juniper-advanced/mysql-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 */;

--
Expand All @@ -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 */;

--
Expand Down
4 changes: 2 additions & 2 deletions graphql/juniper-advanced/src/schemas/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Vec<Product>> {
let mut conn = context.db_pool.get().unwrap();

Expand All @@ -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<Product> {
let mut conn = context.db_pool.get().unwrap();
let product: Result<Option<Row>, DBError> =
Expand Down

0 comments on commit c34afd3

Please sign in to comment.