A one size fits some NewType ID derive specifically tailored to integrate with Async GraphQL and Diesel. In particular, this allows for ID types that can be used in conjunction with diesel::associations::BelongsTo
.
rust
derive_id! {
#[table_name = "users"]
#[graphql(name = "UserID")]
pub struct UserId(#[column_name = "id"] i32);
}