#graphql #diesel #integrate #specifically #id #derive #tailored

derive-id

Simple NewType ID's specifically tailored to integrate with Async GraphQL and Diesel

2 unstable releases

0.2.0 Mar 14, 2023
0.1.6 Jun 11, 2021

#806 in HTTP server

25 downloads per month

MIT license

4KB
63 lines

Derive ID

License Cargo Documentation

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.

	derive_id! {
		#[derive(Identifiable)]
		#[diesel(table_name = content)]
		#[graphql(name = "ContentID")]
		pub struct ContentId(#[diesel(column_name = "id")] i32);
	}

Dependencies

~14–26MB
~466K SLoC