[][src]Derive Macro wundergraph_derive::WundergraphBelongsTo

#[derive(WundergraphBelongsTo)]
{
    // Attributes available to this derive:
    #[table_name]
}

A custom derive to implement the WundergraphBelongsTo trait for all HasOne fields of a given entity

Type attributes

  • Required:
    • #[table_name = "diesel_table_mod"]: Name of the underlying diesel table.

Field attributes

All attributes are optional. If no attributes are given the foreign key field name needs to match the name of the field in the corresponding diesel table!

  • #[column_name = "other_name"]: Use the given name instead of the field